RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::QueuePushHandler< T > Class Template Reference

A rsb::Handler for rsb::Listener s that pushes all received data on a rsc::SynchronizedQueue. More...

#include <QueuePushHandler.h>

Inheritance diagram for rsb::QueuePushHandler< T >:
Inheritance graph
Collaboration diagram for rsb::QueuePushHandler< T >:
Collaboration graph

Public Member Functions

 QueuePushHandler (boost::shared_ptr< rsc::threading::SynchronizedQueue< boost::shared_ptr< T > > > queue, const std::string &method="")
 Constructs a new instance.
std::string getClassName () const
void printContents (std::ostream &stream) const
void handle (EventPtr event)
 Handle event.
- Public Member Functions inherited from rsb::Handler
std::set< std::string > getMethods () const
 Returns the desired set of methods this handler can handle.
bool acceptsMethod (const std::string &method) const

Private Attributes

boost::shared_ptr
< rsc::threading::SynchronizedQueue
< boost::shared_ptr< T > > > 
queue

Additional Inherited Members

- Protected Member Functions inherited from rsb::Handler
 Handler (const std::string &method="")
 Creates a new handler that only accepts events for the specified method.
 Handler (const std::set< std::string > &methods)
 Creates a new handler that only accepts events with the specified methods.
virtual ~Handler ()

Detailed Description

template<class T>
class rsb::QueuePushHandler< T >

A rsb::Handler for rsb::Listener s that pushes all received data on a rsc::SynchronizedQueue.

This queue must handle shared pointers of the data type.

Author
jwienke
Template Parameters
Tdata type received by the handler. All data is handeled as a shared pointer of this type

Definition at line 47 of file QueuePushHandler.h.

Constructor & Destructor Documentation

template<class T >
rsb::QueuePushHandler< T >::QueuePushHandler ( boost::shared_ptr< rsc::threading::SynchronizedQueue< boost::shared_ptr< T > > >  queue,
const std::string &  method = "" 
)
inline

Constructs a new instance.

Parameters
queuethe queue to push received data on
methodmethod of this handler to react on, empty means all events

Definition at line 59 of file QueuePushHandler.h.

Member Function Documentation

template<class T >
std::string rsb::QueuePushHandler< T >::getClassName ( ) const
inline

Reimplemented from rsb::Handler.

Definition at line 66 of file QueuePushHandler.h.

template<class T >
void rsb::QueuePushHandler< T >::handle ( EventPtr  event)
inlinevirtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::eventprocessing::Handler.

Definition at line 74 of file QueuePushHandler.h.

References rsb::QueuePushHandler< T >::queue.

template<class T >
void rsb::QueuePushHandler< T >::printContents ( std::ostream &  stream) const
inline

Definition at line 70 of file QueuePushHandler.h.

References rsb::QueuePushHandler< T >::queue.

Member Data Documentation

template<class T >
boost::shared_ptr<rsc::threading::SynchronizedQueue<boost::shared_ptr<T> > > rsb::QueuePushHandler< T >::queue
private

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