RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::filter::Filter Class Reference

A filter filters an event stream by removing unwanted events. More...

#include <Filter.h>

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

Public Member Functions

 Filter ()
virtual ~Filter ()
virtual bool match (EventPtr e)=0
 Matches the given event against the constraints specified by this filter.
virtual void notifyObserver (FilterObserverPtr fo, FilterAction::Types at)
 Double-dispatch method to notfify a FilterObserver about changes for this filter with a more specific type that the general Filter interface.

Detailed Description

A filter filters an event stream by removing unwanted events.

Therefore it has a function to match an event against its restrictions.

As some there may be optimization possible for certain specific filter types, a double-dispatch logic is available using FilterObserver. Instances must implement this notifyObserver if they are relevant for FilterObserver instances.

Note
most RSB classes using filters expect that the filters will not change their configuration after they have been added to e.g. the listener. So generally do not change a filter after this. Instead first remove it and then re-add the reconfigured instance.
Author
swrede

Definition at line 56 of file Filter.h.

Constructor & Destructor Documentation

rsb::filter::Filter::Filter ( )

Definition at line 33 of file Filter.cpp.

rsb::filter::Filter::~Filter ( )
virtual

Definition at line 36 of file Filter.cpp.

Member Function Documentation

virtual bool rsb::filter::Filter::match ( EventPtr  e)
pure 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.

Implemented in rsb::filter::OriginFilter, and rsb::filter::ScopeFilter.

void rsb::filter::Filter::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 in rsb::filter::OriginFilter, and rsb::filter::ScopeFilter.

Definition at line 39 of file Filter.cpp.


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