ROSE 0.11.145.147
Public Member Functions | Protected Member Functions | List of all members
Sawyer::Message::Filter Class Referenceabstract

Description

Base class for internal nodes that filter messages.

Filtering is applied when properties are baked, which should happen exactly once for each message, usually just before the message is posted for the first time.

Definition at line 723 of file Message.h.

#include <Sawyer/Message.h>

Inheritance diagram for Sawyer::Message::Filter:
Inheritance graph
[legend]
Collaboration diagram for Sawyer::Message::Filter:
Collaboration graph
[legend]

Public Member Functions

virtual void bakeDestinations (const MesgProps &, BakedDestinations &)
 Bakes message properties according to the plumbing lattice.
 
virtual bool shouldForward (const MesgProps &)=0
 Predicate determines when a message should be forwarded onward.
 
virtual void forwarded (const MesgProps &)=0
 Called once by bakeDestinations if shouldForward() returned true.
 
- Public Member Functions inherited from Sawyer::Message::Multiplexer
virtual void post (const Mesg &, const MesgProps &)
 Causes a message to be emitted.
 
MultiplexerPtr addDestination (const DestinationPtr &)
 Adds a child node to this node of the lattice.
 
MultiplexerPtr removeDestination (const DestinationPtr &)
 Removes the specified child from this node of the lattice.
 
MultiplexerPtr to (const DestinationPtr &)
 Add a child nodes to this node of the lattice and returns this node.
 
MultiplexerPtr to (const DestinationPtr &, const DestinationPtr &)
 Add a child nodes to this node of the lattice and returns this node.
 
MultiplexerPtr to (const DestinationPtr &, const DestinationPtr &, const DestinationPtr &)
 Add a child nodes to this node of the lattice and returns this node.
 
MultiplexerPtr to (const DestinationPtr &, const DestinationPtr &, const DestinationPtr &, const DestinationPtr &)
 Add a child nodes to this node of the lattice and returns this node.
 
- Public Member Functions inherited from Sawyer::Message::Destination
MesgProps mergePropertiesNS (const MesgProps &props)
 Merge properties of this lattice node into the specified properties.
 
const MesgPropsdefaultPropertiesNS () const
 Default values for message properties.
 
MesgPropsdefaultPropertiesNS ()
 Default values for message properties.
 
const MesgPropsoverridePropertiesNS () const
 Overrides message properties.
 
MesgPropsoverridePropertiesNS ()
 Overrides message properties.
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor.
 
 SharedObject (const SharedObject &)
 Copy constructor.
 
virtual ~SharedObject ()
 Virtual destructor.
 
SharedObjectoperator= (const SharedObject &)
 Assignment.
 
- Public Member Functions inherited from Sawyer::SharedFromThis< Destination >
SharedPointer< Destination > sharedFromThis ()
 Create a shared pointer from this.
 
SharedPointer< const Destination > sharedFromThis () const
 Create a shared pointer from this.
 

Protected Member Functions

 Filter ()
 Constructor for derived classes.
 
- Protected Member Functions inherited from Sawyer::Message::Multiplexer
 Multiplexer ()
 Constructor for derived classes.
 

Additional Inherited Members

- Static Public Member Functions inherited from Sawyer::Message::Multiplexer
static MultiplexerPtr instance ()
 Allocating constructor.
 
- Protected Attributes inherited from Sawyer::Message::Destination
Sawyer::SynchronizationTraits< Sawyer::SingleThreadedTag >::RecursiveMutex mutex_
 Mutex protecting data members here and in subclasses.
 
MesgProps dflts_
 Default properties merged into each incoming message.
 
MesgProps overrides_
 Override properties applied to incoming message.
 

Constructor & Destructor Documentation

◆ Filter()

Sawyer::Message::Filter::Filter ( )
inlineprotected

Constructor for derived classes.

Non-subclass users should use instance instead.

Definition at line 726 of file Message.h.

Member Function Documentation

◆ bakeDestinations()

virtual void Sawyer::Message::Filter::bakeDestinations ( const MesgProps ,
BakedDestinations baked 
)
virtual

Bakes message properties according to the plumbing lattice.

The given message properties are applied to the plumbing lattice rooted at this Destination, adjusted according to the default and override properties at this node of the lattice and all lower nodes. The property values at the bottom nodes of the lattice are appended to the baked argument.

Thread safety: All implementations must be thread-safe.

Reimplemented from Sawyer::Message::Multiplexer.

◆ shouldForward()

virtual bool Sawyer::Message::Filter::shouldForward ( const MesgProps )
pure virtual

Predicate determines when a message should be forwarded onward.

This method is called once from bakeDestinations(), and if it returns true then the baking is forwarded on to the child nodes in the plumbing lattice. If this method returns false then none of the descendents will see the properties (unless they can be reached by some other path), and the unreached leaf nodes will not be returned by bakeDestinations().

Thread safety: all implementations must be thread-safe.

Implemented in Sawyer::Message::SequenceFilter, Sawyer::Message::TimeFilter, and Sawyer::Message::ImportanceFilter.

◆ forwarded()

virtual void Sawyer::Message::Filter::forwarded ( const MesgProps )
pure virtual

Called once by bakeDestinations if shouldForward() returned true.

This method is called after the properties have been forwarded to the child nodes.

Implemented in Sawyer::Message::SequenceFilter, Sawyer::Message::TimeFilter, and Sawyer::Message::ImportanceFilter.


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