CMSDK  2.0.1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
cmlabs::DataMessage Class Reference

Public Types

enum  KeyType { NONE, SINGLE, ARRAY, MAP }
 

Public Member Functions

 DataMessage ()
 
 DataMessage (PsyType type, uint32 from)
 
 DataMessage (PsyType type, uint32 from, uint32 to, uint64 ttl=0, uint16 priority=0)
 
 DataMessage (PsyType type, uint32 from, uint32 to, uint32 tag, uint64 time, uint64 ttl=0, uint16 priority=0)
 
 DataMessage (char *data, bool copy=false)
 
 DataMessage (const char *data)
 
 DataMessage (const DataMessage &msg)
 
 DataMessage (const char *data, uint32 maxDraftSize)
 
 DataMessage (const DataMessage &msg, uint32 maxDraftSize)
 
 ~DataMessage ()
 
DataMessagecopy ()
 
const char * swapMessageData (const char *data)
 
bool fillInDraftUserDataFrom (const char *data, uint32 maxDraftSize)
 
bool isValid ()
 
uint32 getContentType (const char *key)
 
uint32 getContentSize (const char *key)
 
bool getAsBool (const char *key)
 
std::string getAsString (const char *key)
 
int64 getAsInt (const char *key)
 
uint64 getAsTime (const char *key)
 
float64 getAsFloat (const char *key)
 
uint64 getTime (const char *key)
 
const char * getString (const char *key)
 
const char * getString (const char *key, uint32 &size)
 
bool getInt (const char *key, int64 &value)
 
bool getDouble (const char *key, double &value)
 
bool getFloat (const char *key, float64 &value)
 
const char * getData (const char *key, uint32 &size)
 
char * getDataCopy (const char *key, uint32 &size)
 
DataMessagegetAttachedMessageCopy (const char *key)
 
uint64 getTime (const char *key, bool &success)
 
const char * getString (const char *key, bool &success)
 
const char * getString (const char *key, uint32 &size, bool &success)
 
int64 getInt (const char *key, bool &success)
 
double getDouble (const char *key, bool &success)
 
float64 getFloat (const char *key, bool &success)
 
const char * getData (const char *key, uint32 &size, bool &success)
 
char * getDataCopy (const char *key, uint32 &size, bool &success)
 
DataMessagegetAttachedMessageCopy (const char *key, bool &success)
 
int64 getInt (const char *key)
 
double getDouble (const char *key)
 
float64 getFloat (const char *key)
 
bool setTime (const char *key, uint64 value)
 
bool setString (const char *key, const char *value)
 
bool setInt (const char *key, int64 value)
 
bool setDouble (const char *key, double value)
 
bool setFloat (const char *key, float64 value)
 
bool setData (const char *key, const char *value, uint32 size)
 
bool setAttachedMessage (const char *key, DataMessage *msg)
 
uint32 getUserSize ()
 
uint32 getUserCount ()
 
KeyType getKeyType (const char *key)
 
bool isArrayContent (const char *key)
 
bool isMapContent (const char *key)
 
bool isSingleValue (const char *key)
 
bool hasKey (const char *key)
 
bool hasString (const char *key)
 
bool hasInteger (const char *key)
 
bool hasFloat (const char *key)
 
bool hasTime (const char *key)
 
bool hasData (const char *key)
 
bool hasMessage (const char *key)
 
uint32 getContentType (int64 i, const char *key)
 
uint32 getContentSize (int64 i, const char *key)
 
uint64 getTime (int64 i, const char *key)
 
std::string getAsString (int64 i, const char *key)
 
int64 getAsInt (int64 i, const char *key)
 
uint64 getAsTime (int64 i, const char *key)
 
float64 getAsFloat (int64 i, const char *key)
 
const char * getString (int64 i, const char *key)
 
const char * getString (int64 i, const char *key, uint32 &size)
 
bool getInt (int64 i, const char *key, int64 &value)
 
bool getDouble (int64 i, const char *key, double &value)
 
bool getFloat (int64 i, const char *key, float64 &value)
 
int64 getInt (int64 i, const char *key, bool &success)
 
double getDouble (int64 i, const char *key, bool &success)
 
float64 getFloat (int64 i, const char *key, bool &success)
 
int64 getInt (int64 i, const char *key)
 
double getDouble (int64 i, const char *key)
 
float64 getFloat (int64 i, const char *key)
 
const char * getData (int64 i, const char *key, uint32 &size)
 
char * getDataCopy (int64 i, const char *key, uint32 &size)
 
DataMessagegetAttachedMessageCopy (int64 i, const char *key)
 
bool setTime (int64 i, const char *key, uint64 value)
 
bool setString (int64 i, const char *key, const char *value)
 
bool setInt (int64 i, const char *key, int64 value)
 
bool setDouble (int64 i, const char *key, double value)
 
bool setFloat (int64 i, const char *key, float64 value)
 
bool setData (int64 i, const char *key, const char *value, uint32 size)
 
bool setAttachedMessage (int64 i, const char *key, DataMessage *msg)
 
std::map< int64, uint64 > getTimeArray (const char *key)
 
std::map< int64, std::string > getAsStringArray (const char *key)
 
std::map< int64, int64 > getAsIntArray (const char *key)
 
std::map< int64, float64 > getAsFloatArray (const char *key)
 
std::map< int64, std::string > getStringArray (const char *key)
 
std::map< int64, int64 > getIntArray (const char *key)
 
std::map< int64, double > getDoubleArray (const char *key)
 
std::map< int64, float64 > getFloatArray (const char *key)
 
std::map< int64, DataMessage * > getAttachedMessageArray (const char *key)
 
uint32 getArraySize (const char *key)
 
uint32 getArrayCount (const char *key)
 
uint32 getMapSize (const char *key)
 
uint32 getMapCount (const char *key)
 
bool setTimeArray (const char *key, std::map< int64, uint64 > &map)
 
bool setStringArray (const char *key, std::map< int64, std::string > &map)
 
bool setIntArray (const char *key, std::map< int64, int64 > &map)
 
bool setDoubleArray (const char *key, std::map< int64, double > &map)
 
bool setFloatArray (const char *key, std::map< int64, float64 > &map)
 
bool setAttachedMessageArray (const char *key, std::map< int64, DataMessage *> &map)
 
uint32 getContentType (const char *idx, const char *key)
 
uint32 getContentSize (const char *idx, const char *key)
 
uint64 getTime (const char *idx, const char *key)
 
std::string getAsString (const char *idx, const char *key)
 
int64 getAsInt (const char *idx, const char *key)
 
uint64 getAsTime (const char *idx, const char *key)
 
float64 getAsFloat (const char *idx, const char *key)
 
const char * getString (const char *idx, const char *key)
 
const char * getString (const char *idx, const char *key, uint32 &size)
 
bool getInt (const char *idx, const char *key, int64 &value)
 
bool getDouble (const char *idx, const char *key, double &value)
 
bool getFloat (const char *idx, const char *key, float64 &value)
 
int64 getInt (const char *idx, const char *key, bool &success)
 
double getDouble (const char *idx, const char *key, bool &success)
 
float64 getFloat (const char *idx, const char *key, bool &success)
 
int64 getInt (const char *idx, const char *key)
 
double getDouble (const char *idx, const char *key)
 
float64 getFloat (const char *idx, const char *key)
 
const char * getData (const char *idx, const char *key, uint32 &size)
 
char * getDataCopy (const char *idx, const char *key, uint32 &size)
 
DataMessagegetAttachedMessageCopy (const char *idx, const char *key)
 
bool setTime (const char *idx, const char *key, uint64 value)
 
bool setString (const char *idx, const char *key, const char *value)
 
bool setInt (const char *idx, const char *key, int64 value)
 
bool setDouble (const char *idx, const char *key, double value)
 
bool setFloat (const char *idx, const char *key, float64 value)
 
bool setData (const char *idx, const char *key, const char *value, uint32 size)
 
bool setAttachedMessage (const char *idx, const char *key, DataMessage *msg)
 
std::map< std::string, uint64 > getTimeMap (const char *key)
 
std::map< std::string, std::string > getAsStringMap (const char *key)
 
std::map< std::string, int64 > getAsIntMap (const char *key)
 
std::map< std::string, float64 > getAsFloatMap (const char *key)
 
std::map< std::string, std::string > getStringMap (const char *key)
 
std::map< std::string, int64 > getIntMap (const char *key)
 
std::map< std::string, double > getDoubleMap (const char *key)
 
std::map< std::string, float64 > getFloatMap (const char *key)
 
std::map< std::string, DataMessage * > getAttachedMessageMap (const char *key)
 
bool setTimeMap (const char *key, std::map< std::string, uint64 > &map)
 
bool setStringMap (const char *key, std::map< std::string, std::string > &map)
 
bool setIntMap (const char *key, std::map< std::string, int64 > &map)
 
bool setDoubleMap (const char *key, std::map< std::string, double > &map)
 
bool setFloatMap (const char *key, std::map< std::string, float64 > &map)
 
bool setAttachedMessageMap (const char *key, std::map< std::string, DataMessage *> &map)
 
std::string toJSON (std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL)
 
std::string toXML (std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL)
 
std::string toCSV (const char *separator=NULL, const char *preample=NULL, std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL)
 
uint32 copyUserEntriesFromMessage (DataMessage *msg)
 
std::string getUserEntriesAsString ()
 
std::string getUserEntriesAsJSON (bool asText)
 
char * getRawData ()
 
uint16 getOrigin ()
 
uint16 getDestination ()
 
bool setOrigin (uint16 addr)
 
bool setDestination (uint16 addr)
 
uint32 getSize ()
 
bool setMultiple (uint32 from, uint32 to, uint32 tag, uint64 ttl, uint8 policy, uint64 sendtime)
 
uint32 getTag ()
 
bool setTag (uint32 tag)
 
uint64 getReference ()
 
bool setReference (uint64 ref)
 
uint32 getSystemID ()
 
bool setSystemID (uint32 id)
 
uint64 getMemID ()
 
bool setMemID (uint64 id)
 
uint32 getFrom ()
 
bool setFrom (uint32 from)
 
uint32 getTo ()
 
bool setTo (uint32 to)
 
PsyType getType ()
 
bool setType (PsyType &type)
 
PsyContext getContextChange ()
 
bool setContextChange (PsyContext &context)
 
uint64 getTTL ()
 
uint64 getEOL ()
 
bool setTTL (uint64 ttl)
 
bool setEOL (uint64 eol)
 
uint16 getPriority ()
 
bool setPriority (uint16 priority)
 
uint8 getPolicy ()
 
bool setPolicy (uint8 policy)
 
uint64 getSendTime ()
 
bool setSendTime (uint64 time)
 
uint64 getRecvTime ()
 
bool setRecvTime (uint64 time)
 
uint64 getCreatedTime ()
 
bool setCreatedTime (uint64 t)
 
uint16 getStatus ()
 
bool setStatus (uint16 status)
 
uint64 getSerial ()
 
bool setSerial (uint64 serial)
 
bool addTimeUsage (uint32 cycleCPUTime, uint32 cycleWallTime, uint32 chainCPUTime=0, uint32 chainWallTime=0, uint32 chainCount=0)
 
uint16 getCycleCPUTime ()
 
bool setCycleCPUTime (uint32 t)
 
uint16 getCycleWallTime ()
 
bool setCycleWallTime (uint32 t)
 
uint16 getChainCPUTime ()
 
bool setChainCPUTime (uint32 t)
 
uint16 getChainWallTime ()
 
bool setChainWallTime (uint32 t)
 
uint32 getChainCount ()
 
bool setChainCount (uint32 count)
 
bool deleteEntry (const char *key)
 

Static Public Member Functions

static DataMessageFindClosestMessage (uint64 t, std::map< uint64, DataMessage *> &messages)
 
static bool ConvertDataFromOlderMessageFormat (const char *data, char **newData)
 
static std::string GetCSVHeader (const char *separator=NULL, const char *preample=NULL)
 

Public Attributes

DataMessageHeaderdata
 

Protected Member Functions

bool setRawData (const char *key, const char *value, uint32 size, uint32 datatype)
 
char * findKey (const char *key)
 
char * findEntry (const char *key)
 
bool removeEntry (const char *key)
 
char * findSpace (uint32 space)
 

Constructor & Destructor Documentation

◆ DataMessage() [1/9]

cmlabs::DataMessage::DataMessage ( )

DataMessage() Creates an empty DataMessage

◆ DataMessage() [2/9]

cmlabs::DataMessage::DataMessage ( PsyType  type,
uint32  from 
)

DataMessage(PsyType type, uint32 from) Creates a DataMessage with type and from fields set

Parameters
typeset the message type
fromset the message sender id

◆ DataMessage() [3/9]

cmlabs::DataMessage::DataMessage ( PsyType  type,
uint32  from,
uint32  to,
uint64  ttl = 0,
uint16  priority = 0 
)

DataMessage(PsyType type, uint32 from, uint32 to, uint64 ttl = 0, uint16 priority = 0) Creates a DataMessage with multiple fields set

Parameters
typeset the message type
fromset the message sender id
toset the message receiver id
ttlset the time-to-live for the message in microseconds, after which it will have reached its end-of-life (eol)
priorityset the message priority

◆ DataMessage() [4/9]

cmlabs::DataMessage::DataMessage ( PsyType  type,
uint32  from,
uint32  to,
uint32  tag,
uint64  time,
uint64  ttl = 0,
uint16  priority = 0 
)

DataMessage(PsyType type, uint32 from, uint32 to, uint32 tag, uint64 time, uint64 ttl = 0, uint16 priority = 0) Creates a DataMessage with multiple fields set

Parameters
typeset the message type
fromset the message sender id
toset the message receiver id
tagset the message tag id
ttlset the time-to-live for the message in microseconds, after which it will have reached its end-of-life (eol)
priorityset the message priority

◆ DataMessage() [5/9]

cmlabs::DataMessage::DataMessage ( char *  data,
bool  copy = false 
)

DataMessage(char* data, bool copy = false) Creates a DataMessage as a copy of the binary message data provided

Parameters
datathe binary message data to copy from
copyshould the data be copied or can it be taken

◆ DataMessage() [6/9]

cmlabs::DataMessage::DataMessage ( const char *  data)

DataMessage(const char* data)

Parameters
datathe binary message data to copy from Creates a DataMessage as a copy of the binary message data provided, will always copy the data

◆ DataMessage() [7/9]

cmlabs::DataMessage::DataMessage ( const DataMessage msg)

DataMessage(const DataMessage& msg)

Parameters
msgthe message to copy from Creates a DataMessage as a copy of another DataMessage

◆ DataMessage() [8/9]

cmlabs::DataMessage::DataMessage ( const char *  data,
uint32  maxDraftSize 
)

DataMessage(const char* data, uint32 maxDraftSize) Creates a DataMessage as a copy of the binary message data provided, will always copy the data If the binary size is below maxDraftSize the full message is copied If not some larger user entries will be provided as information only, i.e. name and size, but not content

Parameters
datathe binary message data to copy from
maxDraftSizethe maximum binary size of the newly created message

◆ DataMessage() [9/9]

cmlabs::DataMessage::DataMessage ( const DataMessage msg,
uint32  maxDraftSize 
)

DataMessage(const DataMessage& msg, uint32 maxDraftSize) Creates a DataMessage as a copy of the message provided If the binary size is below maxDraftSize the full message is copied If not some larger user entries will be provided as information only, i.e. name and size, but not content

Parameters
msgthe message to copy from
maxDraftSizethe maximum binary size of the newly created message

◆ ~DataMessage()

cmlabs::DataMessage::~DataMessage ( )

~DataMessage() Message destructor

Member Function Documentation

◆ addTimeUsage()

bool cmlabs::DataMessage::addTimeUsage ( uint32  cycleCPUTime,
uint32  cycleWallTime,
uint32  chainCPUTime = 0,
uint32  chainWallTime = 0,
uint32  chainCount = 0 
)

addTimeUsage()

Update the CPU and Wall time usage since trigger message arrived and add up the chain usage

Parameters
cycleCPUTimecycle CPU time in us
cycleWallTimecycle wall time in us
chainCPUTimecycle CPU time in us
chainWallTimecycle wall time in us
Returns
false if the message is not valid
true otherwise

◆ copy()

DataMessage* cmlabs::DataMessage::copy ( )
inline

copy() Creates a copy of the message and returns it

Returns
new DataMessage or NULL if data is invalid

◆ copyUserEntriesFromMessage()

uint32 cmlabs::DataMessage::copyUserEntriesFromMessage ( DataMessage msg)

copyUserEntriesFromMessage(DataMessage* msg) Copies all user data from a message into this message, overwriting any existing entries with the same key

Parameters
msgthe Message to copy the user data from
Returns
the number of data entries copied

◆ deleteEntry()

bool cmlabs::DataMessage::deleteEntry ( const char *  key)
inline

deleteEntry(const char* key)

Marks the entry as unused

Parameters
keykeyword
Returns
true if successfull

◆ fillInDraftUserDataFrom()

bool cmlabs::DataMessage::fillInDraftUserDataFrom ( const char *  data,
uint32  maxDraftSize 
)

fillInDraftUserDataFrom(const char* data, uint32 maxDraftSize)

internal function

Parameters
data
maxDraftSize

◆ FindClosestMessage()

DataMessage * cmlabs::DataMessage::FindClosestMessage ( uint64  t,
std::map< uint64, DataMessage *> &  messages 
)
static

FindClosestMessage(uint64 t, std::map<uint64, DataMessage*> &messages) In a map of time -> DataMessage, find the message closes to the time t

Parameters
ttimestamp to find the closest match to
messagesmap of time -> DataMessage
Returns
Closest DataMessage to time t or NULL if messages is empty

◆ findEntry()

char* cmlabs::DataMessage::findEntry ( const char *  key)
inlineprotected

findEntry(const char* key)

Internal function

Parameters
keykeyword
Returns
NULL if src == NULL
src + sizeof(DataMessageEntryHeader) + strlen(key) + 1 else

◆ findKey()

char* cmlabs::DataMessage::findKey ( const char *  key)
inlineprotected

findKey(const char* key) Internal function

Parameters
key
Returns
NULL if the message is not valid
src if
NULL else

◆ findSpace()

char* cmlabs::DataMessage::findSpace ( uint32  space)
inlineprotected

findSpace(uint32 space)

Internal function

Parameters
space
Returns
NULL if the message is not valid
src
NULL

◆ getArrayCount()

uint32 cmlabs::DataMessage::getArrayCount ( const char *  key)

getArrayCount(const char* key) Returns the number of elements in array with name '<key>'

Parameters
key

◆ getArraySize()

uint32 cmlabs::DataMessage::getArraySize ( const char *  key)

getArraySize(const char* key) Returns the number of elements in array with name '<key>'

Parameters
key

◆ getAsBool()

bool cmlabs::DataMessage::getAsBool ( const char *  key)

getAsBool(const char* key)

returns the interpretation of the entry as a Boolean value i.e. if the value is integer/float != 0, string "yes", etc.

Parameters
key

◆ getAsFloat() [1/3]

float64 cmlabs::DataMessage::getAsFloat ( const char *  key)

getAsFloat(const char* key)

returns the user entry as a float regardless of what type it is

Parameters
key

◆ getAsFloat() [2/3]

float64 cmlabs::DataMessage::getAsFloat ( int64  i,
const char *  key 
)

◆ getAsFloat() [3/3]

float64 cmlabs::DataMessage::getAsFloat ( const char *  idx,
const char *  key 
)

returns the user entry as a float regardless of what type it is

Parameters
idxtextual index for the maps
key
Returns
user entry as a string

◆ getAsFloatArray()

std::map< int64, float64 > cmlabs::DataMessage::getAsFloatArray ( const char *  key)

◆ getAsFloatMap()

std::map< std::string, float64 > cmlabs::DataMessage::getAsFloatMap ( const char *  key)

returns the user entry as a float map regardless of what type it is

Parameters
key
Returns
user entry as a string

◆ getAsInt() [1/3]

int64 cmlabs::DataMessage::getAsInt ( const char *  key)

getAsInt(const char* key)

returns the user entry as an integer regardless of what type it is

Parameters
key

◆ getAsInt() [2/3]

int64 cmlabs::DataMessage::getAsInt ( int64  i,
const char *  key 
)

◆ getAsInt() [3/3]

int64 cmlabs::DataMessage::getAsInt ( const char *  idx,
const char *  key 
)

returns the user entry as an integer regardless of what type it is

Parameters
idxtextual index for the maps
key
Returns
user entry as a string

◆ getAsIntArray()

std::map< int64, int64 > cmlabs::DataMessage::getAsIntArray ( const char *  key)

◆ getAsIntMap()

std::map< std::string, int64 > cmlabs::DataMessage::getAsIntMap ( const char *  key)

returns the user entry as an integer map regardless of what type it is

Parameters
key
Returns
user entry as a string

◆ getAsString() [1/3]

std::string cmlabs::DataMessage::getAsString ( const char *  key)

getAsString(const char* key)

returns the user entry as a string regardless of what type it is

Parameters
key

◆ getAsString() [2/3]

std::string cmlabs::DataMessage::getAsString ( int64  i,
const char *  key 
)

◆ getAsString() [3/3]

std::string cmlabs::DataMessage::getAsString ( const char *  idx,
const char *  key 
)

returns the user entry as a string regardless of what type it is

Parameters
idxtextual index for the maps
key
Returns
user entry as a string

◆ getAsStringArray()

std::map< int64, std::string > cmlabs::DataMessage::getAsStringArray ( const char *  key)

◆ getAsStringMap()

std::map< std::string, std::string > cmlabs::DataMessage::getAsStringMap ( const char *  key)

returns the user entry as a string regardless of what type it is

Parameters
key
Returns
user entry as a string

◆ getAsTime() [1/3]

uint64 cmlabs::DataMessage::getAsTime ( const char *  key)

getAsTime(const char* key)

returns the user entry as a time regardless of what type it is

Parameters
key

◆ getAsTime() [2/3]

uint64 cmlabs::DataMessage::getAsTime ( int64  i,
const char *  key 
)

◆ getAsTime() [3/3]

uint64 cmlabs::DataMessage::getAsTime ( const char *  idx,
const char *  key 
)

returns the user entry as a time regardless of what type it is

Parameters
idxtextual index for the maps
key
Returns
user entry as a string

◆ getAttachedMessageArray()

std::map< int64, DataMessage * > cmlabs::DataMessage::getAttachedMessageArray ( const char *  key)

◆ getAttachedMessageCopy() [1/4]

DataMessage * cmlabs::DataMessage::getAttachedMessageCopy ( const char *  key)

getAttachedMessageCopy(const char* key)

returns a copy of the user message entry with this key

Parameters
key

◆ getAttachedMessageCopy() [2/4]

DataMessage * cmlabs::DataMessage::getAttachedMessageCopy ( const char *  key,
bool &  success 
)

getAttachedMessageCopy(const char* key)

returns a copy of the user message entry with this key / returning the value and success/fail as a parameter

Parameters
key
success

◆ getAttachedMessageCopy() [3/4]

DataMessage * cmlabs::DataMessage::getAttachedMessageCopy ( int64  i,
const char *  key 
)

◆ getAttachedMessageCopy() [4/4]

DataMessage * cmlabs::DataMessage::getAttachedMessageCopy ( const char *  idx,
const char *  key 
)

returns a copy of the user message entry with this key

Parameters
idxtextual index for the maps
key
Returns
copy of the user message entry

◆ getAttachedMessageMap()

std::map< std::string, DataMessage * > cmlabs::DataMessage::getAttachedMessageMap ( const char *  key)

returns a copy of the user message entry with this key

Parameters
key
Returns
copy of the user message entry

◆ getChainCount()

uint32 cmlabs::DataMessage::getChainCount ( )
inline

getChainCount()

Get number of messages it took to process the trigger message that caused this message to be posted

Returns
0 if the message is not valid
count

◆ getChainCPUTime()

uint16 cmlabs::DataMessage::getChainCPUTime ( )
inline

getChainCPUTime()

Get cpu time in us it took to process the trigger message that caused this message to be posted

Returns
0 if the message is not valid
cpu time in us

◆ getChainWallTime()

uint16 cmlabs::DataMessage::getChainWallTime ( )
inline

getChainWallTime()

Get wall time in us it took to process the trigger message that caused this message to be posted

Returns
0 if the message is not valid
cpu time in us

◆ getContentSize() [1/3]

uint32 cmlabs::DataMessage::getContentSize ( const char *  key)

getContentSize(const char* key)

returns the binary size of the content with this key

Parameters
key

◆ getContentSize() [2/3]

uint32 cmlabs::DataMessage::getContentSize ( int64  i,
const char *  key 
)

◆ getContentSize() [3/3]

uint32 cmlabs::DataMessage::getContentSize ( const char *  idx,
const char *  key 
)

returns the binary size of the content with this key

Parameters
idxtextual index for the maps
key
Returns
binary size of the content

◆ getContentType() [1/3]

uint32 cmlabs::DataMessage::getContentType ( const char *  key)

getContentType(const char* key)

returns the type of content with this key as CONSTCHARID, TIMEID, CHARDATAID, INTID, DOUBLEID, etc

Parameters
key

◆ getContentType() [2/3]

uint32 cmlabs::DataMessage::getContentType ( int64  i,
const char *  key 
)

◆ getContentType() [3/3]

uint32 cmlabs::DataMessage::getContentType ( const char *  idx,
const char *  key 
)

returns the type of content with this key as CONSTCHARID, TIMEID, CHARDATAID, INTID, DOUBLEID, etc

Parameters
idxtextual index for the maps
key
Returns
contentType as int

◆ getContextChange()

PsyContext cmlabs::DataMessage::getContextChange ( )
inline

getContextChange()

Get and return context change entry

Returns
NOCONTEXT is message is not valid or if context change is not set
contextchange else

◆ getCreatedTime()

uint64 cmlabs::DataMessage::getCreatedTime ( )
inline

getCreatedTime()

Get and return time message was created

Returns
false if the message is not valid
time else

◆ GetCSVHeader()

std::string cmlabs::DataMessage::GetCSVHeader ( const char *  separator = NULL,
const char *  preample = NULL 
)
static

toCSVHeader()

Parameters
separatorthe separator character, defaults to comma
preamplestring with entries to add before the standard list <preample>,type,created,sent,received,... Returns the static CSV header line for the output of toCSV()

◆ getCycleCPUTime()

uint16 cmlabs::DataMessage::getCycleCPUTime ( )
inline

getCycleCPUTime()

Get cpu time in us it took to process the trigger message that caused this message to be posted

Returns
0 if the message is not valid
cpu time in us

◆ getCycleWallTime()

uint16 cmlabs::DataMessage::getCycleWallTime ( )
inline

getCycleWallTime()

Get wall time in us it took to process the trigger message that caused this message to be posted

Returns
0 if the message is not valid
cpu time in us

◆ getData() [1/4]

const char * cmlabs::DataMessage::getData ( const char *  key,
uint32 &  size 
)

getData(const char* key, uint32& size)

returns the user binary data entry with this key + the size

Parameters
key
size

◆ getData() [2/4]

const char * cmlabs::DataMessage::getData ( const char *  key,
uint32 &  size,
bool &  success 
)

getData(const char* key, uint32& size)

returns the user binary data entry with this key + the size / returning the value and success/fail as a parameter

Parameters
key
size
success

◆ getData() [3/4]

const char * cmlabs::DataMessage::getData ( int64  i,
const char *  key,
uint32 &  size 
)

◆ getData() [4/4]

const char * cmlabs::DataMessage::getData ( const char *  idx,
const char *  key,
uint32 &  size 
)

returns the user binary data entry with this key + the size

Parameters
idxtextual index for the maps
key
size
Returns
user binary data

◆ getDataCopy() [1/4]

char * cmlabs::DataMessage::getDataCopy ( const char *  key,
uint32 &  size 
)

getDataCopy(const char* key, uint32& size)

returns a copy of the user binary data entry with this key + the size

Parameters
key
size

◆ getDataCopy() [2/4]

char * cmlabs::DataMessage::getDataCopy ( const char *  key,
uint32 &  size,
bool &  success 
)

getDataCopy(const char* key, uint32& size)

returns a copy of the user binary data entry with this key + the size / returning the value and success/fail as a parameter

Parameters
key
size
success

◆ getDataCopy() [3/4]

char * cmlabs::DataMessage::getDataCopy ( int64  i,
const char *  key,
uint32 &  size 
)

◆ getDataCopy() [4/4]

char * cmlabs::DataMessage::getDataCopy ( const char *  idx,
const char *  key,
uint32 &  size 
)

returns a copy of the user binary data entry with this key + the size

Parameters
idxtextual index for the maps
key
size
Returns
copy of the user binary data

◆ getDouble() [1/9]

bool cmlabs::DataMessage::getDouble ( const char *  key,
double &  value 
)

getDouble(const char* key, double& value)

returns the user float entry with this key

Parameters
key
value

◆ getDouble() [2/9]

double cmlabs::DataMessage::getDouble ( const char *  key,
bool &  success 
)

getDouble(const char* key, double& value)

returns the user float entry with this key / returning the value and success/fail as a parameter

Parameters
key
value
success

◆ getDouble() [3/9]

double cmlabs::DataMessage::getDouble ( const char *  key)

getDouble(const char* key)

returns the user double entry with this key/ returning the value with no indication of the success/fail except value will be default (0, "", NULL, etc.)

Parameters
key

◆ getDouble() [4/9]

bool cmlabs::DataMessage::getDouble ( int64  i,
const char *  key,
double &  value 
)

◆ getDouble() [5/9]

double cmlabs::DataMessage::getDouble ( int64  i,
const char *  key,
bool &  success 
)

◆ getDouble() [6/9]

double cmlabs::DataMessage::getDouble ( int64  i,
const char *  key 
)

◆ getDouble() [7/9]

bool cmlabs::DataMessage::getDouble ( const char *  idx,
const char *  key,
double &  value 
)

returns the user float entry with this key

Parameters
idxtextual index for the maps
key
value
Returns
true if successfull

◆ getDouble() [8/9]

double cmlabs::DataMessage::getDouble ( const char *  idx,
const char *  key,
bool &  success 
)

returns the user double entry with this key

Parameters
idxtextual index for the maps
key
success
Returns
user double entry

◆ getDouble() [9/9]

double cmlabs::DataMessage::getDouble ( const char *  idx,
const char *  key 
)

returns the user double entry with this key

Parameters
idxtextual index for the maps
key
Returns
user double entry

◆ getDoubleArray()

std::map< int64, double > cmlabs::DataMessage::getDoubleArray ( const char *  key)

◆ getDoubleMap()

std::map< std::string, double > cmlabs::DataMessage::getDoubleMap ( const char *  key)

returns the user double entry with this key

Parameters
key
Returns
user double entry

◆ getEOL()

uint64 cmlabs::DataMessage::getEOL ( )
inline

getEOL()

Get End of life of message

Returns
0 if message is not valid or the ttl is not set
time that the message will expire

◆ getFloat() [1/9]

bool cmlabs::DataMessage::getFloat ( const char *  key,
float64 &  value 
)

getFloat(const char* key, float64& value)

returns the user float entry with this key

Parameters
key
value

◆ getFloat() [2/9]

float64 cmlabs::DataMessage::getFloat ( const char *  key,
bool &  success 
)

getFloat(const char* key, float64& value)

returns the user float entry with this key / returning the value and success/fail as a parameter

Parameters
key
value
success

◆ getFloat() [3/9]

double cmlabs::DataMessage::getFloat ( const char *  key)

getFloat(const char* key)

returns the user float entry with this key/ returning the value with no indication of the success/fail except value will be default (0, "", NULL, etc.)

Parameters
key

◆ getFloat() [4/9]

bool cmlabs::DataMessage::getFloat ( int64  i,
const char *  key,
float64 &  value 
)

◆ getFloat() [5/9]

float64 cmlabs::DataMessage::getFloat ( int64  i,
const char *  key,
bool &  success 
)

◆ getFloat() [6/9]

float64 cmlabs::DataMessage::getFloat ( int64  i,
const char *  key 
)

◆ getFloat() [7/9]

bool cmlabs::DataMessage::getFloat ( const char *  idx,
const char *  key,
float64 &  value 
)

returns the user float entry with this key

Parameters
idxtextual index for the maps
key
value
Returns
true if successfull

◆ getFloat() [8/9]

float64 cmlabs::DataMessage::getFloat ( const char *  idx,
const char *  key,
bool &  success 
)

returns the user float entry with this key

Parameters
idxtextual index for the maps
key
success
Returns

◆ getFloat() [9/9]

float64 cmlabs::DataMessage::getFloat ( const char *  idx,
const char *  key 
)

returns the user float entry with this key

Parameters
idxtextual index for the maps
key
Returns
user float entry

◆ getFloatArray()

std::map< int64, float64 > cmlabs::DataMessage::getFloatArray ( const char *  key)

◆ getFloatMap()

std::map< std::string, float64 > cmlabs::DataMessage::getFloatMap ( const char *  key)

returns the user float entry with this key

Parameters
key
Returns
user float entry

◆ getFrom()

uint32 cmlabs::DataMessage::getFrom ( )
inline

getFrom() Get the sender id

Returns
from

◆ getInt() [1/9]

bool cmlabs::DataMessage::getInt ( const char *  key,
int64 &  value 
)

getInt(const char* key, int64& value)

returns the user integer entry with this key

Parameters
key
value

◆ getInt() [2/9]

int64 cmlabs::DataMessage::getInt ( const char *  key,
bool &  success 
)

getInt(const char* key, int64& value)

returns the user integer entry with this key / returning the value and success/fail as a parameter

Parameters
key
value
success

◆ getInt() [3/9]

int64 cmlabs::DataMessage::getInt ( const char *  key)

getInt(const char* key)

returns the user integer entry with this key / returning the value with no indication of the success/fail except value will be default (0, "", NULL, etc.)

Parameters
key

◆ getInt() [4/9]

bool cmlabs::DataMessage::getInt ( int64  i,
const char *  key,
int64 &  value 
)

◆ getInt() [5/9]

int64 cmlabs::DataMessage::getInt ( int64  i,
const char *  key,
bool &  success 
)

◆ getInt() [6/9]

int64 cmlabs::DataMessage::getInt ( int64  i,
const char *  key 
)

◆ getInt() [7/9]

bool cmlabs::DataMessage::getInt ( const char *  idx,
const char *  key,
int64 &  value 
)

returns the user integer entry with this key

Parameters
idxtextual index for the maps
key
value
Returns
true if successfull

◆ getInt() [8/9]

int64 cmlabs::DataMessage::getInt ( const char *  idx,
const char *  key,
bool &  success 
)

returns the user integer entry with this key

Parameters
idxtextual index for the maps
key
success
Returns
user integer entry

◆ getInt() [9/9]

int64 cmlabs::DataMessage::getInt ( const char *  idx,
const char *  key 
)

returns the user integer entry with this key

Parameters
idxtextual index for the maps
key
Returns
user integer entry

◆ getIntArray()

std::map< int64, int64 > cmlabs::DataMessage::getIntArray ( const char *  key)

◆ getIntMap()

std::map< std::string, int64 > cmlabs::DataMessage::getIntMap ( const char *  key)

returns the user integer entry with this key

Parameters
key
Returns
user integer entry

◆ getKeyType()

DataMessage::KeyType cmlabs::DataMessage::getKeyType ( const char *  key)

getKeyType(const char* key)

Return if the key points to a SINGLE, ARRAY or MAP value

Parameters
key

◆ getMapCount()

uint32 cmlabs::DataMessage::getMapCount ( const char *  key)

getMapCount(const char* key) Returns the number of elements in map with name '<key>'

Parameters
key

◆ getMapSize()

uint32 cmlabs::DataMessage::getMapSize ( const char *  key)

getMapSize(const char* key) Returns the number of elements in map with name '<key>'

Parameters
key

◆ getMemID()

uint64 cmlabs::DataMessage::getMemID ( )
inline

getMemID() Get and return memory ID

Returns
memid memory ID

◆ getPolicy()

uint8 cmlabs::DataMessage::getPolicy ( )
inline

getPolicy()

Gets the policy id of the message

Returns
0 if the message is not valid or if no policy is set
policy id else

◆ getPriority()

uint16 cmlabs::DataMessage::getPriority ( )
inline

getPriority()

Get message priority Messages have a prority that determines their relative order of scheduling, both in the whiteboards and in the modules.

Returns
0 if the message is not valid
priority else

◆ getRecvTime()

uint64 cmlabs::DataMessage::getRecvTime ( )
inline

getRecvTime()

Get and return time message was received

Returns
0 if the message is not valid or the time was not set
recvtime else

◆ getReference()

uint64 cmlabs::DataMessage::getReference ( )
inline

getReference() Get and return message reference id

Returns
reference

◆ getSendTime()

uint64 cmlabs::DataMessage::getSendTime ( )
inline

getSendTime()

Get time message was sent

Returns
0 if the message is not valid or the time was not set
sendtime else

◆ getSerial()

uint64 cmlabs::DataMessage::getSerial ( )
inline

getSerial()

Get message serial number

Returns
0 if the message is not valid
serial else

◆ getSize()

uint32 cmlabs::DataMessage::getSize ( )
inline

getSize() Get message size Many types of data of any size can be put into a message as user entries; the data will be kept in a single block of memory for efficiency

Returns
0 if the message is not valid
size else

◆ getStatus()

uint16 cmlabs::DataMessage::getStatus ( )
inline

getStatus()

Get current message status

Returns
0 if the message is not valid
status else

◆ getString() [1/8]

const char * cmlabs::DataMessage::getString ( const char *  key)

getString(const char* key)

returns the user string entry with this key

Parameters
key

◆ getString() [2/8]

const char * cmlabs::DataMessage::getString ( const char *  key,
uint32 &  size 
)

getString(const char* key, uint32 &size)

returns the user string entry with this key and provides the size

Parameters
key
size

◆ getString() [3/8]

const char * cmlabs::DataMessage::getString ( const char *  key,
bool &  success 
)

getString(const char* key)

returns the user string entry with this key / returning the value and success/fail as a parameter

Parameters
key
success

◆ getString() [4/8]

const char * cmlabs::DataMessage::getString ( const char *  key,
uint32 &  size,
bool &  success 
)

getString(const char* key, uint32 &size)

returns the user string entry with this key and provides the size / returning the value and success/fail as a parameter

Parameters
key
size
success

◆ getString() [5/8]

const char * cmlabs::DataMessage::getString ( int64  i,
const char *  key 
)

◆ getString() [6/8]

const char * cmlabs::DataMessage::getString ( int64  i,
const char *  key,
uint32 &  size 
)

◆ getString() [7/8]

const char * cmlabs::DataMessage::getString ( const char *  idx,
const char *  key 
)

returns the user string entry with this key

Parameters
idxtextual index for the maps
key
Returns
user string entry

◆ getString() [8/8]

const char * cmlabs::DataMessage::getString ( const char *  idx,
const char *  key,
uint32 &  size 
)

returns the user string entry with this key

Parameters
idxtextual index for the maps
key
sizethe size of the memory chunk for the String
Returns
user string entry

◆ getStringArray()

std::map< int64, std::string > cmlabs::DataMessage::getStringArray ( const char *  key)

◆ getStringMap()

std::map< std::string, std::string > cmlabs::DataMessage::getStringMap ( const char *  key)

returns the user string entry with this key

Parameters
key
Returns
user string entry

◆ getSystemID()

uint32 cmlabs::DataMessage::getSystemID ( )
inline

getSystemID() Get and return message system id

Returns
id

◆ getTag()

uint32 cmlabs::DataMessage::getTag ( )
inline

getTag() Retrieve and return message tag id Tags can be used to segment data temporally, i.e. a module may only be interested in camera data referencing a specific object or event.

Returns
0 if the message is not valid
tag returns message tag

◆ getTime() [1/4]

uint64 cmlabs::DataMessage::getTime ( const char *  key)

getTime(const char* key)

returns the user time entry with this key

Parameters
key

◆ getTime() [2/4]

uint64 cmlabs::DataMessage::getTime ( const char *  key,
bool &  success 
)

getTime(const char* key, bool& success)

returns the user time entry with this key / returning the value and success/fail as a parameter

Parameters
key
success

◆ getTime() [3/4]

uint64 cmlabs::DataMessage::getTime ( int64  i,
const char *  key 
)

getTime(int64 i, const char* key)

returns the user time with this key, getting and setting entries in arrays

Parameters
i
key

◆ getTime() [4/4]

uint64 cmlabs::DataMessage::getTime ( const char *  idx,
const char *  key 
)

returns the user time entry with this key

Parameters
idxtextual index for the maps
key
Returns
user time

◆ getTimeMap()

std::map< std::string, uint64 > cmlabs::DataMessage::getTimeMap ( const char *  key)

returns the user time entry with this key

Parameters
key
Returns
user time

◆ getTo()

uint32 cmlabs::DataMessage::getTo ( )
inline

getTo()

Set the receiver id

Returns
to

◆ getTTL()

uint64 cmlabs::DataMessage::getTTL ( )
inline

getTTL()

Gets message's "time to live" "TTL is a mechanism that limits the lifespan or lifetime of data in a computer or network"

Messages in Psyclone 2.0 live for a finite amount of time inside the shared memory, If ttl = 0 the message will only be delivered to whoever has subscribed to it and after this seize to exist.

Returns
0 if the message is not valid or the ttl is not set
ttl else

◆ getType()

PsyType cmlabs::DataMessage::getType ( )
inline

getType()

Get message type

Returns
NOTYPE if message is not valid or if type is not set
type else

◆ getUserCount()

uint32 cmlabs::DataMessage::getUserCount ( )
inline

getUserCount()

Return the number of user entries stored in the message

◆ getUserEntriesAsJSON()

std::string cmlabs::DataMessage::getUserEntriesAsJSON ( bool  asText)

getUserEntriesAsJSON(bool asText) Returns the JSON representation of the full message including all user entries, arrays and maps - and including the textual representation of any attached messages

Parameters
asTextif true write all entries as human readable text
Returns
JSON string

◆ getUserEntriesAsString()

std::string cmlabs::DataMessage::getUserEntriesAsString ( )

getUserEntriesAsString() Returns the textual representation of the full message including all user entries, arrays and maps - and including the textual representation of any attached messages

◆ getUserSize()

uint32 cmlabs::DataMessage::getUserSize ( )
inline

getUserSize()

Return the memory usage in bytes of all user entries stored in the message

◆ hasData()

bool cmlabs::DataMessage::hasData ( const char *  key)

Check if key variable exists and is a data entry

Parameters
key

◆ hasFloat()

bool cmlabs::DataMessage::hasFloat ( const char *  key)

Check if key variable exists and is a float

Parameters
key

◆ hasInteger()

bool cmlabs::DataMessage::hasInteger ( const char *  key)

Check if key variable exists and is an integer

Parameters
key

◆ hasKey()

bool cmlabs::DataMessage::hasKey ( const char *  key)

Check if key variable exists

Parameters
key

◆ hasMessage()

bool cmlabs::DataMessage::hasMessage ( const char *  key)

Check if key variable exists and is a message

Parameters
key

◆ hasString()

bool cmlabs::DataMessage::hasString ( const char *  key)

Check if key variable exists and is a string

Parameters
key

◆ hasTime()

bool cmlabs::DataMessage::hasTime ( const char *  key)

Check if key variable exists and is a time

Parameters
key

◆ isArrayContent()

bool cmlabs::DataMessage::isArrayContent ( const char *  key)

isArrayContent(const char* key)

Check if key variable is an array or not

Parameters
key

◆ isMapContent()

bool cmlabs::DataMessage::isMapContent ( const char *  key)

isMapContent(const char* key)

Check if key variable is a map or not

Parameters
key

◆ isSingleValue()

bool cmlabs::DataMessage::isSingleValue ( const char *  key)

isSingleValue(const char* key)

Check if key variable is not an array nor a map

Parameters
key

◆ isValid()

bool cmlabs::DataMessage::isValid ( )
inline

isValid() Checks to see if the message memory is valid

Returns
true if successful, false otherwise

◆ removeEntry()

bool cmlabs::DataMessage::removeEntry ( const char *  key)
inlineprotected

removeEntry(const char* key)

Internal function

Parameters
keykeyword
Returns
true if src == NULL
true if successfull

◆ setAttachedMessage() [1/3]

bool cmlabs::DataMessage::setAttachedMessage ( const char *  key,
DataMessage msg 
)

setAttachedMessage(const char* key, DataMessage* msg)

???, returns success or fail (usually because the message is not valid)

Parameters
key
msg

◆ setAttachedMessage() [2/3]

bool cmlabs::DataMessage::setAttachedMessage ( int64  i,
const char *  key,
DataMessage msg 
)

◆ setAttachedMessage() [3/3]

bool cmlabs::DataMessage::setAttachedMessage ( const char *  idx,
const char *  key,
DataMessage msg 
)

sets the user message entry with this key to the provided message

Parameters
idxtextual index for the maps
key
msgthe new message
Returns
true if successful

◆ setAttachedMessageArray()

bool cmlabs::DataMessage::setAttachedMessageArray ( const char *  key,
std::map< int64, DataMessage *> &  map 
)

setAttachedMessageArray(const char* key, std::map<int64, DataMessage*>& map)

Parameters
key

◆ setAttachedMessageMap()

bool cmlabs::DataMessage::setAttachedMessageMap ( const char *  key,
std::map< std::string, DataMessage *> &  map 
)

sets the user message entry with this key to the provided message

Parameters
key
map
Returns
true if successful

◆ setChainCount()

bool cmlabs::DataMessage::setChainCount ( uint32  count)
inline

setChainCount(uint32 count)

Set number of messages it took to process the trigger message that caused this message to be posted

Parameters
countnumber of messages
Returns
false if the message is not valid
true otherwise

◆ setChainCPUTime()

bool cmlabs::DataMessage::setChainCPUTime ( uint32  t)
inline

setChainCPUTime(uint32 t)

Set cpu time in us it took to process the trigger message that caused this message to be posted

Parameters
ttime in us
Returns
false if the message is not valid
true otherwise

◆ setChainWallTime()

bool cmlabs::DataMessage::setChainWallTime ( uint32  t)
inline

setChainWallTime(uint32 t)

Set wall time in us it took to process the trigger message that caused this message to be posted

Parameters
ttime in us
Returns
false if the message is not valid
true otherwise

◆ setContextChange()

bool cmlabs::DataMessage::setContextChange ( PsyContext context)
inline

setContextChange(PsyContext& context)

Set and return context change entry

Parameters
contextto change to
Returns
false if message is not valid
true else

◆ setCreatedTime()

bool cmlabs::DataMessage::setCreatedTime ( uint64  t)
inline

setCreatedTime(uint64 t)

Set time message was created to t

Parameters
ttime message was created
Returns
0 if the message is not valid
time=t else

◆ setCycleCPUTime()

bool cmlabs::DataMessage::setCycleCPUTime ( uint32  t)
inline

setCycleCPUTime(uint32 t)

Set cpu time in us it took to process the trigger message that caused this message to be posted

Parameters
ttime in us
Returns
false if the message is not valid
true otherwise

◆ setCycleWallTime()

bool cmlabs::DataMessage::setCycleWallTime ( uint32  t)
inline

setCycleWallTime(uint32 t)

Set wall time in us it took to process the trigger message that caused this message to be posted

Parameters
ttime in us
Returns
false if the message is not valid
true otherwise

◆ setData() [1/3]

bool cmlabs::DataMessage::setData ( const char *  key,
const char *  value,
uint32  size 
)

setData(const char* key, const void* value, uint32 size)

???, returns success or fail (usually because the message is not valid)

Parameters
key
size

◆ setData() [2/3]

bool cmlabs::DataMessage::setData ( int64  i,
const char *  key,
const char *  value,
uint32  size 
)

◆ setData() [3/3]

bool cmlabs::DataMessage::setData ( const char *  idx,
const char *  key,
const char *  value,
uint32  size 
)

sets the user binary data entry with this key + the size

Parameters
idxtextual index for the maps
key
valuethe new value for the data entry
size
Returns
true if successful

◆ setDestination()

bool cmlabs::DataMessage::setDestination ( uint16  addr)
inline

setDestination(uint16 addr) Set destination to address addr and return new destination

Parameters
addrdefine destination
Returns
true if successful, false otherwise

◆ setDouble() [1/3]

bool cmlabs::DataMessage::setDouble ( const char *  key,
double  value 
)

setDouble(const char* key, double value)

???, returns success or fail (usually because the message is not valid)

Parameters
key
value

◆ setDouble() [2/3]

bool cmlabs::DataMessage::setDouble ( int64  i,
const char *  key,
double  value 
)

◆ setDouble() [3/3]

bool cmlabs::DataMessage::setDouble ( const char *  idx,
const char *  key,
double  value 
)

sets the user double entry with this key to the value provided

Parameters
idxtextual index for the maps
key
valuethe new value of the double entry
Returns
true if successful

◆ setDoubleArray()

bool cmlabs::DataMessage::setDoubleArray ( const char *  key,
std::map< int64, double > &  map 
)

◆ setDoubleMap()

bool cmlabs::DataMessage::setDoubleMap ( const char *  key,
std::map< std::string, double > &  map 
)

sets the user double entry with this key to the value provided

Parameters
key
Returns
true if successful

◆ setEOL()

bool cmlabs::DataMessage::setEOL ( uint64  eol)
inline

setEOL(uint64 eol)

Calculates and sets the equivalent ttl for the message

Parameters
eolthe time at which the message is no longer supposed to exist
Returns
false if the message is not valid
true

◆ setFloat() [1/3]

bool cmlabs::DataMessage::setFloat ( const char *  key,
float64  value 
)

setFloat(const char* key, float64 value)

???, returns success or fail (usually because the message is not valid)

Parameters
key
value

◆ setFloat() [2/3]

bool cmlabs::DataMessage::setFloat ( int64  i,
const char *  key,
float64  value 
)

◆ setFloat() [3/3]

bool cmlabs::DataMessage::setFloat ( const char *  idx,
const char *  key,
float64  value 
)

sets the user float entry with this key to the value provided

Parameters
idxtextual index for the maps
key
valuethe new value of the float entry
Returns
true if successful

◆ setFloatArray()

bool cmlabs::DataMessage::setFloatArray ( const char *  key,
std::map< int64, float64 > &  map 
)

◆ setFloatMap()

bool cmlabs::DataMessage::setFloatMap ( const char *  key,
std::map< std::string, float64 > &  map 
)

sets the user float entry with this key to the value provided

Parameters
key
Returns
true if successful

◆ setFrom()

bool cmlabs::DataMessage::setFrom ( uint32  from)
inline

setFrom(uint32 from)

Set the sender id

Parameters
from
Returns
false if message is not valid

◆ setInt() [1/3]

bool cmlabs::DataMessage::setInt ( const char *  key,
int64  value 
)

setInt(const char* key, int64 value)

???, returns success or fail (usually because the message is not valid)

Parameters
key
value

◆ setInt() [2/3]

bool cmlabs::DataMessage::setInt ( int64  i,
const char *  key,
int64  value 
)

◆ setInt() [3/3]

bool cmlabs::DataMessage::setInt ( const char *  idx,
const char *  key,
int64  value 
)

sets the user integer entry with this key to the value provided

Parameters
idxtextual index for the maps
key
valuethe new value of the integer entry
Returns
true if successful

◆ setIntArray()

bool cmlabs::DataMessage::setIntArray ( const char *  key,
std::map< int64, int64 > &  map 
)

◆ setIntMap()

bool cmlabs::DataMessage::setIntMap ( const char *  key,
std::map< std::string, int64 > &  map 
)

sets the user integer entry with this key

Parameters
key
map
Returns
true if successful

◆ setMemID()

bool cmlabs::DataMessage::setMemID ( uint64  id)
inline

setMemID(uint64 id) Set memory ID to id

Parameters
idmemory id
Returns
true if successful, false otherwise

◆ setMultiple()

bool cmlabs::DataMessage::setMultiple ( uint32  from,
uint32  to,
uint32  tag,
uint64  ttl,
uint8  policy,
uint64  sendtime 
)
inline

setMultiple(uint32 from, uint32 to, uint32 tag, uint64 ttl, uint8 policy, uint64 sendtime) Set multiple information for a message at the same time

Parameters
fromthe sender id
tothe receiver id
tagthe message's tag id
ttlthe message's time-to-live in microseconds
policythe policy id
sendtimethe timestamp of the sending of the message
Returns
true if successful, false otherwise

◆ setOrigin()

bool cmlabs::DataMessage::setOrigin ( uint16  addr)
inline

setOrigin(uint16 addr) Set origin to address addr and return new origin

Parameters
addrdefine origin
Returns
true if successful, false otherwise

◆ setPolicy()

bool cmlabs::DataMessage::setPolicy ( uint8  policy)
inline

setPolicy(uint8 policy)

Sets the policy id of the message

Parameters
policy
Returns
false if the message is not valid
true else

◆ setPriority()

bool cmlabs::DataMessage::setPriority ( uint16  priority)
inline

setPriority(uint16 priority)

Set message priority to priority Messages have a prority that determines their relative order of scheduling

Parameters
priority
Returns
false if the message is not valid
true else

◆ setRecvTime()

bool cmlabs::DataMessage::setRecvTime ( uint64  time)
inline

setRecvTime(uint64 time)

Set new receiving time time

Parameters
timereceiving time
Returns
false if the message is not valid
true else

◆ setReference()

bool cmlabs::DataMessage::setReference ( uint64  ref)
inline

setReference(uint64 ref) Set message reference

Parameters
refreference
Returns
true if successful, false otherwise

◆ setSendTime()

bool cmlabs::DataMessage::setSendTime ( uint64  time)
inline

setSendTime(uint64 time)

Set message sendtime to time

Parameters
timeSendtime
Returns
false if the message is not valid
true else

◆ setSerial()

bool cmlabs::DataMessage::setSerial ( uint64  serial)
inline

setSerial(uint64 serial)

Set message serial number

Parameters
serial
Returns
false if the message is not valid
true else

◆ setStatus()

bool cmlabs::DataMessage::setStatus ( uint16  status)
inline

setStatus(uint16 status)

Set message status

Parameters
statusmessage status
Returns
false if the message is not valid
true else

◆ setString() [1/3]

bool cmlabs::DataMessage::setString ( const char *  key,
const char *  value 
)

setString(const char* key, const char* value)

???, returns success or fail (usually because the message is not valid)

Parameters
key
value

◆ setString() [2/3]

bool cmlabs::DataMessage::setString ( int64  i,
const char *  key,
const char *  value 
)

◆ setString() [3/3]

bool cmlabs::DataMessage::setString ( const char *  idx,
const char *  key,
const char *  value 
)

sets the user string entry with this key to the value provided

Parameters
idxtextual index for the maps
key
valuethe new value of the string entry
Returns
true if successful

◆ setStringArray()

bool cmlabs::DataMessage::setStringArray ( const char *  key,
std::map< int64, std::string > &  map 
)

◆ setStringMap()

bool cmlabs::DataMessage::setStringMap ( const char *  key,
std::map< std::string, std::string > &  map 
)

sets the user string entry with this key

Parameters
key
map
Returns
true if successful

◆ setSystemID()

bool cmlabs::DataMessage::setSystemID ( uint32  id)
inline

setSystemID(uint32 id) Set message system id

Parameters
id
Returns
true if successful, false otherwise

◆ setTag()

bool cmlabs::DataMessage::setTag ( uint32  tag)
inline

setTag(uint32 tag)

Sets message tag to tag Tags can be used to segment data temporally, i.e. a module may only be interested in camera data referencing a specific object or event.

Parameters
tagdefines message tag
Returns
true if successful, false otherwise

◆ setTime() [1/3]

bool cmlabs::DataMessage::setTime ( const char *  key,
uint64  value 
)

setTime(const char* key, uint64 value)

???, returns success or fail (usually because the message is not valid)

Parameters
key
value

◆ setTime() [2/3]

bool cmlabs::DataMessage::setTime ( int64  i,
const char *  key,
uint64  value 
)

◆ setTime() [3/3]

bool cmlabs::DataMessage::setTime ( const char *  idx,
const char *  key,
uint64  value 
)

sets the user time entry with this key to the value provided

Parameters
idxtextual index for the maps
key
valuethe value of the time entry
Returns
true if successful

◆ setTimeArray()

bool cmlabs::DataMessage::setTimeArray ( const char *  key,
std::map< int64, uint64 > &  map 
)

◆ setTimeMap()

bool cmlabs::DataMessage::setTimeMap ( const char *  key,
std::map< std::string, uint64 > &  map 
)

sets the user time entry with this key

Parameters
key
map
Returns
true if successful

◆ setTo()

bool cmlabs::DataMessage::setTo ( uint32  to)
inline

setTo(uint32 to)

Get the receiver id

Parameters
to
Returns

◆ setTTL()

bool cmlabs::DataMessage::setTTL ( uint64  ttl)
inline

setTTL(uint64 ttl)

Sets time to live for a message in microseconds Messages in Psyclone 2.0 live for a finite amount of time inside the shared memory, If ttl = 0 the message will only be delivered to whoever has subscribed to it and after this seize to exist.

Parameters
ttltime-to-live in microseconds
Returns
false if message is not valid
true else

◆ setType()

bool cmlabs::DataMessage::setType ( PsyType type)
inline

setType(PsyType &type)

Set message type to type

Parameters
typethe message type
Returns
false message is not valid
true if success

◆ swapMessageData()

const char * cmlabs::DataMessage::swapMessageData ( const char *  data)

swapMessageData(const char* data)

internal function

Parameters
data

◆ toCSV()

std::string cmlabs::DataMessage::toCSV ( const char *  separator = NULL,
const char *  preample = NULL,
std::map< uint16, std::string > *  subtypes = NULL,
std::map< uint16, std::string > *  subcontexts = NULL,
std::map< uint32, std::string > *  compNames = NULL 
)

toCSV()

Parameters
separatorthe separator character, defaults to comma
preamplestring with entries to add before the standard list <preample>,type,created,sent,received,... Returns the CSV representation of the full message including a textual description of all user entries

◆ toJSON()

std::string cmlabs::DataMessage::toJSON ( std::map< uint16, std::string > *  subtypes = NULL,
std::map< uint16, std::string > *  subcontexts = NULL,
std::map< uint32, std::string > *  compNames = NULL 
)

toJSON()

Returns the JSON representation of the full message including all user entries, arrays and maps - and including the JSON representation of any attached messages

◆ toXML()

std::string cmlabs::DataMessage::toXML ( std::map< uint16, std::string > *  subtypes = NULL,
std::map< uint16, std::string > *  subcontexts = NULL,
std::map< uint32, std::string > *  compNames = NULL 
)

toXML()

Returns the XML representation of the full message including all user entries, arrays and maps - and including the XML representation of any attached messages


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