Public Member Functions | Public Attributes | Private Attributes
serial::utils::BlockingFilter Class Reference

#include <serial_listener.h>

List of all members.

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
SerialListenerlistener_
boost::mutex mutex
std::string result

Detailed Description

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.

See also:
serial::SerialListener::ComparatorType, serial::SerialListener::createBlockingFilter

Definition at line 733 of file serial_listener.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
msTime in milliseconds to wait on a new token.
Returns:
std::string token that was matched or "" if none were matched.

Definition at line 756 of file serial_listener.h.


Member Data Documentation

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.

Definition at line 778 of file serial_listener.h.


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


serial_utils
Author(s): William Woodall , John Harrison
autogenerated on Thu Jun 6 2019 19:02:26