CMSDK
2.0.1
|
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 () | |
DataMessage * | copy () |
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) |
DataMessage * | getAttachedMessageCopy (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) |
DataMessage * | getAttachedMessageCopy (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) |
DataMessage * | getAttachedMessageCopy (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) |
DataMessage * | getAttachedMessageCopy (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 DataMessage * | FindClosestMessage (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 | |
DataMessageHeader * | data |
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) |
cmlabs::DataMessage::DataMessage | ( | ) |
DataMessage() Creates an empty DataMessage
cmlabs::DataMessage::DataMessage | ( | PsyType | type, |
uint32 | from | ||
) |
DataMessage(PsyType type, uint32 from) Creates a DataMessage with type and from fields set
type | set the message type |
from | set the message sender id |
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
type | set the message type |
from | set the message sender id |
to | set the message receiver id |
ttl | set the time-to-live for the message in microseconds, after which it will have reached its end-of-life (eol) |
priority | set the message priority |
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
type | set the message type |
from | set the message sender id |
to | set the message receiver id |
tag | set the message tag id |
ttl | set the time-to-live for the message in microseconds, after which it will have reached its end-of-life (eol) |
priority | set the message priority |
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
data | the binary message data to copy from |
copy | should the data be copied or can it be taken |
cmlabs::DataMessage::DataMessage | ( | const char * | data | ) |
data | the binary message data to copy from Creates a DataMessage as a copy of the binary message data provided, will always copy the data |
cmlabs::DataMessage::DataMessage | ( | const DataMessage & | msg | ) |
DataMessage(const DataMessage& msg)
msg | the message to copy from Creates a DataMessage as a copy of another DataMessage |
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
data | the binary message data to copy from |
maxDraftSize | the maximum binary size of the newly created message |
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
msg | the message to copy from |
maxDraftSize | the maximum binary size of the newly created message |
cmlabs::DataMessage::~DataMessage | ( | ) |
~DataMessage() Message destructor
bool cmlabs::DataMessage::addTimeUsage | ( | uint32 | cycleCPUTime, |
uint32 | cycleWallTime, | ||
uint32 | chainCPUTime = 0 , |
||
uint32 | chainWallTime = 0 , |
||
uint32 | chainCount = 0 |
||
) |
Update the CPU and Wall time usage since trigger message arrived and add up the chain usage
cycleCPUTime | cycle CPU time in us |
cycleWallTime | cycle wall time in us |
chainCPUTime | cycle CPU time in us |
chainWallTime | cycle wall time in us |
|
inline |
copy() Creates a copy of the message and returns it
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
msg | the Message to copy the user data from |
|
inline |
Marks the entry as unused
key | keyword |
bool cmlabs::DataMessage::fillInDraftUserDataFrom | ( | const char * | data, |
uint32 | maxDraftSize | ||
) |
fillInDraftUserDataFrom(const char* data, uint32 maxDraftSize)
internal function
data | |
maxDraftSize |
|
static |
FindClosestMessage(uint64 t, std::map<uint64, DataMessage*> &messages) In a map of time -> DataMessage, find the message closes to the time t
t | timestamp to find the closest match to |
messages | map of time -> DataMessage |
|
inlineprotected |
Internal function
key | keyword |
|
inlineprotected |
findKey(const char* key) Internal function
key |
|
inlineprotected |
Internal function
space |
uint32 cmlabs::DataMessage::getArrayCount | ( | const char * | key | ) |
getArrayCount(const char* key) Returns the number of elements in array with name '<key>'
key |
uint32 cmlabs::DataMessage::getArraySize | ( | const char * | key | ) |
getArraySize(const char* key) Returns the number of elements in array with name '<key>'
key |
bool cmlabs::DataMessage::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.
key |
float64 cmlabs::DataMessage::getAsFloat | ( | const char * | key | ) |
returns the user entry as a float regardless of what type it is
key |
float64 cmlabs::DataMessage::getAsFloat | ( | int64 | i, |
const char * | key | ||
) |
getAsFloat(int64 i, const char* key)
i | |
key |
float64 cmlabs::DataMessage::getAsFloat | ( | const char * | idx, |
const char * | key | ||
) |
returns the user entry as a float regardless of what type it is
idx | textual index for the maps |
key |
std::map< int64, float64 > cmlabs::DataMessage::getAsFloatArray | ( | const char * | key | ) |
getAsFloatArray(const char* key)
key |
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
key |
int64 cmlabs::DataMessage::getAsInt | ( | const char * | key | ) |
returns the user entry as an integer regardless of what type it is
key |
int64 cmlabs::DataMessage::getAsInt | ( | int64 | i, |
const char * | key | ||
) |
getAsInt(int64 i, const char* key)
i | |
key |
int64 cmlabs::DataMessage::getAsInt | ( | const char * | idx, |
const char * | key | ||
) |
returns the user entry as an integer regardless of what type it is
idx | textual index for the maps |
key |
std::map< int64, int64 > cmlabs::DataMessage::getAsIntArray | ( | const char * | key | ) |
getAsIntArray(const char* key)
key |
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
key |
std::string cmlabs::DataMessage::getAsString | ( | const char * | key | ) |
returns the user entry as a string regardless of what type it is
key |
std::string cmlabs::DataMessage::getAsString | ( | int64 | i, |
const char * | key | ||
) |
getAsString(int64 i, const char* key)
i | |
key |
std::string cmlabs::DataMessage::getAsString | ( | const char * | idx, |
const char * | key | ||
) |
returns the user entry as a string regardless of what type it is
idx | textual index for the maps |
key |
std::map< int64, std::string > cmlabs::DataMessage::getAsStringArray | ( | const char * | key | ) |
getAsStringArray(const char* key)
key |
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
key |
uint64 cmlabs::DataMessage::getAsTime | ( | const char * | key | ) |
returns the user entry as a time regardless of what type it is
key |
uint64 cmlabs::DataMessage::getAsTime | ( | int64 | i, |
const char * | key | ||
) |
getAsTime(int64 i, const char* key)
i | |
key |
uint64 cmlabs::DataMessage::getAsTime | ( | const char * | idx, |
const char * | key | ||
) |
returns the user entry as a time regardless of what type it is
idx | textual index for the maps |
key |
std::map< int64, DataMessage * > cmlabs::DataMessage::getAttachedMessageArray | ( | const char * | key | ) |
getAttachedMessageArray(const char* key)
key |
DataMessage * cmlabs::DataMessage::getAttachedMessageCopy | ( | const char * | key | ) |
getAttachedMessageCopy(const char* key)
returns a copy of the user message entry with this key
key |
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
key | |
success |
DataMessage * cmlabs::DataMessage::getAttachedMessageCopy | ( | int64 | i, |
const char * | key | ||
) |
getAttachedMessageCopy(int64 i, const char* key)
i | |
key |
DataMessage * cmlabs::DataMessage::getAttachedMessageCopy | ( | const char * | idx, |
const char * | key | ||
) |
returns a copy of the user message entry with this key
idx | textual index for the maps |
key |
std::map< std::string, DataMessage * > cmlabs::DataMessage::getAttachedMessageMap | ( | const char * | key | ) |
returns a copy of the user message entry with this key
key |
|
inline |
Get number of messages it took to process the trigger message that caused this message to be posted
|
inline |
Get cpu time in us it took to process the trigger message that caused this message to be posted
|
inline |
Get wall time in us it took to process the trigger message that caused this message to be posted
uint32 cmlabs::DataMessage::getContentSize | ( | const char * | key | ) |
uint32 cmlabs::DataMessage::getContentSize | ( | int64 | i, |
const char * | key | ||
) |
getContentSize(int64 i, const char* key)
i | |
key |
uint32 cmlabs::DataMessage::getContentSize | ( | const char * | idx, |
const char * | key | ||
) |
returns the binary size of the content with this key
idx | textual index for the maps |
key |
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
key |
uint32 cmlabs::DataMessage::getContentType | ( | int64 | i, |
const char * | key | ||
) |
getContentType(int64 i, const char* key)
i | |
key |
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
idx | textual index for the maps |
key |
|
inline |
Get and return context change entry
|
inline |
Get and return time message was created
|
static |
toCSVHeader()
separator | the separator character, defaults to comma |
preample | string with entries to add before the standard list <preample>,type,created,sent,received,... Returns the static CSV header line for the output of toCSV() |
|
inline |
Get cpu time in us it took to process the trigger message that caused this message to be posted
|
inline |
Get wall time in us it took to process the trigger message that caused this message to be posted
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
key | |
size |
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
key | |
size | |
success |
const char * cmlabs::DataMessage::getData | ( | int64 | i, |
const char * | key, | ||
uint32 & | size | ||
) |
getData(int64 i, const char* key, uint32& size)
i | |
key | |
size |
const char * cmlabs::DataMessage::getData | ( | const char * | idx, |
const char * | key, | ||
uint32 & | size | ||
) |
returns the user binary data entry with this key + the size
idx | textual index for the maps |
key | |
size |
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
key | |
size |
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
key | |
size | |
success |
char * cmlabs::DataMessage::getDataCopy | ( | int64 | i, |
const char * | key, | ||
uint32 & | size | ||
) |
getDataCopy(int64 i, const char* key, uint32& size)
i | |
key | |
size |
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
idx | textual index for the maps |
key | |
size |
bool cmlabs::DataMessage::getDouble | ( | const char * | key, |
double & | value | ||
) |
getDouble(const char* key, double& value)
returns the user float entry with this key
key | |
value |
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
key | |
value | |
success |
double cmlabs::DataMessage::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.)
key |
bool cmlabs::DataMessage::getDouble | ( | int64 | i, |
const char * | key, | ||
double & | value | ||
) |
getDouble(int64 i, const char* key, double& value)
i | |
key | |
value |
double cmlabs::DataMessage::getDouble | ( | int64 | i, |
const char * | key, | ||
bool & | success | ||
) |
getDouble(int64 i, const char* key, bool& success)
i | |
key | |
success |
double cmlabs::DataMessage::getDouble | ( | int64 | i, |
const char * | key | ||
) |
getDouble(int64 i, const char* key)
i | |
key |
bool cmlabs::DataMessage::getDouble | ( | const char * | idx, |
const char * | key, | ||
double & | value | ||
) |
returns the user float entry with this key
idx | textual index for the maps |
key | |
value |
double cmlabs::DataMessage::getDouble | ( | const char * | idx, |
const char * | key, | ||
bool & | success | ||
) |
returns the user double entry with this key
idx | textual index for the maps |
key | |
success |
double cmlabs::DataMessage::getDouble | ( | const char * | idx, |
const char * | key | ||
) |
returns the user double entry with this key
idx | textual index for the maps |
key |
std::map< int64, double > cmlabs::DataMessage::getDoubleArray | ( | const char * | key | ) |
getDoubleArray(const char* key)
key |
std::map< std::string, double > cmlabs::DataMessage::getDoubleMap | ( | const char * | key | ) |
returns the user double entry with this key
key |
|
inline |
Get End of life of message
bool cmlabs::DataMessage::getFloat | ( | const char * | key, |
float64 & | value | ||
) |
getFloat(const char* key, float64& value)
returns the user float entry with this key
key | |
value |
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
key | |
value | |
success |
double cmlabs::DataMessage::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.)
key |
bool cmlabs::DataMessage::getFloat | ( | int64 | i, |
const char * | key, | ||
float64 & | value | ||
) |
getFloat(int64 i, const char* key, float64& value)
i | |
key | |
value |
float64 cmlabs::DataMessage::getFloat | ( | int64 | i, |
const char * | key, | ||
bool & | success | ||
) |
getFloat(int64 i, const char* key, bool& success)
i | |
key | |
success |
float64 cmlabs::DataMessage::getFloat | ( | int64 | i, |
const char * | key | ||
) |
getFloat(int64 i, const char* key)
i | |
key |
bool cmlabs::DataMessage::getFloat | ( | const char * | idx, |
const char * | key, | ||
float64 & | value | ||
) |
returns the user float entry with this key
idx | textual index for the maps |
key | |
value |
float64 cmlabs::DataMessage::getFloat | ( | const char * | idx, |
const char * | key, | ||
bool & | success | ||
) |
returns the user float entry with this key
idx | textual index for the maps |
key | |
success |
float64 cmlabs::DataMessage::getFloat | ( | const char * | idx, |
const char * | key | ||
) |
returns the user float entry with this key
idx | textual index for the maps |
key |
std::map< int64, float64 > cmlabs::DataMessage::getFloatArray | ( | const char * | key | ) |
getFloatArray(const char* key)
key |
std::map< std::string, float64 > cmlabs::DataMessage::getFloatMap | ( | const char * | key | ) |
returns the user float entry with this key
key |
|
inline |
getFrom() Get the sender id
bool cmlabs::DataMessage::getInt | ( | const char * | key, |
int64 & | value | ||
) |
getInt(const char* key, int64& value)
returns the user integer entry with this key
key | |
value |
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
key | |
value | |
success |
int64 cmlabs::DataMessage::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.)
key |
bool cmlabs::DataMessage::getInt | ( | int64 | i, |
const char * | key, | ||
int64 & | value | ||
) |
getInt(int64 i, const char* key, int64& value)
i | |
key | |
value |
int64 cmlabs::DataMessage::getInt | ( | int64 | i, |
const char * | key, | ||
bool & | success | ||
) |
getInt(int64 i, const char* key, bool& success)
i | |
key | |
success |
int64 cmlabs::DataMessage::getInt | ( | int64 | i, |
const char * | key | ||
) |
getInt(int64 i, const char* key)
i | |
key |
bool cmlabs::DataMessage::getInt | ( | const char * | idx, |
const char * | key, | ||
int64 & | value | ||
) |
returns the user integer entry with this key
idx | textual index for the maps |
key | |
value |
int64 cmlabs::DataMessage::getInt | ( | const char * | idx, |
const char * | key, | ||
bool & | success | ||
) |
returns the user integer entry with this key
idx | textual index for the maps |
key | |
success |
int64 cmlabs::DataMessage::getInt | ( | const char * | idx, |
const char * | key | ||
) |
returns the user integer entry with this key
idx | textual index for the maps |
key |
std::map< int64, int64 > cmlabs::DataMessage::getIntArray | ( | const char * | key | ) |
key |
std::map< std::string, int64 > cmlabs::DataMessage::getIntMap | ( | const char * | key | ) |
returns the user integer entry with this key
key |
DataMessage::KeyType cmlabs::DataMessage::getKeyType | ( | const char * | key | ) |
uint32 cmlabs::DataMessage::getMapCount | ( | const char * | key | ) |
getMapCount(const char* key) Returns the number of elements in map with name '<key>'
key |
uint32 cmlabs::DataMessage::getMapSize | ( | const char * | key | ) |
getMapSize(const char* key) Returns the number of elements in map with name '<key>'
key |
|
inline |
getMemID() Get and return memory ID
|
inline |
Gets the policy id of the message
|
inline |
Get message priority Messages have a prority that determines their relative order of scheduling, both in the whiteboards and in the modules.
|
inline |
Get and return time message was received
|
inline |
getReference() Get and return message reference id
|
inline |
Get time message was sent
|
inline |
|
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
|
inline |
const char * cmlabs::DataMessage::getString | ( | const char * | key | ) |
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
key | |
size |
const char * cmlabs::DataMessage::getString | ( | const char * | key, |
bool & | success | ||
) |
returns the user string entry with this key / returning the value and success/fail as a parameter
key | |
success |
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
key | |
size | |
success |
const char * cmlabs::DataMessage::getString | ( | int64 | i, |
const char * | key | ||
) |
getString(int64 i, const char* key)
i | |
key |
const char * cmlabs::DataMessage::getString | ( | int64 | i, |
const char * | key, | ||
uint32 & | size | ||
) |
getString(int64 i, const char* key, uint32 &size)
i | |
key | |
size |
const char * cmlabs::DataMessage::getString | ( | const char * | idx, |
const char * | key | ||
) |
returns the user string entry with this key
idx | textual index for the maps |
key |
const char * cmlabs::DataMessage::getString | ( | const char * | idx, |
const char * | key, | ||
uint32 & | size | ||
) |
returns the user string entry with this key
idx | textual index for the maps |
key | |
size | the size of the memory chunk for the String |
std::map< int64, std::string > cmlabs::DataMessage::getStringArray | ( | const char * | key | ) |
getStringArray(const char* key)
key |
std::map< std::string, std::string > cmlabs::DataMessage::getStringMap | ( | const char * | key | ) |
returns the user string entry with this key
key |
|
inline |
getSystemID() Get and return message system id
|
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.
uint64 cmlabs::DataMessage::getTime | ( | const char * | key | ) |
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
key | |
success |
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
i | |
key |
uint64 cmlabs::DataMessage::getTime | ( | const char * | idx, |
const char * | key | ||
) |
returns the user time entry with this key
idx | textual index for the maps |
key |
std::map< std::string, uint64 > cmlabs::DataMessage::getTimeMap | ( | const char * | key | ) |
returns the user time entry with this key
key |
|
inline |
|
inline |
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.
|
inline |
|
inline |
Return the number of user entries stored in the message
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
asText | if true write all entries as human readable text |
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
|
inline |
Return the memory usage in bytes of all user entries stored in the message
bool cmlabs::DataMessage::hasData | ( | const char * | key | ) |
Check if key variable exists and is a data entry
key |
bool cmlabs::DataMessage::hasFloat | ( | const char * | key | ) |
Check if key variable exists and is a float
key |
bool cmlabs::DataMessage::hasInteger | ( | const char * | key | ) |
Check if key variable exists and is an integer
key |
bool cmlabs::DataMessage::hasKey | ( | const char * | key | ) |
Check if key variable exists
key |
bool cmlabs::DataMessage::hasMessage | ( | const char * | key | ) |
Check if key variable exists and is a message
key |
bool cmlabs::DataMessage::hasString | ( | const char * | key | ) |
Check if key variable exists and is a string
key |
bool cmlabs::DataMessage::hasTime | ( | const char * | key | ) |
Check if key variable exists and is a time
key |
bool cmlabs::DataMessage::isArrayContent | ( | const char * | key | ) |
bool cmlabs::DataMessage::isMapContent | ( | const char * | key | ) |
bool cmlabs::DataMessage::isSingleValue | ( | const char * | key | ) |
|
inline |
isValid() Checks to see if the message memory is valid
|
inlineprotected |
Internal function
key | keyword |
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)
key | |
msg |
bool cmlabs::DataMessage::setAttachedMessage | ( | int64 | i, |
const char * | key, | ||
DataMessage * | msg | ||
) |
setAttachedMessage(int64 i, const char* key, DataMessage* msg)
i | |
key | |
msg |
bool cmlabs::DataMessage::setAttachedMessage | ( | const char * | idx, |
const char * | key, | ||
DataMessage * | msg | ||
) |
sets the user message entry with this key to the provided message
idx | textual index for the maps |
key | |
msg | the new message |
bool cmlabs::DataMessage::setAttachedMessageArray | ( | const char * | key, |
std::map< int64, DataMessage *> & | map | ||
) |
setAttachedMessageArray(const char* key, std::map<int64, DataMessage*>& map)
key | |
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
key | |
map |
|
inline |
Set number of messages it took to process the trigger message that caused this message to be posted
count | number of messages |
|
inline |
Set cpu time in us it took to process the trigger message that caused this message to be posted
t | time in us |
|
inline |
Set wall time in us it took to process the trigger message that caused this message to be posted
t | time in us |
|
inline |
setContextChange(PsyContext& context)
Set and return context change entry
context | to change to |
|
inline |
Set time message was created to t
t | time message was created |
|
inline |
Set cpu time in us it took to process the trigger message that caused this message to be posted
t | time in us |
|
inline |
Set wall time in us it took to process the trigger message that caused this message to be posted
t | time in us |
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)
key | |
size |
bool cmlabs::DataMessage::setData | ( | int64 | i, |
const char * | key, | ||
const char * | value, | ||
uint32 | size | ||
) |
setData(int64 i, const char* key, const char* value, uint32 size)
i | |
key | |
value | |
size |
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
idx | textual index for the maps |
key | |
value | the new value for the data entry |
size |
|
inline |
setDestination(uint16 addr) Set destination to address addr and return new destination
addr | define destination |
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)
key | |
value |
bool cmlabs::DataMessage::setDouble | ( | int64 | i, |
const char * | key, | ||
double | value | ||
) |
setDouble(int64 i, const char* key, double value)
i | |
key | |
value |
bool cmlabs::DataMessage::setDouble | ( | const char * | idx, |
const char * | key, | ||
double | value | ||
) |
sets the user double entry with this key to the value provided
idx | textual index for the maps |
key | |
value | the new value of the double entry |
bool cmlabs::DataMessage::setDoubleArray | ( | const char * | key, |
std::map< int64, double > & | map | ||
) |
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
key |
|
inline |
Calculates and sets the equivalent ttl for the message
eol | the time at which the message is no longer supposed to exist |
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)
key | |
value |
bool cmlabs::DataMessage::setFloat | ( | int64 | i, |
const char * | key, | ||
float64 | value | ||
) |
setFloat(int64 i, const char* key, float64 value)
i | |
key | |
value |
bool cmlabs::DataMessage::setFloat | ( | const char * | idx, |
const char * | key, | ||
float64 | value | ||
) |
sets the user float entry with this key to the value provided
idx | textual index for the maps |
key | |
value | the new value of the float entry |
bool cmlabs::DataMessage::setFloatArray | ( | const char * | key, |
std::map< int64, float64 > & | map | ||
) |
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
key |
|
inline |
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)
key | |
value |
bool cmlabs::DataMessage::setInt | ( | int64 | i, |
const char * | key, | ||
int64 | value | ||
) |
setInt(int64 i, const char* key, int64 value)
i | |
key | |
value |
bool cmlabs::DataMessage::setInt | ( | const char * | idx, |
const char * | key, | ||
int64 | value | ||
) |
sets the user integer entry with this key to the value provided
idx | textual index for the maps |
key | |
value | the new value of the integer entry |
bool cmlabs::DataMessage::setIntArray | ( | const char * | key, |
std::map< int64, int64 > & | map | ||
) |
setIntArray(const char* key, std::map<int64, int64>& map)
key | |
bool cmlabs::DataMessage::setIntMap | ( | const char * | key, |
std::map< std::string, int64 > & | map | ||
) |
sets the user integer entry with this key
key | |
map |
|
inline |
setMemID(uint64 id) Set memory ID to id
id | memory id |
|
inline |
setMultiple(uint32 from, uint32 to, uint32 tag, uint64 ttl, uint8 policy, uint64 sendtime) Set multiple information for a message at the same time
from | the sender id |
to | the receiver id |
tag | the message's tag id |
ttl | the message's time-to-live in microseconds |
policy | the policy id |
sendtime | the timestamp of the sending of the message |
|
inline |
setOrigin(uint16 addr) Set origin to address addr and return new origin
addr | define origin |
|
inline |
Sets the policy id of the message
policy |
|
inline |
Set message priority to priority Messages have a prority that determines their relative order of scheduling
priority |
|
inline |
Set new receiving time time
time | receiving time |
|
inline |
setReference(uint64 ref) Set message reference
ref | reference |
|
inline |
Set message sendtime to time
time | Sendtime |
|
inline |
Set message serial number
serial |
|
inline |
Set message status
status | message status |
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)
key | |
value |
bool cmlabs::DataMessage::setString | ( | int64 | i, |
const char * | key, | ||
const char * | value | ||
) |
setString(int64 i, const char* key, const char* value)
i | |
key | |
value |
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
idx | textual index for the maps |
key | |
value | the new value of the string entry |
bool cmlabs::DataMessage::setStringArray | ( | const char * | key, |
std::map< int64, std::string > & | map | ||
) |
bool cmlabs::DataMessage::setStringMap | ( | const char * | key, |
std::map< std::string, std::string > & | map | ||
) |
sets the user string entry with this key
key | |
map |
|
inline |
setSystemID(uint32 id) Set message system id
id |
|
inline |
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.
tag | defines message tag |
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)
key | |
value |
bool cmlabs::DataMessage::setTime | ( | int64 | i, |
const char * | key, | ||
uint64 | value | ||
) |
setTime(int64 i, const char* key, uint64 value)
i | |
key | |
value |
bool cmlabs::DataMessage::setTime | ( | const char * | idx, |
const char * | key, | ||
uint64 | value | ||
) |
sets the user time entry with this key to the value provided
idx | textual index for the maps |
key | |
value | the value of the time entry |
bool cmlabs::DataMessage::setTimeArray | ( | const char * | key, |
std::map< int64, uint64 > & | map | ||
) |
setTimeArray(const char* key, std::map<int64, uint64>& map)
key | |
bool cmlabs::DataMessage::setTimeMap | ( | const char * | key, |
std::map< std::string, uint64 > & | map | ||
) |
sets the user time entry with this key
key | |
map |
|
inline |
|
inline |
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.
ttl | time-to-live in microseconds |
|
inline |
Set message type to type
type | the message type |
const char * cmlabs::DataMessage::swapMessageData | ( | const char * | data | ) |
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 |
||
) |
separator | the separator character, defaults to comma |
preample | string 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 |
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 |
||
) |
Returns the JSON representation of the full message including all user entries, arrays and maps - and including the JSON representation of any attached messages
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 |
||
) |