ROSE  0.11.145.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Sawyer::Message::TimeFilter Class Reference

Description

Filters messages based on time.

Any message posted within some specified time of a previously forwarded message will not be forwarded to children nodes in the plumbing lattice.

Definition at line 819 of file Message.h.

#include <util/Sawyer/Message.h>

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

Public Member Functions

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

Static Public Member Functions

static TimeFilterPtr instance (double minInterval)
 Allocating constructor. More...
 
- Static Public Member Functions inherited from Sawyer::Message::Multiplexer
static MultiplexerPtr instance ()
 Allocating constructor. More...
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Sawyer::Message::Destination
Sawyer::SynchronizationTraits< Sawyer::SingleThreadedTag >::RecursiveMutex mutex_
 Mutex protecting data members here and in subclasses. More...
 
MesgProps dflts_
 Default properties merged into each incoming message. More...
 
MesgProps overrides_
 Override properties applied to incoming message. More...
 

Constructor & Destructor Documentation

Sawyer::Message::TimeFilter::TimeFilter ( double  minInterval)
inlineexplicitprotected

Constructor for derived classes.

Non-subclass users should use instance instead.

Definition at line 829 of file Message.h.

Member Function Documentation

static TimeFilterPtr Sawyer::Message::TimeFilter::instance ( double  minInterval)
inlinestatic

Allocating constructor.

Creates an instance that limits forwarding of messages to at most one message every minInterval seconds.

Definition at line 835 of file Message.h.

double Sawyer::Message::TimeFilter::minInterval ( ) const

Property: minimum time between messages.

Any message arriving within the specified interval from a previous message that was forwarded to children in the lattice will be discarded.

Thread safety: This method is thread-safe.

TimeFilterPtr Sawyer::Message::TimeFilter::minInterval ( double  d)

Property: minimum time between messages.

Any message arriving within the specified interval from a previous message that was forwarded to children in the lattice will be discarded.

Thread safety: This method is thread-safe.

double Sawyer::Message::TimeFilter::initialDelay ( ) const

Property: delay before the next message.

Any message arriving within the specified number of seconds from this call will be discarded.

Thread safety: This method is thread-safe.

TimeFilterPtr Sawyer::Message::TimeFilter::initialDelay ( double  d)

Property: delay before the next message.

Any message arriving within the specified number of seconds from this call will be discarded.

Thread safety: This method is thread-safe.

size_t Sawyer::Message::TimeFilter::nPosted ( ) const

Number of messages processed.

This includes messages forwarded and messages not forwarded.

Thread safety: This method is thread-safe.

virtual bool Sawyer::Message::TimeFilter::shouldForward ( const MesgProps )
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.

Implements Sawyer::Message::Filter.

virtual void Sawyer::Message::TimeFilter::forwarded ( const MesgProps )
virtual

Called once by bakeDestinations if shouldForward() returned true.

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

Implements Sawyer::Message::Filter.


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