AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.4.3
AMPS::Handler< Func, Object > Class Template Reference

Wrapper for callback functions in AMPS. More...

#include <MessageRouter.hpp>

Public Member Functions

 Handler ()
 Null constructor – no function is wrapped.
 
 Handler (Func func_, void *userData_)
 Constructor for use with a bare function pointer. More...
 
 Handler (const Handler &orig_)
 Copy constructor. More...
 
template<typename T >
 Handler (const T &callback_)
 Constructor for use with a standard c++ library function object. More...
 

Detailed Description

template<typename Func, typename Object>
class AMPS::Handler< Func, Object >

Wrapper for callback functions in AMPS.

Can be used to bind a function pointer with a void* to use as a callback, or if available, can wrap a std::function<Object> object, so you can supply the return value of std::bind, or even a lambda.

Constructor & Destructor Documentation

template<typename Func, typename Object>
AMPS::Handler< Func, Object >::Handler ( Func  func_,
void *  userData_ 
)
inline

Constructor for use with a bare function pointer.

Parameters
func_The function pointer to bind. func must be declared:j void myFunction(Object o, void* userData); for example, void myHandler(const Message&m, void *userData);
userData_a value you'd like passed in when you're called.
template<typename Func, typename Object>
AMPS::Handler< Func, Object >::Handler ( const Handler< Func, Object > &  orig_)
inline

Copy constructor.

Parameters
orig_The handler to copy
template<typename Func, typename Object>
template<typename T >
AMPS::Handler< Func, Object >::Handler ( const T &  callback_)
inline

Constructor for use with a standard c++ library function object.

Parameters
callback_An object that can be assigned to a std::function

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