RSB  0.19.0
rsb::filter::CauseFilter Class Reference

This filter matches events in which a particular cause is present. More...

#include <CauseFilter.h>

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

Public Member Functions

 CauseFilter (const rsc::misc::UUID &cause, bool invert=false)
 Creates a new cause filter that matches event in whose cause vector cause is present. More...
 
 CauseFilter (const EventId &cause, bool invert=false)
 Creates a new cause filter that matches event in whose cause vector cause is present. More...
 
rsc::misc::UUID getCause () const
 Return the cause that has to be present in events matched by this filter. More...
 
bool isInverted () const
 Indicates whether the filter is inverted. More...
 
bool match (EventPtr e)
 Matches the given event against the constraints specified by this filter. More...
 
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. More...
 
- Public Member Functions inherited from rsb::filter::Filter
 Filter ()
 
virtual ~Filter ()
 

Private Attributes

EventIdPtr causeAsEventId
 
rsc::misc::UUID causeAsUUID
 
bool invert
 

Detailed Description

This filter matches events in which a particular cause is present.

Author
jmoringe

Definition at line 45 of file CauseFilter.h.

Constructor & Destructor Documentation

rsb::filter::CauseFilter::CauseFilter ( const rsc::misc::UUID &  cause,
bool  invert = false 
)

Creates a new cause filter that matches event in whose cause vector cause is present.

Parameters
causeThe cause that has to be present in events matching the filter.
invertIf true, events match if cause is not present in their cause vector.
rsb::filter::CauseFilter::CauseFilter ( const EventId cause,
bool  invert = false 
)

Creates a new cause filter that matches event in whose cause vector cause is present.

Parameters
causeThe cause that has to be present in events matching the filter.
invertIf true, events match if cause is not present in their cause vector.

Definition at line 41 of file CauseFilter.cpp.

Member Function Documentation

UUID rsb::filter::CauseFilter::getCause ( ) const

Return the cause that has to be present in events matched by this filter.

Returns
The cause potentially converted to a rsc::misc::UUID.

Definition at line 46 of file CauseFilter.cpp.

References causeAsEventId, and causeAsUUID.

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

Indicates whether the filter is inverted.

Returns
true if the filter is inverted.

Definition at line 54 of file CauseFilter.cpp.

References invert.

bool rsb::filter::CauseFilter::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 58 of file CauseFilter.cpp.

References causeAsEventId, causeAsUUID, and invert.

void rsb::filter::CauseFilter::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 75 of file CauseFilter.cpp.

Member Data Documentation

EventIdPtr rsb::filter::CauseFilter::causeAsEventId
private

Definition at line 91 of file CauseFilter.h.

Referenced by getCause(), and match().

rsc::misc::UUID rsb::filter::CauseFilter::causeAsUUID
private

Definition at line 92 of file CauseFilter.h.

Referenced by getCause(), and match().

bool rsb::filter::CauseFilter::invert
private

Definition at line 93 of file CauseFilter.h.

Referenced by isInverted(), and match().


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