#include <serial_listener.h>
Public Member Functions | |
BlockingFilter (ComparatorType comparator, SerialListener &listener) | |
void | callback (const std::string &token) |
std::string | wait (long ms) |
virtual | ~BlockingFilter () |
Public Attributes | |
FilterPtr | filter_ptr |
Private Attributes | |
boost::condition_variable | cond |
SerialListener * | listener_ |
boost::mutex | mutex |
std::string | result |
This is the a filter that provides a wait function for blocking until a match is found.
This should probably not be created manually, but instead should be constructed using SerialListener::createBlockingFilter(ComparatorType) function which returns a BlockingFilter instance.
Definition at line 733 of file serial_listener.h.
serial::utils::BlockingFilter::BlockingFilter | ( | ComparatorType | comparator, |
SerialListener & | listener | ||
) | [inline] |
Definition at line 736 of file serial_listener.h.
virtual serial::utils::BlockingFilter::~BlockingFilter | ( | ) | [inline, virtual] |
Definition at line 742 of file serial_listener.h.
void serial::utils::BlockingFilter::callback | ( | const std::string & | token | ) | [inline] |
Definition at line 765 of file serial_listener.h.
std::string serial::utils::BlockingFilter::wait | ( | long | ms | ) | [inline] |
Waits a given number of milliseconds or until a token is matched. If a token is matched it is returned, otherwise an empty string is returned.
ms | Time in milliseconds to wait on a new token. |
Definition at line 756 of file serial_listener.h.
boost::condition_variable serial::utils::BlockingFilter::cond [private] |
Definition at line 776 of file serial_listener.h.
Definition at line 763 of file serial_listener.h.
Definition at line 775 of file serial_listener.h.
boost::mutex serial::utils::BlockingFilter::mutex [private] |
Definition at line 777 of file serial_listener.h.
std::string serial::utils::BlockingFilter::result [private] |
Definition at line 778 of file serial_listener.h.