RSB  0.19.0
rsb::util::QueuePushHandler< T, DisableEventWarning > 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::util::QueuePushHandler< T, DisableEventWarning >:
Inheritance graph
Collaboration diagram for rsb::util::QueuePushHandler< T, DisableEventWarning >:
Collaboration graph

Public Member Functions

 STATIC_ASSERT_WARN_TEMPLATE (QUEUE_PUSH_HANDLER_EVENT_WARNING,(boost::is_same< DisableEventWarning, Event >::value||!boost::is_same< T, Event >::value),"You probably do not want to use QueuePushHandler with type Event. \ If you want to receive complete Event instances inside a queue, you need to use EventQueuePushHandler. \ If you really want to use this class and want to get rid of this warning, define the second template parameter of this class to Event, too.")
 
 QueuePushHandler (boost::shared_ptr< rsc::threading::SynchronizedQueue< boost::shared_ptr< T > > > queue, const std::string &method="")
 Constructs a new instance. More...
 
std::string getClassName () const
 
void printContents (std::ostream &stream) const
 
void handle (EventPtr event)
 Handle event. More...
 
- Public Member Functions inherited from rsb::Handler
std::set< std::string > getMethods () const
 Returns the desired set of methods this handler can handle. More...
 
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. More...
 
 Handler (const std::set< std::string > &methods)
 Creates a new handler that only accepts events with the specified methods. More...
 
virtual ~Handler ()
 
std::string getClassName () const
 

Detailed Description

template<class T, class DisableEventWarning = void>
class rsb::util::QueuePushHandler< T, DisableEventWarning >

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 50 of file QueuePushHandler.h.

Constructor & Destructor Documentation

template<class T , class DisableEventWarning = void>
rsb::util::QueuePushHandler< T, DisableEventWarning >::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 69 of file QueuePushHandler.h.

Member Function Documentation

template<class T , class DisableEventWarning = void>
std::string rsb::util::QueuePushHandler< T, DisableEventWarning >::getClassName ( ) const
inline

Definition at line 76 of file QueuePushHandler.h.

template<class T , class DisableEventWarning = void>
void rsb::util::QueuePushHandler< T, DisableEventWarning >::handle ( EventPtr  event)
inlinevirtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::eventprocessing::Handler.

Definition at line 84 of file QueuePushHandler.h.

References rsb::util::QueuePushHandler< T, DisableEventWarning >::queue.

template<class T , class DisableEventWarning = void>
void rsb::util::QueuePushHandler< T, DisableEventWarning >::printContents ( std::ostream &  stream) const
inline
template<class T , class DisableEventWarning = void>
rsb::util::QueuePushHandler< T, DisableEventWarning >::STATIC_ASSERT_WARN_TEMPLATE ( QUEUE_PUSH_HANDLER_EVENT_WARNING  ,
(boost::is_same< DisableEventWarning, Event >::value||!boost::is_same< T, Event >::value)  ,
"You probably do not want to use QueuePushHandler< T, DisableEventWarning > with type Event. \If you want to receive complete Event instances inside a  queue,
you need to use EventQueuePushHandler< T, DisableEventWarning >.\If you really want to use this class and want to get rid of this  warning,
define the second template parameter of this class to  Event,
too."   
)

Member Data Documentation

template<class T , class DisableEventWarning = void>
boost::shared_ptr<rsc::threading::SynchronizedQueue<boost::shared_ptr<T> > > rsb::util::QueuePushHandler< T, DisableEventWarning >::queue
private

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