Public Types | Public Member Functions | Protected Attributes
msp::client::Subscription< T > Class Template Reference

#include <Subscription.hpp>

Inheritance diagram for msp::client::Subscription< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::function< void(const
msp::Message &)> 
CallbackM
typedef std::function< void(const
T &)> 
CallbackT

Public Member Functions

virtual void decode (msp::ByteVector &data) const override
 Virtual method for decoding received data.
const T & getIoObject () const
 Gets a reference to the IO object.
virtual const msp::MessagegetMsgObject () const override
 Gets a reference to the internal IO object as a Message.
virtual void handleResponse () const override
 Calls the receive callback if it exists.
virtual void makeRequest () const override
 Calls the send callback if it exists.
void setIoObject (std::unique_ptr< T > &&obj) const
 Sets the object used for packing and unpacking data.
void setReceiveCallback (const CallbackT &recv_callback) const
 Sets the callback to be executed on success.
void setSendCallback (const CallbackM &send_callback) const
 Sets the callback used to send the request.
 Subscription ()
 Subscription constructor.
 Subscription (const CallbackT &recv_callback, const CallbackM &send_callback, std::unique_ptr< T > &&io_object, const double &period=0.0)
 Subscription constructor setting all parameters.

Protected Attributes

std::unique_ptr< T > io_object_
CallbackT recv_callback_
CallbackM send_callback_

Detailed Description

template<typename T>
class msp::client::Subscription< T >

Definition at line 88 of file Subscription.hpp.


Member Typedef Documentation

template<typename T >
typedef std::function<void(const msp::Message&)> msp::client::Subscription< T >::CallbackM

Definition at line 91 of file Subscription.hpp.

template<typename T >
typedef std::function<void(const T&)> msp::client::Subscription< T >::CallbackT

Definition at line 90 of file Subscription.hpp.


Constructor & Destructor Documentation

template<typename T >
msp::client::Subscription< T >::Subscription ( ) [inline]

Subscription constructor.

Definition at line 96 of file Subscription.hpp.

template<typename T >
msp::client::Subscription< T >::Subscription ( const CallbackT recv_callback,
const CallbackM send_callback,
std::unique_ptr< T > &&  io_object,
const double &  period = 0.0 
) [inline]

Subscription constructor setting all parameters.

Parameters:
recv_callbackCallback to execute upon receipt of message
send_callbackCallback to execute periodically to send message
io_objectObject which is used for encoding/decoding data
periodRepition rate of the request

Definition at line 105 of file Subscription.hpp.


Member Function Documentation

template<typename T >
virtual void msp::client::Subscription< T >::decode ( msp::ByteVector data) const [inline, override, virtual]

Virtual method for decoding received data.

Parameters:
dataData to be unpacked

Implements msp::client::SubscriptionBase.

Definition at line 121 of file Subscription.hpp.

template<typename T >
const T& msp::client::Subscription< T >::getIoObject ( ) const [inline]

Gets a reference to the IO object.

Returns:

Definition at line 138 of file Subscription.hpp.

template<typename T >
virtual const msp::Message& msp::client::Subscription< T >::getMsgObject ( ) const [inline, override, virtual]

Gets a reference to the internal IO object as a Message.

Returns:
reference to a Message

Implements msp::client::SubscriptionBase.

Definition at line 144 of file Subscription.hpp.

template<typename T >
virtual void msp::client::Subscription< T >::handleResponse ( ) const [inline, override, virtual]

Calls the receive callback if it exists.

Implements msp::client::SubscriptionBase.

Definition at line 159 of file Subscription.hpp.

template<typename T >
virtual void msp::client::Subscription< T >::makeRequest ( ) const [inline, override, virtual]

Calls the send callback if it exists.

Implements msp::client::SubscriptionBase.

Definition at line 174 of file Subscription.hpp.

template<typename T >
void msp::client::Subscription< T >::setIoObject ( std::unique_ptr< T > &&  obj) const [inline]

Sets the object used for packing and unpacking data.

Parameters:
objunique_ptr to a Message-derived object

Definition at line 130 of file Subscription.hpp.

template<typename T >
void msp::client::Subscription< T >::setReceiveCallback ( const CallbackT recv_callback) const [inline]

Sets the callback to be executed on success.

Parameters:
recv_callbackthe callback to be executed

Definition at line 152 of file Subscription.hpp.

template<typename T >
void msp::client::Subscription< T >::setSendCallback ( const CallbackM send_callback) const [inline]

Sets the callback used to send the request.

Parameters:
send_callbackthe callback to be executed

Definition at line 167 of file Subscription.hpp.


Member Data Documentation

template<typename T >
std::unique_ptr<T> msp::client::Subscription< T >::io_object_ [protected]

Definition at line 181 of file Subscription.hpp.

template<typename T >
CallbackT msp::client::Subscription< T >::recv_callback_ [protected]

Definition at line 179 of file Subscription.hpp.

template<typename T >
CallbackM msp::client::Subscription< T >::send_callback_ [protected]

Definition at line 180 of file Subscription.hpp.


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


msp
Author(s): Christian Rauch
autogenerated on Thu Jun 20 2019 19:40:38