RSB  0.19.0
rsb::filter::MethodFilter Class Reference

This filter matches events based on the value of their method field. More...

#include <MethodFilter.h>

Inheritance diagram for rsb::filter::MethodFilter:
Inheritance graph
Collaboration diagram for rsb::filter::MethodFilter:
Collaboration graph

Public Member Functions

 MethodFilter (const std::string &method, bool invert=false)
 Creates a new method filter that matches events whose method fields have the value method. More...
 
const std::string & getMethod () 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 ()
 

Private Attributes

std::string method
 
bool invert
 

Detailed Description

This filter matches events based on the value of their method field.

Author
jmoringe

Definition at line 42 of file MethodFilter.h.

Constructor & Destructor Documentation

rsb::filter::MethodFilter::MethodFilter ( const std::string &  method,
bool  invert = false 
)

Creates a new method filter that matches events whose method fields have the value method.

Parameters
methodString value that the method field of matched events has to have.
invertIf true, events match if their method fields do not match method.

Definition at line 34 of file MethodFilter.cpp.

Member Function Documentation

const std::string & rsb::filter::MethodFilter::getMethod ( ) const

Definition at line 39 of file MethodFilter.cpp.

References method.

bool rsb::filter::MethodFilter::isInverted ( ) const

Definition at line 43 of file MethodFilter.cpp.

References invert.

bool rsb::filter::MethodFilter::match ( EventPtr  e)
virtual

Matches the given event against the constraints specified by this filter.

Parameters
ethe event to match. Must not be changed!
Returns
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 47 of file MethodFilter.cpp.

References invert, and method.

void rsb::filter::MethodFilter::notifyObserver ( FilterObserverPtr  fo,
FilterAction::Types  at 
)
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.

Parameters
fothe observer to notify
ataction that is performed with this filter. Just pass this to the observer

Reimplemented from rsb::filter::Filter.

Definition at line 52 of file MethodFilter.cpp.

Member Data Documentation

bool rsb::filter::MethodFilter::invert
private

Definition at line 66 of file MethodFilter.h.

Referenced by isInverted(), and match().

std::string rsb::filter::MethodFilter::method
private

Definition at line 65 of file MethodFilter.h.

Referenced by getMethod(), and match().


The documentation for this class was generated from the following files: