Jamba C++ API  4.3.0
Message Class Reference

Simple wrapper class with better api. More...

#include <Messaging.h>

Public Member Functions

template<typename T >
int32 getBinary (IAttributeList::AttrID id, T *iData, uint32 iSize) const
 Gets a binary message. More...
 
double getFloat (IAttributeList::AttrID id, double defaultValue) const
 
int64 getInt (IAttributeList::AttrID id, int64 defaultValue) const
 
MessageID getMessageID () const
 
template<typename T >
tresult getSerializableValue (IAttributeList::AttrID id, IParamSerializer< T > const &iSerializer, T &oValue) const
 Deserializes the parameter value from an entry in the message. More...
 
 Message (IMessage *message)
 
template<typename T >
tresult setBinary (IAttributeList::AttrID id, const T *iData, uint32 iSize)
 Sets a binary message. More...
 
void setFloat (IAttributeList::AttrID id, double value)
 
void setInt (IAttributeList::AttrID id, int64 value)
 
void setMessageID (MessageID messageID)
 
template<typename T >
tresult setSerializableValue (IAttributeList::AttrID id, IParamSerializer< T > const &iSerializer, T const &iValue)
 Serializes the parameter value as an entry in the message. More...
 

Private Attributes

IMessage * fMessage
 

Detailed Description

Simple wrapper class with better api.

Constructor & Destructor Documentation

◆ Message()

Message ( IMessage *  message)
inlineexplicit

Member Function Documentation

◆ getBinary()

int32 getBinary ( IAttributeList::AttrID  id,
T *  iData,
uint32  iSize 
) const
inline

Gets a binary message.

Parameters
idattribute id
iDatathe array into which the binary data will be copied
iSizethe number of elements in iData array (NOT the size in bytes!)
Returns
-1 if cannot ready binary otherwise number of elements read (always <= iSize)

◆ getFloat()

double getFloat ( IAttributeList::AttrID  id,
double  defaultValue 
) const
inline

◆ getInt()

int64 getInt ( IAttributeList::AttrID  id,
int64  defaultValue 
) const
inline

◆ getMessageID()

MessageID getMessageID ( ) const
inline

◆ getSerializableValue()

tresult getSerializableValue ( IAttributeList::AttrID  id,
IParamSerializer< T > const &  iSerializer,
T &  oValue 
) const

Deserializes the parameter value from an entry in the message.

Returns
kResultOk if successful
Todo:
this line unnecessarily copies the data but there is no other API

◆ setBinary()

tresult setBinary ( IAttributeList::AttrID  id,
const T *  iData,
uint32  iSize 
)
inline

Sets a binary message.

Parameters
idattribute id
iDatathe array from which the binary data will be copied
iSizethe number of elements in iData array (NOT the size in bytes!)

◆ setFloat()

void setFloat ( IAttributeList::AttrID  id,
double  value 
)
inline

◆ setInt()

void setInt ( IAttributeList::AttrID  id,
int64  value 
)
inline

◆ setMessageID()

void setMessageID ( MessageID  messageID)
inline

◆ setSerializableValue()

tresult setSerializableValue ( IAttributeList::AttrID  id,
IParamSerializer< T > const &  iSerializer,
T const &  iValue 
)

Serializes the parameter value as an entry in the message.

Returns
kResultOk if successful

Member Data Documentation

◆ fMessage

IMessage* fMessage
private

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