Classes | Typedefs
serial::utils Namespace Reference

Classes

class  BlockingFilter
class  BufferedFilter
class  ConcurrentQueue
class  Filter
class  SerialListener
class  SerialListenerException

Typedefs

typedef boost::shared_ptr
< BlockingFilter
BlockingFilterPtr
typedef boost::shared_ptr
< BufferedFilter
BufferedFilterPtr
typedef boost::function< bool(const
std::string &)> 
ComparatorType
typedef boost::function< void(const
std::string &)> 
DataCallback
typedef boost::function< void(const
std::exception &)> 
ExceptionCallback
typedef boost::shared_ptr< FilterFilterPtr
typedef boost::function< void(const
std::string &, std::vector
< TokenPtr > &)> 
TokenizerType
typedef boost::shared_ptr
< const std::string > 
TokenPtr

Typedef Documentation

Shared Pointer of BlockingFilter, returned by SerialListener::createBlockingFilter.

See also:
serial::BlockingFilter, SerialListener::createBlockingFilter

Definition at line 186 of file serial_listener.h.

Shared Pointer of BufferedFilter, returned by SerialListener::createBufferedFilter.

See also:
serial::BufferedFilter, SerialListener::createBufferedFilter

Definition at line 196 of file serial_listener.h.

typedef boost::function<bool(const std::string&)> serial::utils::ComparatorType

This is a general function type that is used as the comparator callback prototpe for the listenFor* type functions.

The function takes a std::string reference and returns true if the string matches what the comparator is looking for and false if it does not, unless otherwise specified.

See also:
SerialListener::listenFor, SerialListener::listenForOnce

Definition at line 104 of file serial_listener.h.

typedef boost::function<void(const std::string&)> serial::utils::DataCallback

This is a general function type that is used as the callback prototype for asynchronous functions like the default handler callback and the listenFor callbacks.

The function takes a std::string reference and returns nothing, it is simply passing the resulting line detected by the comparator to the user's callback for processing.

See also:
SerialListener::listenFor, SerialListener::setDefaultHandler

Definition at line 92 of file serial_listener.h.

typedef boost::function<void(const std::exception&)> serial::utils::ExceptionCallback

This function type describes the prototype for the exception callback.

The function takes a std::exception reference and returns nothing. It is called from the library when an exception occurs in a library thread. This exposes these exceptions to the user so they can to error handling.

See also:
SerialListener::setExceptionHandler

Definition at line 138 of file serial_listener.h.

typedef boost::shared_ptr<Filter> serial::utils::FilterPtr

This is an alias to boost::shared_ptr<Filter> used for tokens.

This is used internally and is returned from SerialListener::listenFor like functions so that users can later remove those filters by passing the FilterPtr.

See also:
serial::Filter, serial::SerialListener::listenFor, serial::SerialListener::listenForOnce

Definition at line 184 of file serial_listener.h.

typedef boost::function<void(const std::string&, std::vector<TokenPtr>&)> serial::utils::TokenizerType

This function type describes the prototype for the tokenizer callback.

The function should take a std::string reference and tokenize it into a several TokenPtr's and store them in the given std::vector<TokenPtr> reference. There are some default ones or the user can create their own.

The last element in the std::vector of TokenPtr's should always be either an empty string ("") or the last partial message. The last element in the std::vector will be put back into the data buffer so that if it is incomplete it can be completed when more data is read.

Example: A delimeter tokenizer with a delimeter of "\r". The result would be: "msg1\rmsg2\r" -> ["msg1", "msg2", ""] for two complete messages, or: "msg1\rpartial_msg2" -> ["msg1","partial_msg2"] for one complete message and one partial message.

See also:
SerialListener::setTokenizer, serial::delimeter_tokenizer, serial::TokenPtr

Definition at line 127 of file serial_listener.h.

typedef boost::shared_ptr<const std::string> serial::utils::TokenPtr

This is an alias to boost::shared_ptr<const std::string> used for tokens.

This is the type used internally and is the type returned in a vector by the tokenizer. The shared_ptr allows for the token to be stored and kept around long enough to be used by the comparators and callbacks, but no longer. This internal storage is passed as a const std::string reference to callbacks, like the DataCallback function type, to prevent implicit copying.

See also:
serial::TokenizerType, serial::SerialListener::setTokenizer

Definition at line 79 of file serial_listener.h.



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