#include <serial_listener.h>
Public Member Functions | |
Filter (ComparatorType comparator, DataCallback callback) | |
virtual | ~Filter () |
Public Attributes | |
DataCallback | callback_ |
ComparatorType | comparator_ |
Private Member Functions | |
Filter (const Filter &) | |
void | operator= (const Filter &) |
const Filter & | operator= (Filter) |
Represents a filter which new data is passed through.
The filter consists of a comparator and a callback. The comparator takes a token and returns true if it matches, false if it doesn't. If a match occurs the serial listener will dispatch a call of the callback with the matched data in a another thread. The comparator should be as short as possible, but the callback can be longer since it is executed in a thread or thread pool.
comparator | A ComparatorType that matches incoming data, returns true for a match, false othewise. |
callback | A DataCallback that gets called when a match occurs. |
Definition at line 157 of file serial_listener.h.
serial::utils::Filter::Filter | ( | ComparatorType | comparator, |
DataCallback | callback | ||
) | [inline] |
Definition at line 160 of file serial_listener.h.
virtual serial::utils::Filter::~Filter | ( | ) | [inline, virtual] |
Definition at line 162 of file serial_listener.h.
serial::utils::Filter::Filter | ( | const Filter & | ) | [private] |
void serial::utils::Filter::operator= | ( | const Filter & | ) | [private] |
Definition at line 165 of file serial_listener.h.
Definition at line 164 of file serial_listener.h.