|
| message_collector (dpp::cluster *cl, uint64_t duration) |
|
virtual void | completed (const std::vector< dpp::message > &list) |
| Return the completed collection. More...
|
|
virtual void | completed (const std::vector< C > &list)=0 |
| You must implement this function to receive the completed list of captured objects. More...
|
|
virtual const dpp::message * | filter (const dpp::message_create_t &element) |
| Select and filter the items which are to appear in the list This is called every time a new event is fired, to filter the event and determine which of the items is sent to the list. Returning nullptr excludes the item from the list. More...
|
|
virtual const C * | filter (const T &element)=0 |
| Filter the list of elements. More...
|
|
virtual void | cancel () |
| Immediately cancels the collector. More...
|
|
A test version of the message collector for use in unit tests.
template<class T , class C >
Filter the list of elements.
Every time an event is fired on the collector, this method wil be called to determine if we should add an object to the list or not. This function can then process the element
value, extract the parts which are to be saved to a list (e.g. a dpp::message out of a dpp::message_create_t) and return it as the return value. Returning a value of nullptr causes no object to be stored.
- Parameters
-
element | The event data to filter |
- Returns
- const C* Returned object or nullptr