RSB
0.19.0
|
This filter matches events based on the data type of their payload. More...
#include <TypeFilter.h>
Public Member Functions | |
TypeFilter (const std::string &type, bool invert=false) | |
Creates a new type filter that matches events whose payload is of the type designated by type. More... | |
const std::string & | getType () const |
bool | isInverted () const |
bool | match (EventPtr event) |
Matches the given event against the constraints specified by this filter. More... | |
void | notifyObserver (FilterObserverPtr observer, FilterAction::Types action) |
Double-dispatch method to notfify a FilterObserver about changes for this filter with a more specific type that the general Filter interface. More... | |
Public Member Functions inherited from rsb::filter::Filter | |
Filter () | |
virtual | ~Filter () |
Static Public Member Functions | |
template<typename T > | |
static TypeFilter * | createForType (bool invert=false) |
Creates a new type filter that matches events whose payload is of type T . More... | |
Private Attributes | |
std::string | type |
bool | invert |
This filter matches events based on the data type of their payload.
Definition at line 43 of file TypeFilter.h.
rsb::filter::TypeFilter::TypeFilter | ( | const std::string & | type, |
bool | invert = false |
||
) |
Creates a new type filter that matches events whose payload is of the type designated by type.
type | String designating the which the payload of matching events has to have. |
invert | If true, events match if their payload type does not match type. |
Definition at line 36 of file TypeFilter.cpp.
|
inlinestatic |
Creates a new type filter that matches events whose payload is of type T
.
T | The type matching event payloads must have. |
invert | If true, events match if their type fields do not match type. |
Definition at line 55 of file TypeFilter.h.
References event.
const std::string & rsb::filter::TypeFilter::getType | ( | ) | const |
Definition at line 41 of file TypeFilter.cpp.
References type.
bool rsb::filter::TypeFilter::isInverted | ( | ) | const |
Definition at line 45 of file TypeFilter.cpp.
References invert.
|
virtual |
Matches the given event against the constraints specified by this filter.
e | the event to match. Must not be changed! |
true
if the event matches the restrictions specified by this filter and hence can be delivered to the client, false
to remove the event from the stream. Implements rsb::filter::Filter.
Definition at line 49 of file TypeFilter.cpp.
|
virtual |
Double-dispatch method to notfify a FilterObserver about changes for this filter with a more specific type that the general Filter interface.
The default implementation does not generate a specific notification on FilterObserver. Override this method if there is a specific reception method in FilterObserver.
fo | the observer to notify |
at | action that is performed with this filter. Just pass this to the observer |
Reimplemented from rsb::filter::Filter.
Definition at line 54 of file TypeFilter.cpp.
|
private |
Definition at line 81 of file TypeFilter.h.
Referenced by isInverted(), and match().
|
private |
Definition at line 80 of file TypeFilter.h.