#include <filter.h>
Inheritance diagram for rfc822::filter::filter::
Public Methods | |
filter () | |
c'tor. More... | |
virtual | ~filter () |
d'tor. More... | |
bool | no_loop_check () |
check loops. More... | |
virtual void | onMsg (const msg &) |
receive a message. More... | |
virtual void | onCleanup () |
stops filtering. More... | |
virtual void | onInit () |
initializes filtering. More... | |
void | connect (const string &outgoing, filter &dest, bool fConnect=true) |
connects a filter with a target. More... | |
void | connect (filter &dest, bool fConnect=true) |
Static Public Methods | |
void | connect (filter &src, filter &dest, bool fConnect=true) |
void | connect (filter &src, const string &outgoing, filter &dest, bool fConnect=true) |
template<class T> void | copy (T &in, filter &f) |
copies a message collection into a filter. More... | |
void | copy (const msg &in, filter &f) |
copies an individual message into a filter. More... | |
Protected Methods | |
void | redirect (const msg &m, const string &slot) |
redirects a message. More... | |
void | redirect (const msg &m) |
sends a message to all recipients exactly once. More... |
filter objects are used to filter (that's where the name is from ;-) individual messages.
filter objects have one incoming slot (the onMsg() method), in which they receive the messages to handle. The filter::connect() methods are used to connect any number of outgoing slots to incoming slots of other filter objects.
Incoming messages are handled via the onMsg() method, which may change a message and redirect() it to zero, one, or more named outgoing slots.
|
c'tor.
|
|
d'tor.
|
|
|
|
|
|
|
|
connects a filter with a target. Using this method one may establish a "filter chain" or "filter graph".
Note that you cannot connect a filter to a slot more than once. |
|
copies an individual message into a filter.
|
|
copies a message collection into a filter.
|
|
check loops. call this method to check for loops. It returns false if the current filter graph forms a loop. In such a situation it is dangerous to run the filter, as infinite recursion could occur. |
|
stops filtering. When called no additional messages are to be expected. Use this method to do cleanup, statistics etc.pp. |
|
initializes filtering. When called no additional messages are to be expected. Use this method to do initialization etc.pp. |
|
receive a message. filter objects receive messages via this method. They then are able to do whatever they want with it. The default implementation sends the message to all targets of the filter object. |
|
sends a message to all recipients exactly once.
|
|
redirects a message. sends the message m to the named slot slot, i.e. all destination filters that are connected with that slot by means of the connect() method are sent the message.
|