fesa-core  5.0.1
fesa::RTEventPayload Class Reference

It is meant to carry the payload of an Event. More...

#include <RTEventPayload.h>

Inheritance diagram for fesa::RTEventPayload:
fesa::OnSubscriptionRTEventPayload

Public Member Functions

 RTEventPayload ()
 
 RTEventPayload (const char *payload, std::size_t size)
 
 RTEventPayload (const std::string &payload)
 
 RTEventPayload (const RTEventPayload &payload)
 Copy Constructor. More...
 
virtual ~RTEventPayload ()
 Destructor.
 
template<typename T >
const T * getValue () const
 returns the payload of the event More...
 
const char * getValue (std::size_t &size) const
 returns the value of the payload More...
 

Protected Member Functions

void setValue (const char *payload, std::size_t size)
 Sets or resets the payload. More...
 

Detailed Description

It is meant to carry the payload of an Event.

Constructor & Destructor Documentation

fesa::RTEventPayload::RTEventPayload ( )

Constructor

fesa::RTEventPayload::RTEventPayload ( const char *  payload,
std::size_t  size 
)

Constructor. Performs a copy of the payload (size bytes).

Parameters
payloadpointer to the payload
sizesize of the payload
fesa::RTEventPayload::RTEventPayload ( const std::string &  payload)

Constructor. The string's C representation is copied (including the terminating NULL byte).

Parameters
payloadstring containing the payload.
fesa::RTEventPayload::RTEventPayload ( const RTEventPayload payload)

Copy Constructor.

Copy constructor needed due to the heap allocation of the payload.

Member Function Documentation

template<typename T >
const T * fesa::RTEventPayload::getValue ( ) const

returns the payload of the event

Returns
the payload
const char * fesa::RTEventPayload::getValue ( std::size_t &  size) const

returns the value of the payload

Parameters
sizea reference where the actual size of the value will be set
Returns
a char*
void fesa::RTEventPayload::setValue ( const char *  payload,
std::size_t  size 
)
protected

Sets or resets the payload.

Parameters
payloadthe new payload
sizethe new size of the payload

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