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

A utility class to simplify data handling by automatically passing the data of the desired type to a function. More...

#include <Handler.h>

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

Public Types

typedef boost::shared_ptr< T > DataPtr
 
typedef boost::function< void(DataPtr)> DataFunction
 

Public Member Functions

std::string getClassName () const
 
void printContents (std::ostream &stream) const
 
 DataFunctionHandler (const DataFunction &function)
 
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
 

Protected Attributes

DataFunction function
 

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<typename T>
class rsb::DataFunctionHandler< T >

A utility class to simplify data handling by automatically passing the data of the desired type to a function.

This class is primarily intended for use with Boost.Bind.

Template Parameters
Tdesired data type to retrieve from the listeners
Author
swrede

Definition at line 124 of file Handler.h.

Member Typedef Documentation

template<typename T >
typedef boost::function<void(DataPtr)> rsb::DataFunctionHandler< T >::DataFunction

Definition at line 127 of file Handler.h.

template<typename T >
typedef boost::shared_ptr<T> rsb::DataFunctionHandler< T >::DataPtr

Definition at line 126 of file Handler.h.

Constructor & Destructor Documentation

template<typename T >
rsb::DataFunctionHandler< T >::DataFunctionHandler ( const DataFunction function)
inline

Definition at line 138 of file Handler.h.

Member Function Documentation

template<typename T >
std::string rsb::DataFunctionHandler< T >::getClassName ( ) const
inline

Definition at line 129 of file Handler.h.

template<typename T >
void rsb::DataFunctionHandler< T >::handle ( EventPtr  event)
inlinevirtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::eventprocessing::Handler.

Definition at line 142 of file Handler.h.

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

Definition at line 133 of file Handler.h.

Member Data Documentation

template<typename T >
DataFunction rsb::DataFunctionHandler< T >::function
protected

Definition at line 146 of file Handler.h.


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