|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
The central Psyclone data container: a self-contained binary message with typed, named user entries. More...
#include <DataMessage.h>
Public Types | |
| enum | KeyType { NONE , SINGLE , ARRAY , MAP } |
Public Member Functions | |
| DataMessage () | |
| DataMessage() Creates an empty DataMessage. | |
| DataMessage (PsyType type, uint32 from) | |
| DataMessage(PsyType type, uint32 from) Creates a DataMessage with type and from fields set. | |
| 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. | |
| 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. | |
| DataMessage (char *data, bool copy=false) | |
| DataMessage(char* data, bool copy = false) Creates a DataMessage as a copy of the binary message data provided. | |
| DataMessage (const char *data) | |
| DataMessage(const char* data). | |
| DataMessage (const DataMessage &msg) | |
| DataMessage(const DataMessage& msg). | |
| 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. | |
| 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. | |
| ~DataMessage () | |
| ~DataMessage() Message destructor | |
| DataMessage * | copy () |
| copy() Creates a full deep copy of the message and returns it. | |
| const char * | swapMessageData (const char *data) |
| swapMessageData(const char* data) | |
| bool | fillInDraftUserDataFrom (const char *data, uint32 maxDraftSize) |
| fillInDraftUserDataFrom(const char* data, uint32 maxDraftSize) | |
| bool | isValid () |
| isValid() Checks that the message memory block exists and carries the current-format object id (DATAMESSAGEID). | |
| uint32 | getContentType (const char *key) |
| getContentType(const char* key) | |
| uint32 | getContentSize (const char *key) |
| getContentSize(const char* key) | |
| bool | getAsBool (const char *key) |
| getAsBool(const char* key) | |
| std::string | getAsString (const char *key) |
| getAsString(const char* key) | |
| int64 | getAsInt (const char *key) |
| getAsInt(const char* key) | |
| uint64 | getAsTime (const char *key) |
| getAsTime(const char* key) | |
| float64 | getAsFloat (const char *key) |
| getAsFloat(const char* key) | |
| uint64 | getTime (const char *key) |
| getTime(const char* key) | |
| const char * | getString (const char *key) |
| getString(const char* key) | |
| const char * | getString (const char *key, uint32 &size) |
| getString(const char* key, uint32 &size) | |
| bool | getInt (const char *key, int64 &value) |
| getInt(const char* key, int64& value) | |
| bool | getDouble (const char *key, double &value) |
| getDouble(const char* key, double& value) | |
| bool | getFloat (const char *key, float64 &value) |
| getFloat(const char* key, float64& value) | |
| const char * | getData (const char *key, uint32 &size) |
| getData(const char* key, uint32& size) | |
| char * | getDataCopy (const char *key, uint32 &size) |
| getDataCopy(const char* key, uint32& size) | |
| DataMessage * | getAttachedMessageCopy (const char *key) |
| getAttachedMessageCopy(const char* key) | |
| uint64 | getTime (const char *key, bool &success) |
| getTime(const char* key, bool& success) | |
| const char * | getString (const char *key, bool &success) |
| getString(const char* key) | |
| const char * | getString (const char *key, uint32 &size, bool &success) |
| getString(const char* key, uint32 &size) | |
| int64 | getInt (const char *key, bool &success) |
| getInt(const char* key, int64& value) | |
| double | getDouble (const char *key, bool &success) |
| getDouble(const char* key, double& value) | |
| float64 | getFloat (const char *key, bool &success) |
| getFloat(const char* key, float64& value) | |
| const char * | getData (const char *key, uint32 &size, bool &success) |
| getData(const char* key, uint32& size) | |
| char * | getDataCopy (const char *key, uint32 &size, bool &success) |
| getDataCopy(const char* key, uint32& size) | |
| DataMessage * | getAttachedMessageCopy (const char *key, bool &success) |
| getAttachedMessageCopy(const char* key) | |
| int64 | getInt (const char *key) |
| getInt(const char* key) | |
| double | getDouble (const char *key) |
| getDouble(const char* key) | |
| float64 | getFloat (const char *key) |
| getFloat(const char* key) | |
| bool | setTime (const char *key, uint64 value) |
| setTime(const char* key, uint64 value) | |
| bool | setString (const char *key, const char *value) |
| setString(const char* key, const char* value) | |
| bool | setInt (const char *key, int64 value) |
| setInt(const char* key, int64 value) | |
| bool | setDouble (const char *key, double value) |
| setDouble(const char* key, double value) | |
| bool | setFloat (const char *key, float64 value) |
| setFloat(const char* key, float64 value) | |
| bool | setData (const char *key, const char *value, uint32 size) |
| setData(const char* key, const char* value, uint32 size) | |
| bool | setAttachedMessage (const char *key, DataMessage *msg) |
| setAttachedMessage(const char* key, DataMessage* msg) | |
| uint32 | getUserSize () |
| getUserSize() | |
| uint32 | getUserCount () |
| getUserCount() | |
| KeyType | getKeyType (const char *key) |
| getKeyType(const char* key) | |
| bool | isArrayContent (const char *key) |
| isArrayContent(const char* key) | |
| bool | isMapContent (const char *key) |
| isMapContent(const char* key) | |
| bool | isSingleValue (const char *key) |
| isSingleValue(const char* key) | |
| bool | hasKey (const char *key) |
| Check if key variable exists. | |
| bool | hasString (const char *key) |
| Check if key variable exists and is a string. | |
| bool | hasInteger (const char *key) |
| Check if key variable exists and is an integer. | |
| bool | hasFloat (const char *key) |
| Check if key variable exists and is a float. | |
| bool | hasTime (const char *key) |
| Check if key variable exists and is a time. | |
| bool | hasData (const char *key) |
| Check if key variable exists and is a data entry. | |
| bool | hasMessage (const char *key) |
| Check if key variable exists and is a message. | |
| uint32 | getContentType (int64 i, const char *key) |
| getContentType(int64 i, const char* key) | |
| uint32 | getContentSize (int64 i, const char *key) |
| getContentSize(int64 i, const char* key) | |
| uint64 | getTime (int64 i, const char *key) |
| getTime(int64 i, const char* key) | |
| std::string | getAsString (int64 i, const char *key) |
| getAsString(int64 i, const char* key) | |
| int64 | getAsInt (int64 i, const char *key) |
| getAsInt(int64 i, const char* key) | |
| uint64 | getAsTime (int64 i, const char *key) |
| getAsTime(int64 i, const char* key) | |
| float64 | getAsFloat (int64 i, const char *key) |
| getAsFloat(int64 i, const char* key) | |
| const char * | getString (int64 i, const char *key) |
| getString(int64 i, const char* key) | |
| const char * | getString (int64 i, const char *key, uint32 &size) |
| getString(int64 i, const char* key, uint32 &size) | |
| bool | getInt (int64 i, const char *key, int64 &value) |
| getInt(int64 i, const char* key, int64& value) | |
| bool | getDouble (int64 i, const char *key, double &value) |
| getDouble(int64 i, const char* key, double& value) | |
| bool | getFloat (int64 i, const char *key, float64 &value) |
| getFloat(int64 i, const char* key, float64& value) | |
| int64 | getInt (int64 i, const char *key, bool &success) |
| getInt(int64 i, const char* key, bool& success) | |
| double | getDouble (int64 i, const char *key, bool &success) |
| getDouble(int64 i, const char* key, bool& success) | |
| float64 | getFloat (int64 i, const char *key, bool &success) |
| getFloat(int64 i, const char* key, bool& success) | |
| int64 | getInt (int64 i, const char *key) |
| getInt(int64 i, const char* key) | |
| double | getDouble (int64 i, const char *key) |
| getDouble(int64 i, const char* key) | |
| float64 | getFloat (int64 i, const char *key) |
| getFloat(int64 i, const char* key) | |
| const char * | getData (int64 i, const char *key, uint32 &size) |
| getData(int64 i, const char* key, uint32& size) | |
| char * | getDataCopy (int64 i, const char *key, uint32 &size) |
| getDataCopy(int64 i, const char* key, uint32& size) | |
| DataMessage * | getAttachedMessageCopy (int64 i, const char *key) |
| getAttachedMessageCopy(int64 i, const char* key) | |
| bool | setTime (int64 i, const char *key, uint64 value) |
| setTime(int64 i, const char* key, uint64 value) | |
| bool | setString (int64 i, const char *key, const char *value) |
| setString(int64 i, const char* key, const char* value) | |
| bool | setInt (int64 i, const char *key, int64 value) |
| setInt(int64 i, const char* key, int64 value) | |
| bool | setDouble (int64 i, const char *key, double value) |
| setDouble(int64 i, const char* key, double value) | |
| bool | setFloat (int64 i, const char *key, float64 value) |
| setFloat(int64 i, const char* key, float64 value) | |
| bool | setData (int64 i, const char *key, const char *value, uint32 size) |
| setData(int64 i, const char* key, const char* value, uint32 size) | |
| bool | setAttachedMessage (int64 i, const char *key, DataMessage *msg) |
| 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) |
| getAsStringArray(const char* key) | |
| std::map< int64, int64 > | getAsIntArray (const char *key) |
| getAsIntArray(const char* key) | |
| std::map< int64, float64 > | getAsFloatArray (const char *key) |
| getAsFloatArray(const char* key) | |
| std::map< int64, std::string > | getStringArray (const char *key) |
| getStringArray(const char* key) | |
| std::map< int64, int64 > | getIntArray (const char *key) |
| getIntArray(const char* key) | |
| std::map< int64, double > | getDoubleArray (const char *key) |
| getDoubleArray(const char* key) | |
| std::map< int64, float64 > | getFloatArray (const char *key) |
| getFloatArray(const char* key) | |
| std::map< int64, DataMessage * > | getAttachedMessageArray (const char *key) |
| getAttachedMessageArray(const char* key) | |
| uint32 | getArraySize (const char *key) |
| getArraySize(const char* key) Returns the number of elements in array with name '<key>' | |
| uint32 | getArrayCount (const char *key) |
| getArrayCount(const char* key) Returns the number of elements in array with name '<key>' | |
| uint32 | getMapSize (const char *key) |
| getMapSize(const char* key) Returns the number of elements in map with name '<key>' | |
| uint32 | getMapCount (const char *key) |
| getMapCount(const char* key) Returns the number of elements in map with name '<key>' | |
| bool | setTimeArray (const char *key, std::map< int64, uint64 > &map) |
setTimeArray(const char* key, std::map<int64, uint64>& map) Sets the whole time array named key in one call. | |
| bool | setStringArray (const char *key, std::map< int64, std::string > &map) |
setStringArray(const char* key, std::map<int64, std::string>& map) Sets the whole string array named key in one call. | |
| bool | setIntArray (const char *key, std::map< int64, int64 > &map) |
setIntArray(const char* key, std::map<int64, int64>& map) Sets the whole integer array named key in one call. | |
| bool | setDoubleArray (const char *key, std::map< int64, double > &map) |
setDoubleArray(const char* key, std::map<int64, double>& map) Sets the whole double array named key in one call. | |
| bool | setFloatArray (const char *key, std::map< int64, float64 > &map) |
setFloatArray(const char* key, std::map<int64, float64>& map) Sets the whole float array named key in one call. | |
| bool | setAttachedMessageArray (const char *key, std::map< int64, DataMessage * > &map) |
setAttachedMessageArray(const char* key, std::map<int64, DataMessage*>& map) Sets the whole array of attached messages named key in one call. | |
| uint32 | getContentType (const char *idx, const char *key) |
| returns the type of content with this key as CONSTCHARID, TIMEID, CHARDATAID, INTID, DOUBLEID, etc | |
| uint32 | getContentSize (const char *idx, const char *key) |
| returns the binary size of the content with this key | |
| uint64 | getTime (const char *idx, const char *key) |
| returns the user time entry with this key | |
| std::string | getAsString (const char *idx, const char *key) |
| returns the user entry as a string regardless of what type it is | |
| int64 | getAsInt (const char *idx, const char *key) |
| returns the user entry as an integer regardless of what type it is | |
| uint64 | getAsTime (const char *idx, const char *key) |
| returns the user entry as a time regardless of what type it is | |
| float64 | getAsFloat (const char *idx, const char *key) |
| returns the user entry as a float regardless of what type it is | |
| const char * | getString (const char *idx, const char *key) |
| returns the user string entry with this key | |
| const char * | getString (const char *idx, const char *key, uint32 &size) |
| returns the user string entry with this key | |
| bool | getInt (const char *idx, const char *key, int64 &value) |
| returns the user integer entry with this key | |
| bool | getDouble (const char *idx, const char *key, double &value) |
| returns the user float entry with this key | |
| bool | getFloat (const char *idx, const char *key, float64 &value) |
| returns the user float entry with this key | |
| int64 | getInt (const char *idx, const char *key, bool &success) |
| returns the user integer entry with this key | |
| double | getDouble (const char *idx, const char *key, bool &success) |
| returns the user double entry with this key | |
| float64 | getFloat (const char *idx, const char *key, bool &success) |
| returns the user float entry with this key | |
| int64 | getInt (const char *idx, const char *key) |
| returns the user integer entry with this key | |
| double | getDouble (const char *idx, const char *key) |
| returns the user double entry with this key | |
| float64 | getFloat (const char *idx, const char *key) |
| returns the user float entry with this key | |
| const char * | getData (const char *idx, const char *key, uint32 &size) |
| returns the user binary data entry with this key + the size | |
| char * | getDataCopy (const char *idx, const char *key, uint32 &size) |
| returns a copy of the user binary data entry with this key + the size | |
| DataMessage * | getAttachedMessageCopy (const char *idx, const char *key) |
| returns a copy of the user message entry with this key | |
| bool | setTime (const char *idx, const char *key, uint64 value) |
| sets the user time entry with this key to the value provided | |
| bool | setString (const char *idx, const char *key, const char *value) |
| sets the user string entry with this key to the value provided | |
| bool | setInt (const char *idx, const char *key, int64 value) |
| sets the user integer entry with this key to the value provided | |
| bool | setDouble (const char *idx, const char *key, double value) |
| sets the user double entry with this key to the value provided | |
| bool | setFloat (const char *idx, const char *key, float64 value) |
| sets the user float entry with this key to the value provided | |
| bool | setData (const char *idx, const char *key, const char *value, uint32 size) |
| sets the user binary data entry with this key + the size | |
| bool | setAttachedMessage (const char *idx, const char *key, DataMessage *msg) |
| sets the user message entry with this key to the provided message | |
| std::map< std::string, uint64 > | getTimeMap (const char *key) |
| returns the user time entry with this key | |
| std::map< std::string, std::string > | getAsStringMap (const char *key) |
| returns the user entry as a string regardless of what type it is | |
| std::map< std::string, int64 > | getAsIntMap (const char *key) |
| returns the user entry as an integer map regardless of what type it is | |
| std::map< std::string, float64 > | getAsFloatMap (const char *key) |
| returns the user entry as a float map regardless of what type it is | |
| std::map< std::string, std::string > | getStringMap (const char *key) |
| returns the user string entry with this key | |
| std::map< std::string, int64 > | getIntMap (const char *key) |
| returns the user integer entry with this key | |
| std::map< std::string, double > | getDoubleMap (const char *key) |
| returns the user double entry with this key | |
| std::map< std::string, float64 > | getFloatMap (const char *key) |
| returns the user float entry with this key | |
| std::map< std::string, DataMessage * > | getAttachedMessageMap (const char *key) |
| returns a copy of the user message entry with this key | |
| bool | setTimeMap (const char *key, std::map< std::string, uint64 > &map) |
| sets the user time entry with this key | |
| bool | setStringMap (const char *key, std::map< std::string, std::string > &map) |
| sets the user string entry with this key | |
| bool | setIntMap (const char *key, std::map< std::string, int64 > &map) |
| sets the user integer entry with this key | |
| bool | setDoubleMap (const char *key, std::map< std::string, double > &map) |
| sets the user double entry with this key to the value provided | |
| bool | setFloatMap (const char *key, std::map< std::string, float64 > &map) |
| sets the user float entry with this key to the value provided | |
| bool | setAttachedMessageMap (const char *key, std::map< std::string, DataMessage * > &map) |
| sets the user message entry with this key to the provided message | |
| std::string | toJSON (std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL) |
| toJSON() | |
| std::string | toXML (std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL) |
| toXML() | |
| 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) |
| toCSV() | |
| uint32 | copyUserEntriesFromMessage (DataMessage *msg) |
| copyUserEntriesFromMessage(DataMessage* msg) Copies all user data from a message into this message, overwriting any existing entries with the same key | |
| std::string | 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 | |
| std::string | 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 | |
| char * | getRawData () |
| getRawData() Retrieve a pointer to the raw binary block of the message (header + entries). | |
| uint16 | getOrigin () |
| getOrigin() Get the NodeID of the node the message originated on | |
| uint16 | getDestination () |
| getDestination() Get the NodeID of the destination node | |
| bool | setOrigin (uint16 addr) |
| setOrigin(uint16 addr) Set origin to address addr and return new origin | |
| bool | setDestination (uint16 addr) |
| setDestination(uint16 addr) Set destination to address addr and return new destination | |
| uint32 | getSize () |
| 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 | |
| bool | setMultiple (uint32 from, uint32 to, uint32 tag, uint64 ttl, uint8 policy, uint64 sendtime) |
| setMultiple(uint32 from, uint32 to, uint32 tag, uint64 ttl, uint8 policy, uint64 sendtime) Set multiple information for a message at the same time | |
| uint32 | getTag () |
| getTag() Retrieve and return message tag id Tags can be used to segment data temporally, i.e. | |
| bool | setTag (uint32 tag) |
| setTag(uint32 tag) | |
| uint64 | getReference () |
| getReference() Get and return message reference id | |
| bool | setReference (uint64 ref) |
| setReference(uint64 ref) Set message reference | |
| uint32 | getSystemID () |
| getSystemID() Get and return message system id | |
| bool | setSystemID (uint32 id) |
| setSystemID(uint32 id) Set message system id | |
| uint64 | getMemID () |
| getMemID() Get and return memory ID | |
| bool | setMemID (uint64 id) |
| setMemID(uint64 id) Set memory ID to id | |
| uint32 | getFrom () |
| getFrom() Get the sender id | |
| bool | setFrom (uint32 from) |
| setFrom(uint32 from) | |
| uint32 | getTo () |
| getTo() | |
| bool | setTo (uint32 to) |
| setTo(uint32 to) | |
| PsyType | getType () |
| getType() | |
| bool | setType (PsyType &type) |
| setType(PsyType &type) | |
| PsyContext | getContextChange () |
| getContextChange() | |
| bool | setContextChange (PsyContext &context) |
| setContextChange(PsyContext& context) | |
| uint64 | getTTL () |
| getTTL() | |
| uint64 | getEOL () |
| getEOL() | |
| bool | setTTL (uint64 ttl) |
| setTTL(uint64 ttl) | |
| bool | setEOL (uint64 eol) |
| setEOL(uint64 eol) | |
| uint16 | getPriority () |
| getPriority() | |
| bool | setPriority (uint16 priority) |
| setPriority(uint16 priority) | |
| uint8 | getPolicy () |
| getPolicy() | |
| bool | setPolicy (uint8 policy) |
| setPolicy(uint8 policy) | |
| uint64 | getSendTime () |
| getSendTime() | |
| bool | setSendTime (uint64 time) |
| setSendTime(uint64 time) | |
| uint64 | getRecvTime () |
| getRecvTime() | |
| bool | setRecvTime (uint64 time) |
| setRecvTime(uint64 time) | |
| uint64 | getCreatedTime () |
| getCreatedTime() | |
| bool | setCreatedTime (uint64 t) |
| setCreatedTime(uint64 t) | |
| uint16 | getStatus () |
| getStatus() | |
| bool | setStatus (uint16 status) |
| setStatus(uint16 status) | |
| uint64 | getSerial () |
| getSerial() | |
| bool | setSerial (uint64 serial) |
| setSerial(uint64 serial) | |
| bool | addTimeUsage (uint32 cycleCPUTime, uint32 cycleWallTime, uint32 chainCPUTime=0, uint32 chainWallTime=0, uint32 chainCount=0) |
| addTimeUsage() | |
| uint16 | getCycleCPUTime () |
| getCycleCPUTime() | |
| bool | setCycleCPUTime (uint32 t) |
| setCycleCPUTime(uint32 t) | |
| uint16 | getCycleWallTime () |
| getCycleWallTime() | |
| bool | setCycleWallTime (uint32 t) |
| setCycleWallTime(uint32 t) | |
| uint16 | getChainCPUTime () |
| getChainCPUTime() | |
| bool | setChainCPUTime (uint32 t) |
| setChainCPUTime(uint32 t) | |
| uint16 | getChainWallTime () |
| getChainWallTime() | |
| bool | setChainWallTime (uint32 t) |
| setChainWallTime(uint32 t) | |
| uint32 | getChainCount () |
| getChainCount() | |
| bool | setChainCount (uint32 count) |
| setChainCount(uint32 count) | |
| bool | deleteEntry (const char *key) |
| deleteEntry(const char* key) | |
| void | invalidateFindKeyCache () |
| Internal: clears the single-entry key-lookup cache. | |
Static Public Member Functions | |
| static DataMessage * | FindClosestMessage (uint64 t, std::map< uint64, DataMessage * > &messages) |
| FindClosestMessage(uint64 t, std::map<uint64, DataMessage*> &messages) In a map of time -> DataMessage, find the message closes to the time t. | |
| static bool | ConvertDataFromOlderMessageFormat (const char *data, char **newData) |
| Convert a binary block in the legacy (pre-version-10, DATAMESSAGEOLDID) format to the current DataMessageHeader layout. | |
| static bool | UnitTest () |
| Run the built-in self test for the DataMessage implementation. | |
| static std::string | GetCSVHeader (const char *separator=NULL, const char *preample=NULL) |
| toCSVHeader() | |
Public Attributes | |
| DataMessageHeader * | data |
| Pointer to the message's flat memory block (header + user entries). | |
| std::string | _lastFindKey |
| Internal: last key looked up (single-entry lookup cache; mutable so const-style getters can update it). | |
| char * | _lastFindKeyResult = NULL |
| Internal: cached location of the last key's entry inside the block; NULL if not found. | |
Protected Member Functions | |
| bool | setRawData (const char *key, const char *value, uint32 size, uint32 datatype) |
| Internal: low-level entry writer used by all typed set...() overloads. | |
| char * | findKey (const char *key) |
findKey(const char* key) Internal function: linear scan of the entry list for an entry whose key matches key (case-insensitive), with a one-slot cache of the last lookup to make repeated access to the same key O(1). | |
| char * | findEntry (const char *key) |
| findEntry(const char* key) | |
| bool | removeEntry (const char *key) |
| removeEntry(const char* key) | |
| char * | findSpace (uint32 space) |
| findSpace(uint32 space) | |
The central Psyclone data container: a self-contained binary message with typed, named user entries.
DataMessage is how components exchange data in Psyclone. Conceptually it is a routed envelope (type, from/to, tag, timestamps, TTL, priority, context) plus an ordered set of named user entries. Entries can be single values (string, integer, float, time, raw data, attached DataMessage), arrays (indexed by int64) or maps (indexed by string), all accessed through typed get/set overloads keyed by name.
The entire message lives in one flat memory block (pointed to by data), so it can be moved between processes via shared memory or over the network with a single copy — there is no separate serialisation format.
Typical use:
Ownership and lifetime rules:
Definition at line 278 of file DataMessage.h.
| Enumerator | |
|---|---|
| NONE | |
| SINGLE | |
| ARRAY | |
| MAP | |
Definition at line 812 of file DataMessage.h.
| cmlabs::DataMessage::DataMessage | ( | ) |
DataMessage() Creates an empty DataMessage.
Definition at line 1095 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DATAMESSAGEID, cmlabs::GetTimeNow(), and invalidateFindKeyCache().
Referenced by copy(), copyUserEntriesFromMessage(), DataMessage(), DataMessage(), DataMessage(), FindClosestMessage(), getAttachedMessageArray(), getAttachedMessageCopy(), getAttachedMessageCopy(), getAttachedMessageCopy(), getAttachedMessageCopy(), getAttachedMessageMap(), getUserEntriesAsJSON(), getUserEntriesAsString(), setAttachedMessage(), setAttachedMessage(), setAttachedMessage(), toXML(), and UnitTest().
| 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 |
Definition at line 1105 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DATAMESSAGEID, cmlabs::GetTimeNow(), and invalidateFindKeyCache().
| 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 |
Definition at line 1117 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DATAMESSAGEID, cmlabs::GetTimeNow(), and invalidateFindKeyCache().
| 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 |
| time | set the message creation time in microseconds |
| 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 |
Definition at line 1132 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DATAMESSAGEID, cmlabs::GetTimeNow(), and invalidateFindKeyCache().
| 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 |
Definition at line 1161 of file DataMessage.cpp.
References ConvertDataFromOlderMessageFormat(), copy(), CURRENTDATAMESSAGEVERSION, data, DATAMESSAGEID, DATAMESSAGEOLDID, GetObjID, invalidateFindKeyCache(), and MAXVALUINT32.
| cmlabs::DataMessage::DataMessage | ( | const char * | data | ) |
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 |
Definition at line 1216 of file DataMessage.cpp.
References ConvertDataFromOlderMessageFormat(), CURRENTDATAMESSAGEVERSION, data, DATAMESSAGEID, DATAMESSAGEOLDID, GetObjID, invalidateFindKeyCache(), and MAXVALUINT32.
| 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 |
Definition at line 1262 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DataMessage(), DATAMESSAGEID, GetObjID, invalidateFindKeyCache(), and cmlabs::DataMessageHeader::size.
| 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 |
Definition at line 1283 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DataMessage(), DATAMESSAGEID, DATAMESSAGEOLDID, fillInDraftUserDataFrom(), GetObjID, and invalidateFindKeyCache().
| 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 |
Definition at line 1326 of file DataMessage.cpp.
References CURRENTDATAMESSAGEVERSION, data, DataMessage(), DATAMESSAGEID, fillInDraftUserDataFrom(), GetObjID, and invalidateFindKeyCache().
| cmlabs::DataMessage::~DataMessage | ( | ) |
| 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 | chain CPU time in us |
| chainWallTime | chain wall time in us |
| chainCount | number of chain entries to add |
Definition at line 3138 of file DataMessage.cpp.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1addTimeUsage_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1addTimeUsage_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1addTimeUsage_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1addTimeUsage_1_1SWIG_13(), and cmlabs::PsyAPI::postOutputMessage().
|
static |
Convert a binary block in the legacy (pre-version-10, DATAMESSAGEOLDID) format to the current DataMessageHeader layout.
| data | legacy binary message block (not modified) |
| newData | receives a newly allocated block in the current format; caller takes ownership (delete[]) |
Definition at line 3151 of file DataMessage.cpp.
References cmlabs::DataMessageHeader::cid, cmlabs::DataMessageHeader_Old::contextchange, CURRENTDATAMESSAGEVERSION, cmlabs::DataMessageHeader::cver, data, DATAMESSAGEID, DATAMESSAGEOLDID, cmlabs::DataMessageHeader_Old::destination, cmlabs::DataMessageHeader_Old::from, LogPrint, cmlabs::DataMessageHeader_Old::memid, cmlabs::DataMessageHeader_Old::origin, cmlabs::DataMessageHeader_Old::policy, cmlabs::DataMessageHeader_Old::priority, cmlabs::DataMessageHeader_Old::recvtime, cmlabs::DataMessageHeader_Old::reference, cmlabs::DataMessageHeader_Old::sendtime, cmlabs::DataMessageHeader_Old::serial, cmlabs::DataMessageHeader::size, cmlabs::DataMessageHeader_Old::size, cmlabs::DataMessageHeader_Old::status, cmlabs::DataMessageHeader_Old::tag, cmlabs::DataMessageHeader_Old::time, cmlabs::DataMessageHeader_Old::to, cmlabs::DataMessageHeader_Old::ttl, cmlabs::DataMessageHeader_Old::type, cmlabs::DataMessageHeader_Old::userCount, and cmlabs::DataMessageHeader_Old::userSize.
Referenced by _wrap_DataMessage_ConvertDataFromOlderMessageFormat(), _wrap_DataMessage_ConvertDataFromOlderMessageFormat(), DataMessage(), DataMessage(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1ConvertDataFromOlderMessageFormat().
|
inline |
copy() Creates a full deep copy of the message and returns it.
Definition at line 370 of file DataMessage.h.
References DataMessage().
Referenced by _wrap_DataMessage_copy(), _wrap_DataMessage_copy(), DataMessage(), cmlabs::Internal_MessageToggler(), cmlabs::Internal_MessageTypeConverter(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1copy(), and cmlabs::TestRequestClient::run().
| 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 |
Definition at line 150 of file DataMessage.cpp.
References cmlabs::DataMessageHeader::cid, CONSTCHARID, data, DataMessage(), DATAMESSAGEID, setRawData(), cmlabs::DataMessageEntryHeader::size, cmlabs::DataMessageHeader::size, and cmlabs::DataMessageHeader::userCount.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1copyUserEntriesFromMessage(), and UnitTest().
|
inline |
Marks the entry as unused
| key | keyword |
Definition at line 2478 of file DataMessage.h.
References data, DATAMESSAGEID, and removeEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1deleteEntry().
| bool cmlabs::DataMessage::fillInDraftUserDataFrom | ( | const char * | data, |
| uint32 | maxDraftSize ) |
fillInDraftUserDataFrom(const char* data, uint32 maxDraftSize)
Internal function: for a "draft" message (created with a maxDraftSize limit, where large entries were replaced by name+size placeholders), copy the missing full entry payloads back in from the complete source block data.
| data | the complete original binary message block |
| maxDraftSize | the draft size limit originally used |
Definition at line 1361 of file DataMessage.cpp.
References CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, data, DATAMESSAGEDRAFTID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, INTID, setDouble(), setInt(), setRawData(), setString(), setTime(), cmlabs::DataMessageEntryHeader::size, cmlabs::DataMessageHeader::size, TIMEID, cmlabs::DataMessageHeader::userCount, and cmlabs::DataMessageHeader::userSize.
Referenced by DataMessage(), DataMessage(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1fillInDraftUserDataFrom().
|
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 |
Definition at line 3117 of file DataMessage.cpp.
References DataMessage().
Referenced by _wrap_DataMessage_FindClosestMessage(), _wrap_DataMessage_FindClosestMessage(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1FindClosestMessage().
|
inlineprotected |
Internal function: like findKey() but returns a pointer to the entry's value payload (just past the entry header and the key string).
| key | entry name to find |
Definition at line 2562 of file DataMessage.h.
References findKey().
Referenced by getAsBool(), getAsString(), getAttachedMessageCopy(), getContentSize(), getContentType(), getData(), getDataCopy(), getDouble(), getFloat(), getInt(), getString(), getString(), getTime(), hasData(), hasFloat(), hasInteger(), hasKey(), hasMessage(), hasString(), hasTime(), isSingleValue(), and setRawData().
|
inlineprotected |
findKey(const char* key) Internal function: linear scan of the entry list for an entry whose key matches key (case-insensitive), with a one-slot cache of the last lookup to make repeated access to the same key O(1).
| key | entry name to find |
Definition at line 2532 of file DataMessage.h.
References _lastFindKey, _lastFindKeyResult, CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, and stricmp.
Referenced by findEntry(), and removeEntry().
|
inlineprotected |
Internal function: scans for a previously deleted (UNUSEDID) entry slot of EXACTLY space bytes that can be reused for a new entry, avoiding a reallocation of the whole block.
| space | required slot size in bytes (header + key + payload) |
Definition at line 2600 of file DataMessage.h.
References data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, and UNUSEDID.
Referenced by setRawData().
| uint32 cmlabs::DataMessage::getArrayCount | ( | const char * | key | ) |
getArrayCount(const char* key) Returns the number of elements in array with name '<key>'
| key | entry key |
Definition at line 2738 of file DataMessage.cpp.
References getArraySize().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getArrayCount().
| uint32 cmlabs::DataMessage::getArraySize | ( | const char * | key | ) |
getArraySize(const char* key) Returns the number of elements in array with name '<key>'
| key | entry key |
Definition at line 2716 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
Referenced by getArrayCount(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getArraySize(), and UnitTest().
| 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 |
Definition at line 1596 of file DataMessage.cpp.
References CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, findEntry(), INTID, stricmp, and TIMEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsBool(), and UnitTest().
| 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 |
Definition at line 1591 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Float64(), and getAsString().
| float64 cmlabs::DataMessage::getAsFloat | ( | const char * | key | ) |
returns the user entry as a float regardless of what type it is
| key |
Definition at line 1567 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Float64(), and getAsString().
Referenced by cmlabs::ExtractFloatFromMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsFloat_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsFloat_1_1SWIG_11(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsFloat_1_1SWIG_12().
| float64 cmlabs::DataMessage::getAsFloat | ( | int64 | i, |
| const char * | key ) |
getAsFloat(int64 i, const char* key)
| i | |
| key |
Definition at line 1579 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Float64(), and getAsString().
| std::map< int64, float64 > cmlabs::DataMessage::getAsFloatArray | ( | const char * | key | ) |
getAsFloatArray(const char* key)
| key |
Definition at line 2424 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Float64(), cmlabs::utils::Ascii2Int64(), CHARDATAID, CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, INTID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
| 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 |
Definition at line 2843 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Float64(), CHARDATAID, CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, INTID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
| 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 |
Definition at line 1583 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), and getAsString().
| int64 cmlabs::DataMessage::getAsInt | ( | const char * | key | ) |
returns the user entry as an integer regardless of what type it is
| key |
Definition at line 1559 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), and getAsString().
Referenced by cmlabs::ExtractIntFromMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsInt_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsInt_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsInt_1_1SWIG_12(), and UnitTest().
| int64 cmlabs::DataMessage::getAsInt | ( | int64 | i, |
| const char * | key ) |
getAsInt(int64 i, const char* key)
| i | |
| key |
Definition at line 1571 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), and getAsString().
| std::map< int64, int64 > cmlabs::DataMessage::getAsIntArray | ( | const char * | key | ) |
getAsIntArray(const char* key)
| key |
Definition at line 2377 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CHARDATAID, CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, INTID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
| 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 |
Definition at line 2799 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CHARDATAID, CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, INTID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
| 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 |
Definition at line 2267 of file DataMessage.cpp.
References getAsString(), and cmlabs::utils::StringFormat().
| std::string cmlabs::DataMessage::getAsString | ( | const char * | key | ) |
returns the user entry as a string regardless of what type it is
| key |
Definition at line 1629 of file DataMessage.cpp.
References CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, data, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, findEntry(), INTID, cmlabs::PrintTimeString(), stricmp, cmlabs::utils::StringFormat(), and TIMEID.
Referenced by cmlabs::ExtractStringFromMessage(), getAsFloat(), getAsFloat(), getAsFloat(), getAsInt(), getAsInt(), getAsInt(), getAsString(), getAsString(), getAsTime(), getAsTime(), getAsTime(), UnitTest(), and cmlabs::TriggerSpec::UnitTest().
| std::string cmlabs::DataMessage::getAsString | ( | int64 | i, |
| const char * | key ) |
getAsString(int64 i, const char* key)
| i | |
| key |
Definition at line 2141 of file DataMessage.cpp.
References getAsString(), and cmlabs::utils::StringFormat().
| std::map< int64, std::string > cmlabs::DataMessage::getAsStringArray | ( | const char * | key | ) |
getAsStringArray(const char* key)
| key |
Definition at line 2471 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CHARDATAID, CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, INTID, cmlabs::PrintTimeString(), cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
Referenced by UnitTest().
| 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 |
Definition at line 2887 of file DataMessage.cpp.
References CHARDATAID, CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, INTID, cmlabs::PrintTimeString(), cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
Referenced by UnitTest().
| 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 |
Definition at line 1587 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Uint64(), and getAsString().
| uint64 cmlabs::DataMessage::getAsTime | ( | const char * | key | ) |
returns the user entry as a time regardless of what type it is
| key |
Definition at line 1563 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Uint64(), and getAsString().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsTime_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsTime_1_1SWIG_11(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAsTime_1_1SWIG_12().
| uint64 cmlabs::DataMessage::getAsTime | ( | int64 | i, |
| const char * | key ) |
getAsTime(int64 i, const char* key)
| i | |
| key |
Definition at line 1575 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Uint64(), and getAsString().
| std::map< int64, DataMessage * > cmlabs::DataMessage::getAttachedMessageArray | ( | const char * | key | ) |
getAttachedMessageArray(const char* key)
| key |
Definition at line 2623 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CONSTCHARID, data, DataMessage(), DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
| 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 |
Definition at line 2311 of file DataMessage.cpp.
References DataMessage(), getAttachedMessageCopy(), and cmlabs::utils::StringFormat().
| DataMessage * cmlabs::DataMessage::getAttachedMessageCopy | ( | const char * | key | ) |
getAttachedMessageCopy(const char* key)
returns a copy of the user message entry with this key
| key |
Definition at line 1755 of file DataMessage.cpp.
References DataMessage(), and getAttachedMessageCopy().
Referenced by _wrap_DataMessage_getAttachedMessageCopy__SWIG_0(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_0(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_1(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_1(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_2(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_2(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_3(), _wrap_DataMessage_getAttachedMessageCopy__SWIG_3(), getAttachedMessageCopy(), getAttachedMessageCopy(), getAttachedMessageCopy(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAttachedMessageCopy_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAttachedMessageCopy_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAttachedMessageCopy_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getAttachedMessageCopy_1_1SWIG_13(), and UnitTest().
| 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 |
Definition at line 1903 of file DataMessage.cpp.
References DataMessage(), DATAMESSAGEID, and findEntry().
| DataMessage * cmlabs::DataMessage::getAttachedMessageCopy | ( | int64 | i, |
| const char * | key ) |
getAttachedMessageCopy(int64 i, const char* key)
| i | |
| key |
Definition at line 2216 of file DataMessage.cpp.
References DataMessage(), getAttachedMessageCopy(), and cmlabs::utils::StringFormat().
| std::map< std::string, DataMessage * > cmlabs::DataMessage::getAttachedMessageMap | ( | const char * | key | ) |
returns a copy of the user message entry with this key
| key |
Definition at line 3031 of file DataMessage.cpp.
References CONSTCHARID, data, DataMessage(), DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
|
inline |
Get number of messages it took to process the trigger message that caused this message to be posted
Definition at line 2446 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getChainCount(), _wrap_DataMessage_getChainCount(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getChainCount().
|
inline |
Get cpu time in us it took to process the trigger message that caused this message to be posted
Definition at line 2379 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getChainCPUTime(), _wrap_DataMessage_getChainCPUTime(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getChainCPUTime().
|
inline |
Get wall time in us it took to process the trigger message that caused this message to be posted
Definition at line 2413 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getChainWallTime(), _wrap_DataMessage_getChainWallTime(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getChainWallTime().
| 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 |
Definition at line 2259 of file DataMessage.cpp.
References getContentSize(), and cmlabs::utils::StringFormat().
| uint32 cmlabs::DataMessage::getContentSize | ( | const char * | key | ) |
getContentSize(const char* key)
returns the binary size of the content with this key
| key |
Definition at line 1802 of file DataMessage.cpp.
References findEntry().
Referenced by getContentSize(), getContentSize(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getContentSize_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getContentSize_1_1SWIG_11(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getContentSize_1_1SWIG_12().
| uint32 cmlabs::DataMessage::getContentSize | ( | int64 | i, |
| const char * | key ) |
getContentSize(int64 i, const char* key)
| i | |
| key |
Definition at line 2133 of file DataMessage.cpp.
References getContentSize(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 2251 of file DataMessage.cpp.
References getContentType(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 1796 of file DataMessage.cpp.
References findEntry().
Referenced by cmlabs::ExtractFloatFromMessage(), cmlabs::ExtractIntFromMessage(), cmlabs::ExtractStringFromMessage(), cmlabs::ExtractTimeFromMessage(), getContentType(), getContentType(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getContentType_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getContentType_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getContentType_1_1SWIG_12(), and UnitTest().
| uint32 cmlabs::DataMessage::getContentType | ( | int64 | i, |
| const char * | key ) |
getContentType(int64 i, const char* key)
| i | |
| key |
Definition at line 2125 of file DataMessage.cpp.
References getContentType(), and cmlabs::utils::StringFormat().
|
inline |
Get and return context change entry
Definition at line 1948 of file DataMessage.h.
References data, DATAMESSAGEID, and NOCONTEXT.
Referenced by cmlabs::Internal_Print().
|
inline |
Get and return time message was created
Definition at line 2192 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getCreatedTime(), _wrap_DataMessage_getCreatedTime(), cmlabs::MessageIndex::addMessage(), cmlabs::MessagePlayer::addMessage(), cmlabs::GenericObservation< T >::extractDataFromMessage(), cmlabs::Internal_Ping(), cmlabs::Internal_Print(), cmlabs::Internal_SignalPing(), cmlabs::Internal_SignalPong(), cmlabs::Internal_StatsLog(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getCreatedTime(), cmlabs::ProcessMemory::PerfTest(), cmlabs::ProcessMemory::UnitTest(), and cmlabs::PsySpace::waitForSignal().
|
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() |
Definition at line 827 of file DataMessage.cpp.
References stricmp, cmlabs::utils::StringFormat(), and cmlabs::utils::StringSingleReplace().
Referenced by _wrap_DataMessage_GetCSVHeader__SWIG_0(), _wrap_DataMessage_GetCSVHeader__SWIG_0(), _wrap_DataMessage_GetCSVHeader__SWIG_1(), _wrap_DataMessage_GetCSVHeader__SWIG_1(), _wrap_DataMessage_GetCSVHeader__SWIG_2(), _wrap_DataMessage_GetCSVHeader__SWIG_2(), cmlabs::MessagePlayer::exportToCSV(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1GetCSVHeader_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1GetCSVHeader_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1GetCSVHeader_1_1SWIG_12(), and UnitTest().
|
inline |
Get cpu time in us it took to process the trigger message that caused this message to be posted
Definition at line 2310 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getCycleCPUTime(), _wrap_DataMessage_getCycleCPUTime(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getCycleCPUTime().
|
inline |
Get wall time in us it took to process the trigger message that caused this message to be posted
Definition at line 2344 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getCycleWallTime(), _wrap_DataMessage_getCycleWallTime(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getCycleWallTime().
| 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 |
Definition at line 2303 of file DataMessage.cpp.
References getData(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 1745 of file DataMessage.cpp.
References getData().
Referenced by cmlabs::RESTParser::extractArrayParameters(), cmlabs::RESTParser::extractParameters(), getData(), getData(), getData(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getData_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getData_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getData_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getData_1_1SWIG_13(), cmlabs::GenericObservation< T >::ReadAllFromMessage(), cmlabs::GenericObservation< T >::readFromMessage(), cmlabs::RequestGateway::replyToClient(), cmlabs::PsyAPI::retrieve(), cmlabs::RESTParser::setParameterValue(), UnitTest(), cmlabs::PsyAPI::waitForNewMessage(), and cmlabs::GenericObservation< T >::writeToMessage().
| 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 |
Definition at line 1873 of file DataMessage.cpp.
References CHARDATAID, and findEntry().
| const char * cmlabs::DataMessage::getData | ( | int64 | i, |
| const char * | key, | ||
| uint32 & | size ) |
getData(int64 i, const char* key, uint32& size)
| i | |
| key | |
| size |
Definition at line 2208 of file DataMessage.cpp.
References getData(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 2307 of file DataMessage.cpp.
References getDataCopy(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 1750 of file DataMessage.cpp.
References getDataCopy().
Referenced by cmlabs::Bitmap::Bitmap(), getDataCopy(), getDataCopy(), getDataCopy(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDataCopy_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDataCopy_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDataCopy_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDataCopy_1_1SWIG_13(), cmlabs::PsyAPI::queryCatalog(), and UnitTest().
| 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 |
Definition at line 1887 of file DataMessage.cpp.
References CHARDATAID, data, and findEntry().
| char * cmlabs::DataMessage::getDataCopy | ( | int64 | i, |
| const char * | key, | ||
| uint32 & | size ) |
getDataCopy(int64 i, const char* key, uint32& size)
| i | |
| key | |
| size |
Definition at line 2212 of file DataMessage.cpp.
References getDataCopy(), and cmlabs::utils::StringFormat().
|
inline |
getDestination() Get the NodeID of the destination node
Definition at line 1705 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getDestination(), _wrap_DataMessage_getDestination(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDestination().
| 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 |
Definition at line 2197 of file DataMessage.cpp.
References getDouble().
| 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 |
Definition at line 2295 of file DataMessage.cpp.
References getDouble(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 2283 of file DataMessage.cpp.
References getDouble(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 1863 of file DataMessage.cpp.
References getDouble().
| 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 | entry key |
| success | set to true if the entry was found |
Definition at line 1839 of file DataMessage.cpp.
References DOUBLEID, and findEntry().
| 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 |
Definition at line 1733 of file DataMessage.cpp.
References getDouble().
Referenced by getDouble(), getDouble(), getDouble(), getDouble(), getDouble(), getDouble(), getDouble(), getDouble(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_13(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_14(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_15(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_16(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_17(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getDouble_1_1SWIG_18(), UnitTest(), and cmlabs::TriggerSpec::UnitTest().
| double cmlabs::DataMessage::getDouble | ( | int64 | i, |
| const char * | key ) |
getDouble(int64 i, const char* key)
| i | |
| key |
Definition at line 2182 of file DataMessage.cpp.
References getDouble().
| double cmlabs::DataMessage::getDouble | ( | int64 | i, |
| const char * | key, | ||
| bool & | success ) |
getDouble(int64 i, const char* key, bool& success)
| i | |
| key | |
| success |
Definition at line 2169 of file DataMessage.cpp.
References getDouble(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::getDouble | ( | int64 | i, |
| const char * | key, | ||
| double & | value ) |
getDouble(int64 i, const char* key, double& value)
| i | |
| key | |
| value |
Definition at line 2157 of file DataMessage.cpp.
References getDouble(), and cmlabs::utils::StringFormat().
| std::map< int64, double > cmlabs::DataMessage::getDoubleArray | ( | const char * | key | ) |
getDoubleArray(const char* key)
| key |
Definition at line 2571 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
Referenced by UnitTest().
| std::map< std::string, double > cmlabs::DataMessage::getDoubleMap | ( | const char * | key | ) |
returns the user double entry with this key
| key |
Definition at line 2981 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
|
inline |
Get End of life of message
Definition at line 2002 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getEOL(), _wrap_DataMessage_getEOL(), cmlabs::MessageIndex::addMessage(), cmlabs::TemporalMemory::insertMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getEOL(), cmlabs::PsySpace::postMessage(), and cmlabs::PsySpace::queryReply().
| 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 |
Definition at line 2202 of file DataMessage.cpp.
References getFloat().
| 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 |
Definition at line 2299 of file DataMessage.cpp.
References getFloat(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 2287 of file DataMessage.cpp.
References getFloat(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 1868 of file DataMessage.cpp.
References getFloat().
| 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 | entry key |
| success | set to true if the entry was found |
Definition at line 1851 of file DataMessage.cpp.
References DOUBLEID, and findEntry().
| 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 |
Definition at line 1739 of file DataMessage.cpp.
References getFloat().
Referenced by cmlabs::GenericObservation< T >::extractDataFromMessage(), cmlabs::ExtractFloatFromMessage(), cmlabs::ObsDimension::extractRangeFrom(), cmlabs::ObsFloat::extractRangeFrom(), cmlabs::ObsLocation::extractRangeFrom(), cmlabs::ObsDimension::extractRangeTo(), cmlabs::ObsFloat::extractRangeTo(), cmlabs::ObsLocation::extractRangeTo(), getFloat(), getFloat(), getFloat(), getFloat(), getFloat(), getFloat(), getFloat(), getFloat(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_13(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_14(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_15(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_16(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_17(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFloat_1_1SWIG_18(), and UnitTest().
| float64 cmlabs::DataMessage::getFloat | ( | int64 | i, |
| const char * | key ) |
getFloat(int64 i, const char* key)
| i | |
| key |
Definition at line 2187 of file DataMessage.cpp.
References getFloat().
| float64 cmlabs::DataMessage::getFloat | ( | int64 | i, |
| const char * | key, | ||
| bool & | success ) |
getFloat(int64 i, const char* key, bool& success)
| i | |
| key | |
| success |
Definition at line 2173 of file DataMessage.cpp.
References getFloat(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::getFloat | ( | int64 | i, |
| const char * | key, | ||
| float64 & | value ) |
getFloat(int64 i, const char* key, float64& value)
| i | |
| key | |
| value |
Definition at line 2161 of file DataMessage.cpp.
References getFloat(), and cmlabs::utils::StringFormat().
| std::map< int64, float64 > cmlabs::DataMessage::getFloatArray | ( | const char * | key | ) |
getFloatArray(const char* key)
| key |
Definition at line 2597 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
| std::map< std::string, float64 > cmlabs::DataMessage::getFloatMap | ( | const char * | key | ) |
returns the user float entry with this key
| key |
Definition at line 3006 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, DOUBLEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
|
inline |
getFrom() Get the sender id
Definition at line 1857 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getFrom(), _wrap_DataMessage_getFrom(), cmlabs::Internal_Print(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getFrom(), cmlabs::PsySpace::postMessage(), cmlabs::PsySpace::query(), cmlabs::MemoryRequestServer::UnitTest(), and cmlabs::NetworkManager::UnitTest().
| 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 |
Definition at line 2192 of file DataMessage.cpp.
References getInt().
| 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 |
Definition at line 2291 of file DataMessage.cpp.
References getInt(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 2279 of file DataMessage.cpp.
References getInt(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 1834 of file DataMessage.cpp.
References getInt().
| 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 | entry key |
| success | set to true if the entry was found |
Definition at line 1822 of file DataMessage.cpp.
References findEntry(), and INTID.
| 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 |
Definition at line 1727 of file DataMessage.cpp.
References getInt().
Referenced by cmlabs::Bitmap::Bitmap(), cmlabs::GenericObservation< T >::extractDataFromMessage(), cmlabs::ExtractIntFromMessage(), cmlabs::ObsInteger::extractRangeFrom(), cmlabs::ObsInteger::extractRangeTo(), cmlabs::ExtractTimeFromMessage(), getInt(), getInt(), getInt(), getInt(), getInt(), getInt(), getInt(), getInt(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_13(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_14(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_15(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_16(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_17(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getInt_1_1SWIG_18(), cmlabs::RESTParser::parseRequest(), cmlabs::RequestGateway::receiveMessage(), cmlabs::RequestGateway::replyToClient(), cmlabs::RESTRequest::RESTRequest(), cmlabs::PsyAPI::retrieve(), cmlabs::ComponentMemory::syncComponents(), cmlabs::DataMapsMemory::syncContextLevels(), cmlabs::DataMapsMemory::syncCranks(), cmlabs::DataMapsMemory::syncTags(), cmlabs::DataMapsMemory::syncTypeLevels(), cmlabs::ComponentMemory::UnitTest(), UnitTest(), cmlabs::MemoryManager::UnitTest(), cmlabs::MessageIndex::UnitTest(), and cmlabs::TriggerSpec::UnitTest().
| int64 cmlabs::DataMessage::getInt | ( | int64 | i, |
| const char * | key ) |
getInt(int64 i, const char* key)
| i | |
| key |
Definition at line 2177 of file DataMessage.cpp.
References getInt().
| int64 cmlabs::DataMessage::getInt | ( | int64 | i, |
| const char * | key, | ||
| bool & | success ) |
getInt(int64 i, const char* key, bool& success)
| i | |
| key | |
| success |
Definition at line 2165 of file DataMessage.cpp.
References getInt(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::getInt | ( | int64 | i, |
| const char * | key, | ||
| int64 & | value ) |
getInt(int64 i, const char* key, int64& value)
| i | |
| key | |
| value |
Definition at line 2153 of file DataMessage.cpp.
References getInt(), and cmlabs::utils::StringFormat().
| std::map< int64, int64 > cmlabs::DataMessage::getIntArray | ( | const char * | key | ) |
| key |
Definition at line 2545 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CONSTCHARID, data, DATAMESSAGEID, INTID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
Referenced by UnitTest().
| std::map< std::string, int64 > cmlabs::DataMessage::getIntMap | ( | const char * | key | ) |
returns the user integer entry with this key
| key |
Definition at line 2956 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, INTID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
Referenced by UnitTest().
| DataMessage::KeyType cmlabs::DataMessage::getKeyType | ( | const char * | key | ) |
Return if the key points to a SINGLE, ARRAY or MAP value
| key |
Definition at line 2052 of file DataMessage.cpp.
References ARRAY, CONSTCHARID, data, DATAMESSAGEID, MAP, NONE, SINGLE, cmlabs::DataMessageEntryHeader::size, stricmp, cmlabs::utils::StringFormat(), cmlabs::utils::TextEndsWith(), and cmlabs::utils::TextStartsWith().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getKeyType(), and UnitTest().
| uint32 cmlabs::DataMessage::getMapCount | ( | const char * | key | ) |
getMapCount(const char* key) Returns the number of elements in map with name '<key>'
| key | entry key |
Definition at line 2764 of file DataMessage.cpp.
References getMapSize().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getMapCount().
| uint32 cmlabs::DataMessage::getMapSize | ( | const char * | key | ) |
getMapSize(const char* key) Returns the number of elements in map with name '<key>'
| key | entry key |
Definition at line 2742 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
Referenced by getMapCount(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getMapSize(), and UnitTest().
|
inline |
getMemID() Get and return memory ID
Definition at line 1836 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getMemID(), _wrap_DataMessage_getMemID(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getMemID().
|
inline |
getOrigin() Get the NodeID of the node the message originated on
Definition at line 1696 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getOrigin(), _wrap_DataMessage_getOrigin(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getOrigin().
|
inline |
Gets the policy id of the message
Definition at line 2098 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getPolicy(), _wrap_DataMessage_getPolicy(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getPolicy().
|
inline |
Get message priority Messages have a prority that determines their relative order of scheduling, both in the whiteboards and in the modules.
Definition at line 2063 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getPriority(), _wrap_DataMessage_getPriority(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getPriority().
|
inline |
getRawData() Retrieve a pointer to the raw binary block of the message (header + entries).
The block is data->size bytes long and remains owned by the message; it can be memcpy'd elsewhere to clone or transmit the message verbatim.
Definition at line 1686 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getRawData(), _wrap_DataMessage_getRawData(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getRawData(), and UnitTest().
|
inline |
Get and return time message was received
Definition at line 2160 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getRecvTime(), _wrap_DataMessage_getRecvTime(), cmlabs::Internal_StatsLog(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getRecvTime(), and cmlabs::TestRequestExecutor::longRequestRun().
|
inline |
getReference() Get and return message reference id
Definition at line 1795 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getReference(), _wrap_DataMessage_getReference(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getReference(), cmlabs::TestRequestExecutor::longRequestRun(), cmlabs::RequestClient::receiveMessage(), cmlabs::RequestExecutor::receiveMessage(), cmlabs::RequestGateway::receiveMessage(), cmlabs::RequestGateway::replyToClient(), cmlabs::RequestExecutor::replyToGateway(), cmlabs::RequestExecutor::replyToQuery(), cmlabs::TestRequestExecutor::shortRequestRun(), cmlabs::MemoryRequestServer::UnitTest(), cmlabs::MemoryRequestConnection::waitForRequest(), cmlabs::MemoryRequestConnection::waitForRequestReply(), and cmlabs::MemoryRequestConnection::waitForRequestReply().
|
inline |
Get time message was sent
Definition at line 2129 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getSendTime(), _wrap_DataMessage_getSendTime(), cmlabs::Internal_StatsLog(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getSendTime().
|
inline |
Get message serial number
Definition at line 2253 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getSerial(), _wrap_DataMessage_getSerial(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getSerial(), and cmlabs::TemporalMemory::UnitTest().
|
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
Definition at line 1738 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getSize(), _wrap_DataMessage_getSize(), cmlabs::ComponentData::AddComponentStats(), cmlabs::ComponentMemory::addComponentStats(), cmlabs::RequestClient::addGateway(), cmlabs::RequestExecutor::addGateway(), cmlabs::MessagePlayer::addMessage(), cmlabs::RequestGateway::addRequestReplyToRequestQueue(), cmlabs::ProcessMemory::addToProcessStats(), cmlabs::MemoryRequestQueues::AddToQueue(), cmlabs::MemoryRequestQueues::GetNextQueueMessage(), cmlabs::TemporalMemory::insertMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getSize(), cmlabs::RequestExecutor::receiveMessage(), cmlabs::RequestGateway::replyToClient(), cmlabs::PsyAPI::retrieve(), cmlabs::MessageProtocol::SendMessage(), cmlabs::ComponentMemory::UnitTest(), UnitTest(), cmlabs::MemoryManager::UnitTest(), cmlabs::MessageIndex::UnitTest(), cmlabs::TemporalMemory::UnitTest(), and cmlabs::NetworkManager::UnitTestDelayedConnect().
|
inline |
Get current message status
Definition at line 2223 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getStatus(), _wrap_DataMessage_getStatus(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getStatus(), cmlabs::RequestClient::receiveMessage(), and cmlabs::Test_RequestClient().
| 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 |
Definition at line 2271 of file DataMessage.cpp.
References getString(), and cmlabs::utils::StringFormat().
| 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 |
Definition at line 2275 of file DataMessage.cpp.
References getString(), and cmlabs::utils::StringFormat().
| const char * cmlabs::DataMessage::getString | ( | const char * | key | ) |
returns the user string entry with this key
| key |
Definition at line 1712 of file DataMessage.cpp.
References getString().
Referenced by cmlabs::RequestGateway::addRequestReplyToRequestQueue(), cmlabs::RESTParser::extractArrayParameters(), cmlabs::RESTParser::extractParameters(), cmlabs::ObsString::extractRangeFrom(), cmlabs::ObsString::extractRangeTo(), cmlabs::ExtractStringFromMessage(), getString(), getString(), getString(), getString(), getString(), getString(), cmlabs::Internal_MessageToggler(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_13(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_14(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_15(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_16(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getString_1_1SWIG_17(), cmlabs::RESTParser::parseRequest(), cmlabs::RequestExecutor::receiveMessage(), cmlabs::RequestGateway::receiveMessage(), cmlabs::RequestGateway::replyToClient(), cmlabs::RESTRequest::RESTRequest(), cmlabs::RequestClient::SendRequestAndWaitForJSON(), cmlabs::RESTParser::setParameterValue(), cmlabs::ComponentMemory::syncComponents(), cmlabs::DataMapsMemory::syncContextLevels(), cmlabs::DataMapsMemory::syncCranks(), cmlabs::DataMapsMemory::syncTags(), cmlabs::DataMapsMemory::syncTypeLevels(), cmlabs::Test_RequestClient(), UnitTest(), and cmlabs::ProcessMemory::UnitTest().
| 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 |
Definition at line 1766 of file DataMessage.cpp.
References CONSTCHARID, and findEntry().
| 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 |
Definition at line 1717 of file DataMessage.cpp.
References getString().
| 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 |
Definition at line 1780 of file DataMessage.cpp.
References CONSTCHARID, and findEntry().
| const char * cmlabs::DataMessage::getString | ( | int64 | i, |
| const char * | key ) |
getString(int64 i, const char* key)
| i | |
| key |
Definition at line 2145 of file DataMessage.cpp.
References getString(), and cmlabs::utils::StringFormat().
| const char * cmlabs::DataMessage::getString | ( | int64 | i, |
| const char * | key, | ||
| uint32 & | size ) |
getString(int64 i, const char* key, uint32 &size)
| i | |
| key | |
| size |
Definition at line 2149 of file DataMessage.cpp.
References getString(), and cmlabs::utils::StringFormat().
| std::map< int64, std::string > cmlabs::DataMessage::getStringArray | ( | const char * | key | ) |
getStringArray(const char* key)
| key |
Definition at line 2518 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
Referenced by cmlabs::MessagePlayer::setSystemIDs().
| std::map< std::string, std::string > cmlabs::DataMessage::getStringMap | ( | const char * | key | ) |
returns the user string entry with this key
| key |
Definition at line 2931 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().
|
inline |
getSystemID() Get and return message system id
Definition at line 1816 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getSystemID(), _wrap_DataMessage_getSystemID(), cmlabs::GenericObservation< T >::extractDataFromMessage(), cmlabs::RequestReply::giveRequestMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getSystemID(), and cmlabs::RequestReply::setRequestMessageCopy().
|
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.
Definition at line 1770 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getTag(), _wrap_DataMessage_getTag(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTag(), and cmlabs::PsyAPI::postOutputMessage().
| 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 |
Definition at line 2263 of file DataMessage.cpp.
References getTime(), and cmlabs::utils::StringFormat().
| uint64 cmlabs::DataMessage::getTime | ( | const char * | key | ) |
returns the user time entry with this key
| key |
Definition at line 1722 of file DataMessage.cpp.
References getTime().
Referenced by cmlabs::ObsTime::extractRangeFrom(), cmlabs::ObsTime::extractRangeTo(), cmlabs::ExtractTimeFromMessage(), getTime(), getTime(), getTime(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTime_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTime_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTime_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTime_1_1SWIG_13(), cmlabs::RequestGateway::replyToClient(), cmlabs::RESTRequest::RESTRequest(), cmlabs::ComponentMemory::syncComponents(), cmlabs::DataMapsMemory::syncContextLevels(), cmlabs::DataMapsMemory::syncCranks(), cmlabs::DataMapsMemory::syncTags(), cmlabs::DataMapsMemory::syncTypeLevels(), UnitTest(), and cmlabs::ProcessMemory::UnitTest().
| 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 |
Definition at line 1809 of file DataMessage.cpp.
References findEntry(), and TIMEID.
| 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 |
Definition at line 2137 of file DataMessage.cpp.
References getTime(), and cmlabs::utils::StringFormat().
| std::map< int64, uint64 > cmlabs::DataMessage::getTimeArray | ( | const char * | key | ) |
Definition at line 2351 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
Referenced by UnitTest().
| std::map< std::string, uint64 > cmlabs::DataMessage::getTimeMap | ( | const char * | key | ) |
returns the user time entry with this key
| key |
Definition at line 2774 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextStartsWith(), and TIMEID.
Referenced by UnitTest().
|
inline |
Set the receiver id
Definition at line 1887 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getTo(), _wrap_DataMessage_getTo(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTo(), cmlabs::MemoryRequestConnection::makeRequest(), cmlabs::PsyAPI::postOutputMessage(), cmlabs::PsySpace::query(), and cmlabs::MemoryRequestConnection::replyToRequest().
|
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.
Definition at line 1987 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by _wrap_DataMessage_getTTL(), _wrap_DataMessage_getTTL(), cmlabs::MessageIndex::addMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getTTL(), and cmlabs::PsyAPI::postOutputMessage().
|
inline |
Get message type
Definition at line 1916 of file DataMessage.h.
References data, DATAMESSAGEID, and NOTYPE.
Referenced by cmlabs::MessageIndex::addMessage(), cmlabs::Internal_Ping(), cmlabs::Internal_Print(), cmlabs::Internal_RetrieveTest(), cmlabs::PsyAPI::postOutputMessage(), and cmlabs::NetworkManager::UnitTest().
|
inline |
Return the number of user entries stored in the message
Definition at line 804 of file DataMessage.h.
References data.
Referenced by _wrap_DataMessage_getUserCount(), _wrap_DataMessage_getUserCount(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getUserCount(), and UnitTest().
| 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 |
Definition at line 392 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, data, DataMessage(), DATAMESSAGEDRAFTID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, getUserEntriesAsJSON(), INTID, cmlabs::PrintTimeString(), cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), swapMessageData(), TIMEID, and toJSON().
Referenced by getUserEntriesAsJSON(), toJSON(), and UnitTest().
| 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
Definition at line 188 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, data, DataMessage(), DATAMESSAGEDRAFTID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, getUserEntriesAsString(), INTID, cmlabs::PrintTimeString(), cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextIndent(), and TIMEID.
Referenced by getUserEntriesAsString(), cmlabs::Internal_Print(), cmlabs::MessagePlayer::printAllString(), toCSV(), and UnitTest().
|
inline |
Return the memory usage in bytes of all user entries stored in the message
Definition at line 795 of file DataMessage.h.
References data.
Referenced by _wrap_DataMessage_getUserSize(), _wrap_DataMessage_getUserSize(), and Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1getUserSize().
| bool cmlabs::DataMessage::hasData | ( | const char * | key | ) |
Check if key variable exists and is a data entry.
| key |
Definition at line 2108 of file DataMessage.cpp.
References CHARDATAID, and findEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasData(), and UnitTest().
| bool cmlabs::DataMessage::hasFloat | ( | const char * | key | ) |
Check if key variable exists and is a float.
| key |
Definition at line 2096 of file DataMessage.cpp.
References DOUBLEID, and findEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasFloat(), and UnitTest().
| bool cmlabs::DataMessage::hasInteger | ( | const char * | key | ) |
Check if key variable exists and is an integer.
| key |
Definition at line 2090 of file DataMessage.cpp.
References findEntry(), and INTID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasInteger(), and UnitTest().
| bool cmlabs::DataMessage::hasKey | ( | const char * | key | ) |
Check if key variable exists.
| key |
Definition at line 2080 of file DataMessage.cpp.
References findEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasKey(), and UnitTest().
| bool cmlabs::DataMessage::hasMessage | ( | const char * | key | ) |
Check if key variable exists and is a message.
| key |
Definition at line 2114 of file DataMessage.cpp.
References DATAMESSAGEID, and findEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasMessage(), and UnitTest().
| bool cmlabs::DataMessage::hasString | ( | const char * | key | ) |
Check if key variable exists and is a string.
| key |
Definition at line 2084 of file DataMessage.cpp.
References CONSTCHARID, and findEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasString(), and UnitTest().
| bool cmlabs::DataMessage::hasTime | ( | const char * | key | ) |
Check if key variable exists and is a time.
| key |
Definition at line 2102 of file DataMessage.cpp.
References findEntry(), and TIMEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1hasTime(), and UnitTest().
|
inline |
Internal: clears the single-entry key-lookup cache.
Must be called after any operation that moves or invalidates entries (reallocation, removal).
Definition at line 2510 of file DataMessage.h.
References _lastFindKey, and _lastFindKeyResult.
Referenced by DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), removeEntry(), setRawData(), and swapMessageData().
| bool cmlabs::DataMessage::isArrayContent | ( | const char * | key | ) |
isArrayContent(const char* key)
Check if key variable is an array or not
| key |
Definition at line 2016 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextEndsWith(), and cmlabs::utils::TextStartsWith().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1isArrayContent(), and UnitTest().
| bool cmlabs::DataMessage::isMapContent | ( | const char * | key | ) |
Check if key variable is a map or not
| key |
Definition at line 2034 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEID, cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), cmlabs::utils::TextEndsWith(), and cmlabs::utils::TextStartsWith().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1isMapContent(), and UnitTest().
| bool cmlabs::DataMessage::isSingleValue | ( | const char * | key | ) |
isSingleValue(const char* key)
Check if key variable is not an array nor a map
| key |
Definition at line 2121 of file DataMessage.cpp.
References findEntry().
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1isSingleValue(), and UnitTest().
|
inline |
isValid() Checks that the message memory block exists and carries the current-format object id (DATAMESSAGEID).
All accessors call the equivalent check and return defaults (0, NULL, false) on an invalid message rather than crashing.
Definition at line 405 of file DataMessage.h.
References data, DATAMESSAGEID, and GetObjID.
Referenced by _wrap_DataMessage_isValid(), _wrap_DataMessage_isValid(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1isValid(), setAttachedMessage(), UnitTest(), and cmlabs::TemporalMemory::UnitTest().
|
inlineprotected |
Internal function: marks the entry as unused (cid = UNUSEDID) and updates userCount/userSize. The slot is not compacted — it remains in the block and may be reused by a later entry of exactly the same size (findSpace()).
| key | entry name |
Definition at line 2578 of file DataMessage.h.
References data, findKey(), invalidateFindKeyCache(), and UNUSEDID.
Referenced by deleteEntry(), setRawData(), and UnitTest().
| 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 |
Definition at line 2340 of file DataMessage.cpp.
References DataMessage(), setAttachedMessage(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setAttachedMessage | ( | const char * | key, |
| DataMessage * | msg ) |
setAttachedMessage(const char* key, DataMessage* msg)
Attaches a full copy of another DataMessage as a user entry named key. The message content is copied; the caller retains ownership of msg. Retrieve it later with getAttachedMessageCopy().
| key | entry name |
| msg | the message to attach (not modified, not taken over) |
Definition at line 1954 of file DataMessage.cpp.
References data, DataMessage(), DATAMESSAGEID, isValid(), setRawData(), and cmlabs::DataMessageHeader::size.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setAttachedMessage_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setAttachedMessage_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setAttachedMessage_1_1SWIG_12(), cmlabs::PsySpace::queryReply(), setAttachedMessage(), setAttachedMessage(), setAttachedMessageArray(), setAttachedMessageMap(), and UnitTest().
| bool cmlabs::DataMessage::setAttachedMessage | ( | int64 | i, |
| const char * | key, | ||
| DataMessage * | msg ) |
setAttachedMessage(int64 i, const char* key, DataMessage* msg)
| i | |
| key | |
| msg |
Definition at line 2245 of file DataMessage.cpp.
References DataMessage(), setAttachedMessage(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setAttachedMessageArray | ( | const char * | key, |
| std::map< int64, DataMessage * > & | map ) |
setAttachedMessageArray(const char* key, std::map<int64, DataMessage*>& map) Sets the whole array of attached messages named key in one call.
Each message is copied in; the caller retains ownership of the originals.
| key | entry name of the array |
| map | index → message values to store |
Definition at line 2699 of file DataMessage.cpp.
References setAttachedMessage().
| 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 |
Definition at line 3106 of file DataMessage.cpp.
References setAttachedMessage().
|
inline |
Set number of messages it took to process the trigger message that caused this message to be posted
| count | number of messages |
Definition at line 2462 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setChainCount().
|
inline |
Set cpu time in us it took to process the trigger message that caused this message to be posted
| t | time in us |
Definition at line 2395 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setChainCPUTime().
|
inline |
Set wall time in us it took to process the trigger message that caused this message to be posted
| t | time in us |
Definition at line 2429 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setChainWallTime().
|
inline |
setContextChange(PsyContext& context)
Set and return context change entry
| context | to change to |
Definition at line 1967 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::PsyAPI::postOutputMessage(), and cmlabs::MessagePlayer::waitForNextMessage().
|
inline |
Set time message was created to t
| t | time message was created |
Definition at line 2208 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::HTTPRequest::convertToMessage(), cmlabs::JSONM::convertToMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setCreatedTime(), cmlabs::Observations_UnitTest(), cmlabs::MessageIndex::UnitTest(), cmlabs::TemporalMemory::UnitTest(), and cmlabs::MessagePlayer::waitForNextMessage().
|
inline |
Set cpu time in us it took to process the trigger message that caused this message to be posted
| t | time in us |
Definition at line 2326 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setCycleCPUTime().
|
inline |
Set wall time in us it took to process the trigger message that caused this message to be posted
| t | time in us |
Definition at line 2360 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setCycleWallTime().
| 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 |
Definition at line 2336 of file DataMessage.cpp.
References setData(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setData | ( | const char * | key, |
| const char * | value, | ||
| uint32 | size ) |
setData(const char* key, const char* value, uint32 size)
Sets (creating or overwriting) a raw binary user entry named key. The bytes are copied into the message; the caller keeps ownership of value.
| key | entry name |
| value | pointer to the bytes to store |
| size | number of bytes to store |
Definition at line 1950 of file DataMessage.cpp.
References CHARDATAID, and setRawData().
Referenced by cmlabs::HTTPRequest::convertToMessage(), cmlabs::JSONM::convertToMessage(), cmlabs::Internal_BitmapPoster(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setData_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setData_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setData_1_1SWIG_12(), cmlabs::PsySpace::logEntry(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryReply(), cmlabs::PsyAPI::retrieve(), cmlabs::TestRequestClient::run(), setData(), setData(), cmlabs::Test_RequestClient(), cmlabs::Bitmap::toMessage(), UnitTest(), cmlabs::MemoryManager::UnitTest(), cmlabs::NetworkManager::UnitTest(), cmlabs::TemporalMemory::UnitTest(), and cmlabs::GenericObservation< T >::writeToMessage().
| 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 |
Definition at line 2241 of file DataMessage.cpp.
References setData(), and cmlabs::utils::StringFormat().
|
inline |
setDestination(uint16 addr) Set destination to address addr and return new destination
| addr | define destination |
Definition at line 1726 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setDestination().
| 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 |
Definition at line 2328 of file DataMessage.cpp.
References setDouble(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setDouble | ( | const char * | key, |
| double | value ) |
setDouble(const char* key, double value)
Sets (creating or overwriting) the user floating-point entry named key.
| key | entry name |
| value | value to store |
Definition at line 1941 of file DataMessage.cpp.
References DOUBLEID, and setRawData().
Referenced by fillInDraftUserDataFrom(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setDouble_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setDouble_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setDouble_1_1SWIG_12(), setDouble(), setDouble(), setDoubleArray(), setDoubleMap(), and UnitTest().
| bool cmlabs::DataMessage::setDouble | ( | int64 | i, |
| const char * | key, | ||
| double | value ) |
setDouble(int64 i, const char* key, double value)
| i | |
| key | |
| value |
Definition at line 2233 of file DataMessage.cpp.
References setDouble(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setDoubleArray | ( | const char * | key, |
| std::map< int64, double > & | map ) |
setDoubleArray(const char* key, std::map<int64, double>& map) Sets the whole double array named key in one call.
| key | entry name of the array |
| map | index → double values to store |
Definition at line 2679 of file DataMessage.cpp.
References setDouble().
Referenced by UnitTest().
| 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 | entry key |
| map | map of values to store |
Definition at line 3086 of file DataMessage.cpp.
References setDouble().
|
inline |
Calculates and sets the equivalent ttl for the message
| eol | the time at which the message is no longer supposed to exist |
Definition at line 2042 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setEOL(), and cmlabs::MemoryManager::UnitTest().
| 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 |
Definition at line 2332 of file DataMessage.cpp.
References setFloat(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setFloat | ( | const char * | key, |
| float64 | value ) |
setFloat(const char* key, float64 value)
Sets (creating or overwriting) the user floating-point entry named key. float64 is a typedef for double, so this is equivalent to setDouble().
| key | entry name |
| value | value to store |
Definition at line 1946 of file DataMessage.cpp.
References DOUBLEID, and setRawData().
Referenced by cmlabs::PostSpec::addContentToMsg(), cmlabs::Internal_MessageScript(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setFloat_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setFloat_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setFloat_1_1SWIG_12(), cmlabs::Observations_UnitTest(), setFloat(), setFloat(), setFloatArray(), setFloatMap(), and UnitTest().
| bool cmlabs::DataMessage::setFloat | ( | int64 | i, |
| const char * | key, | ||
| float64 | value ) |
setFloat(int64 i, const char* key, float64 value)
| i | |
| key | |
| value |
Definition at line 2237 of file DataMessage.cpp.
References setFloat(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setFloatArray | ( | const char * | key, |
| std::map< int64, float64 > & | map ) |
setFloatArray(const char* key, std::map<int64, float64>& map) Sets the whole float array named key in one call.
| key | entry name of the array |
| map | index → float values to store |
Definition at line 2689 of file DataMessage.cpp.
References setFloat().
| 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 | entry key |
| map | map of values to store |
Definition at line 3096 of file DataMessage.cpp.
References setFloat().
|
inline |
Set the sender id
| from |
Definition at line 1873 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setFrom(), cmlabs::MemoryRequestConnection::makeRequest(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryRemoteCatalog(), cmlabs::RequestGateway::replyToClient(), and cmlabs::MemoryRequestConnection::replyToRequest().
| 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 |
Definition at line 2324 of file DataMessage.cpp.
References setInt(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setInt | ( | const char * | key, |
| int64 | value ) |
setInt(const char* key, int64 value)
Sets (creating or overwriting) the user integer entry named key.
| key | entry name |
| value | integer value to store |
Definition at line 1937 of file DataMessage.cpp.
References INTID, and setRawData().
Referenced by cmlabs::PostSpec::addContentToMsg(), cmlabs::HTTPRequest::convertToMessage(), cmlabs::RequestClient::CreateRequestMessage(), fillInDraftUserDataFrom(), cmlabs::RESTRequest::getStorageMessageCopy(), cmlabs::Internal_BitmapPoster(), cmlabs::Internal_MessageScript(), cmlabs::Internal_RetrieveTest(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setInt_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setInt_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setInt_1_1SWIG_12(), cmlabs::Observations_UnitTest(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryRemoteCatalog(), cmlabs::PsyAPI::queryReply(), cmlabs::RequestGateway::receiveWebsocketData(), cmlabs::RequestExecutor::sendStatusNow(), setInt(), setInt(), setIntArray(), setIntMap(), cmlabs::Bitmap::toMessage(), cmlabs::ComponentMemory::UnitTest(), UnitTest(), cmlabs::MemoryManager::UnitTest(), cmlabs::MessageIndex::UnitTest(), cmlabs::RESTParser::UnitTest(), cmlabs::ComponentInfoStruct::writeToMsg(), cmlabs::ContextMapEntry::writeToMsg(), cmlabs::CrankMapEntry::writeToMsg(), cmlabs::TagMapEntry::writeToMsg(), and cmlabs::TypeMapEntry::writeToMsg().
| bool cmlabs::DataMessage::setInt | ( | int64 | i, |
| const char * | key, | ||
| int64 | value ) |
setInt(int64 i, const char* key, int64 value)
| i | |
| key | |
| value |
Definition at line 2229 of file DataMessage.cpp.
References setInt(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setIntArray | ( | const char * | key, |
| std::map< int64, int64 > & | map ) |
setIntArray(const char* key, std::map<int64, int64>& map) Sets the whole integer array named key in one call.
| key | entry name of the array |
| map | index → integer values to store |
Definition at line 2669 of file DataMessage.cpp.
References setInt().
Referenced by UnitTest().
| bool cmlabs::DataMessage::setIntMap | ( | const char * | key, |
| std::map< std::string, int64 > & | map ) |
sets the user integer entry with this key
| key | |
| map |
Definition at line 3076 of file DataMessage.cpp.
References setInt().
Referenced by UnitTest().
|
inline |
setMemID(uint64 id) Set memory ID to id
| id | memory id |
Definition at line 1847 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setMemID().
|
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 |
Definition at line 1753 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setMultiple(), and cmlabs::PsyAPI::postOutputMessage().
|
inline |
setOrigin(uint16 addr) Set origin to address addr and return new origin
| addr | define origin |
Definition at line 1715 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setOrigin().
|
inline |
Sets the policy id of the message
| policy |
Definition at line 2114 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setPolicy().
|
inline |
Set message priority to priority Messages have a prority that determines their relative order of scheduling
| priority |
Definition at line 2082 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setPriority().
|
protected |
Internal: low-level entry writer used by all typed set...() overloads.
| key | entry name |
| value | payload bytes to copy in |
| size | payload size in bytes |
| datatype | content type id for the entry (see ObjectIDs.h) |
Definition at line 1960 of file DataMessage.cpp.
References CONSTCHARID, data, findEntry(), findSpace(), invalidateFindKeyCache(), removeEntry(), and cmlabs::utils::strcpyavail().
Referenced by copyUserEntriesFromMessage(), fillInDraftUserDataFrom(), setAttachedMessage(), setData(), setDouble(), setFloat(), setInt(), setString(), and setTime().
|
inline |
Set new receiving time time
| time | receiving time |
Definition at line 2176 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::HTTPRequest::convertToMessage(), cmlabs::JSONM::convertToMessage(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setRecvTime(), cmlabs::TestRequestExecutor::longRequestRun(), and cmlabs::RequestGateway::receiveMessage().
|
inline |
setReference(uint64 ref) Set message reference
| ref | reference |
Definition at line 1805 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::RequestGateway::addRequestReplyToRequestQueue(), cmlabs::RequestGateway::addToRequestQueue(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setReference(), cmlabs::TestRequestExecutor::longRequestRun(), cmlabs::MemoryRequestConnection::makeRequest(), cmlabs::RequestClient::postRequest(), cmlabs::PsySpace::query(), cmlabs::PsySpace::queryReply(), cmlabs::RequestExecutor::receiveMessage(), cmlabs::RequestGateway::replyToClient(), cmlabs::RequestExecutor::replyToGateway(), cmlabs::MemoryRequestConnection::replyToRequest(), cmlabs::RequestGateway::runExec(), and cmlabs::TestRequestExecutor::shortRequestRun().
|
inline |
Set message sendtime to time
| time | Sendtime |
Definition at line 2145 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setSendTime(), cmlabs::RequestExecutor::waitForLongRequest(), and cmlabs::RequestExecutor::waitForShortRequest().
|
inline |
Set message serial number
| serial |
Definition at line 2269 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::Internal_BitmapPoster(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setSerial(), and cmlabs::TemporalMemory::UnitTest().
|
inline |
Set message status
| status | message status |
Definition at line 2239 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setStatus(), cmlabs::PsySpace::queryReply(), cmlabs::RequestGateway::replyToClient(), and cmlabs::Test_RequestClient().
| 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 |
Definition at line 2320 of file DataMessage.cpp.
References setString(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setString | ( | const char * | key, |
| const char * | value ) |
setString(const char* key, const char* value)
Sets (creating or overwriting) the user string entry named key. The string is copied into the message; the caller keeps ownership of value.
| key | entry name |
| value | NUL-terminated string to store |
Definition at line 1927 of file DataMessage.cpp.
References CONSTCHARID, and setRawData().
Referenced by cmlabs::PostSpec::addContentToMsg(), cmlabs::RequestClient::addGateway(), cmlabs::RequestExecutor::addGateway(), cmlabs::PsySpace::addPsyProbeCustomView(), cmlabs::RequestGateway::addRequestReplyToRequestQueue(), cmlabs::PsyAPI::addSubscription(), cmlabs::RequestGateway::addToRequestQueue(), cmlabs::RequestGateway::callExternalAPI(), cmlabs::HTTPRequest::convertToMessage(), cmlabs::JSONM::convertToMessage(), cmlabs::RequestClient::CreateRequestMessage(), fillInDraftUserDataFrom(), cmlabs::RESTRequest::getStorageMessageCopy(), cmlabs::Internal_BitmapPoster(), cmlabs::Internal_MessageScript(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setString_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setString_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setString_1_1SWIG_12(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryRemoteCatalog(), cmlabs::RequestGateway::receiveWebsocketData(), cmlabs::TestRequestClient::run(), cmlabs::RequestGateway::runExec(), cmlabs::RequestGateway::sendRestartToExecutor(), cmlabs::RequestClient::sendStatusNow(), cmlabs::RequestExecutor::sendStatusNow(), setString(), setString(), setStringArray(), setStringMap(), cmlabs::Test_RequestClient(), cmlabs::ComponentMemory::UnitTest(), UnitTest(), cmlabs::ProcessMemory::UnitTest(), cmlabs::RequestGateway::UnitTest(), cmlabs::RESTParser::UnitTest(), cmlabs::NetworkManager::UnitTestDelayedConnect(), cmlabs::ComponentMemory::writeComponentNamesToMsg(), cmlabs::ContextMapEntry::writeIDToMsg(), cmlabs::CrankMapEntry::writeIDToMsg(), cmlabs::TagMapEntry::writeIDToMsg(), cmlabs::TypeMapEntry::writeIDToMsg(), cmlabs::MessagePlayer::writeMetadata(), cmlabs::ComponentInfoStruct::writeToMsg(), cmlabs::ContextMapEntry::writeToMsg(), cmlabs::CrankMapEntry::writeToMsg(), cmlabs::TagMapEntry::writeToMsg(), and cmlabs::TypeMapEntry::writeToMsg().
| bool cmlabs::DataMessage::setString | ( | int64 | i, |
| const char * | key, | ||
| const char * | value ) |
setString(int64 i, const char* key, const char* value)
| i | |
| key | |
| value |
Definition at line 2225 of file DataMessage.cpp.
References setString(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setStringArray | ( | const char * | key, |
| std::map< int64, std::string > & | map ) |
setStringArray(const char* key, std::map<int64, std::string>& map) Sets the whole string array named key in one call.
| key | entry name of the array |
| map | index → string values to store |
Definition at line 2659 of file DataMessage.cpp.
References setString().
Referenced by UnitTest().
| bool cmlabs::DataMessage::setStringMap | ( | const char * | key, |
| std::map< std::string, std::string > & | map ) |
sets the user string entry with this key
| key | |
| map |
Definition at line 3066 of file DataMessage.cpp.
References setString().
Referenced by UnitTest().
|
inline |
setSystemID(uint32 id) Set message system id
| id |
Definition at line 1826 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setSystemID(), and cmlabs::Observations_UnitTest().
|
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 |
Definition at line 1785 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::Internal_QueryTest(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setTag(), cmlabs::PsyAPI::postOutputMessage(), and cmlabs::TimeQueue::waitForNextEvent().
| 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 |
Definition at line 2316 of file DataMessage.cpp.
References setTime(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setTime | ( | const char * | key, |
| uint64 | value ) |
setTime(const char* key, uint64 value)
Sets (creating or overwriting) the user time entry named key. Times are microseconds since epoch (see PsyTime).
| key | entry name |
| value | time value in microseconds |
Definition at line 1933 of file DataMessage.cpp.
References setRawData(), and TIMEID.
Referenced by cmlabs::HTTPRequest::convertToMessage(), fillInDraftUserDataFrom(), cmlabs::RESTRequest::getStorageMessageCopy(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setTime_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setTime_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setTime_1_1SWIG_12(), setTime(), setTime(), setTimeArray(), setTimeMap(), UnitTest(), cmlabs::ProcessMemory::UnitTest(), cmlabs::ComponentInfoStruct::writeToMsg(), cmlabs::ContextMapEntry::writeToMsg(), cmlabs::CrankMapEntry::writeToMsg(), cmlabs::TagMapEntry::writeToMsg(), and cmlabs::TypeMapEntry::writeToMsg().
| bool cmlabs::DataMessage::setTime | ( | int64 | i, |
| const char * | key, | ||
| uint64 | value ) |
setTime(int64 i, const char* key, uint64 value)
| i | |
| key | |
| value |
Definition at line 2221 of file DataMessage.cpp.
References setTime(), and cmlabs::utils::StringFormat().
| bool cmlabs::DataMessage::setTimeArray | ( | const char * | key, |
| std::map< int64, uint64 > & | map ) |
setTimeArray(const char* key, std::map<int64, uint64>& map) Sets the whole time array named key in one call.
| key | entry name of the array |
| map | index → time (microseconds) values to store |
Definition at line 2649 of file DataMessage.cpp.
References setTime().
Referenced by UnitTest().
| bool cmlabs::DataMessage::setTimeMap | ( | const char * | key, |
| std::map< std::string, uint64 > & | map ) |
sets the user time entry with this key
| key | |
| map |
Definition at line 3056 of file DataMessage.cpp.
References setTime().
Referenced by UnitTest().
|
inline |
Get the receiver id
| to |
Definition at line 1902 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setTo(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryRemoteCatalog(), and cmlabs::MemoryRequestServer::UnitTest().
|
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 |
Definition at line 2024 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1setTTL(), cmlabs::PsySpace::queryReply(), cmlabs::MessageIndex::UnitTest(), and cmlabs::TemporalMemory::UnitTest().
|
inline |
Set message type to type
| type | the message type |
Definition at line 1932 of file DataMessage.h.
References data, and DATAMESSAGEID.
Referenced by cmlabs::PsyAPI::emitSignal(), cmlabs::PsyAPI::postOutputMessage(), cmlabs::PsyAPI::postOutputMessage(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryRemoteCatalog(), cmlabs::NetworkManager::UnitTest(), and cmlabs::MessagePlayer::waitForNextMessage().
| const char * cmlabs::DataMessage::swapMessageData | ( | const char * | data | ) |
swapMessageData(const char* data)
Internal function: replaces this message's memory block with data, returning the previous block so the caller can dispose of or reuse it. Used by the runtime to move message ownership without copying.
| data | the new binary message block to adopt |
Definition at line 1549 of file DataMessage.cpp.
References data, and invalidateFindKeyCache().
Referenced by getUserEntriesAsJSON(), Java_com_cmlabs_cmsdk_cmsdkJNI_DataMessage_1swapMessageData(), cmlabs::ComponentStats::toXML(), toXML(), and cmlabs::ProcessStats::toXML().
| 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,... |
| subtypes | optional map of subtype id to name used for textual output |
| subcontexts | optional map of subcontext id to name used for textual output |
| compNames | optional map of component id to name used for textual output Returns the CSV representation of the full message including a textual description of all user entries |
Definition at line 745 of file DataMessage.cpp.
References data, getUserEntriesAsString(), cmlabs::PrintTimeString(), cmlabs::utils::StringFormat(), and cmlabs::utils::StringSingleReplace().
Referenced by cmlabs::MessagePlayer::exportToCSV(), and UnitTest().
| 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
Definition at line 684 of file DataMessage.cpp.
References CONSTCHARID, data, DATAMESSAGEDRAFTID, DATAMESSAGEID, getUserEntriesAsJSON(), cmlabs::PrintTimeString(), cmlabs::DataMessageEntryHeader::size, and cmlabs::utils::StringFormat().
Referenced by getUserEntriesAsJSON(), cmlabs::MessagePlayer::printAllString(), and UnitTest().
| 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 ) |
Returns the XML representation of the full message including all user entries, arrays and maps - and including the XML representation of any attached messages
Definition at line 850 of file DataMessage.cpp.
References cmlabs::utils::Ascii2Int64(), CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, data, DataMessage(), DATAMESSAGEDRAFTID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, INTID, cmlabs::PrintTimeString(), cmlabs::DataMessageEntryHeader::size, cmlabs::utils::StringFormat(), swapMessageData(), TIMEID, and toXML().
Referenced by cmlabs::MessagePlayer::printAllString(), cmlabs::ComponentStats::toXML(), toXML(), cmlabs::ProcessStats::toXML(), and UnitTest().
|
static |
Run the built-in self test for the DataMessage implementation.
Definition at line 3222 of file DataMessage.cpp.
References ARRAY, CHARDATAID, CONSTCHARID, copyUserEntriesFromMessage(), cmlabs::CTRL_TEST, DataMessage(), DATAMESSAGEID, DOUBLEID, cmlabs::unittest::fail(), getArraySize(), getAsBool(), getAsInt(), getAsString(), getAsStringArray(), getAsStringMap(), getAttachedMessageCopy(), getContentType(), GetCSVHeader(), getData(), getDataCopy(), getDouble(), getDoubleArray(), getFloat(), getInt(), getIntArray(), getIntMap(), getKeyType(), getMapSize(), getRawData(), getSize(), getString(), getTime(), getTimeArray(), getTimeMap(), getUserCount(), getUserEntriesAsJSON(), getUserEntriesAsString(), hasData(), hasFloat(), hasInteger(), hasKey(), hasMessage(), hasString(), hasTime(), INTID, isArrayContent(), isMapContent(), isSingleValue(), isValid(), MAP, cmlabs::unittest::progress(), removeEntry(), setAttachedMessage(), setData(), setDouble(), setDoubleArray(), setFloat(), setInt(), setIntArray(), setIntMap(), setString(), setStringArray(), setStringMap(), setTime(), setTimeArray(), setTimeMap(), SINGLE, TIMEID, toCSV(), toJSON(), and toXML().
Referenced by _wrap_DataMessage_UnitTest(), and cmlabs::Register_DataMessage_Tests().
|
mutable |
Internal: last key looked up (single-entry lookup cache; mutable so const-style getters can update it).
Definition at line 2505 of file DataMessage.h.
Referenced by findKey(), and invalidateFindKeyCache().
|
mutable |
Internal: cached location of the last key's entry inside the block; NULL if not found.
Definition at line 2506 of file DataMessage.h.
Referenced by _wrap_DataMessage__lastFindKeyResult_set(), findKey(), and invalidateFindKeyCache().
| DataMessageHeader* cmlabs::DataMessage::data |
Pointer to the message's flat memory block (header + user entries).
This is the actual message: copying these data->size bytes reproduces the message exactly. May be reallocated whenever entries are added or resized, invalidating any pointers previously returned by getString()/getData().
Definition at line 2503 of file DataMessage.h.
Referenced by cmlabs::ComponentData::AddComponentStats(), cmlabs::ComponentMemory::addComponentStats(), cmlabs::RequestClient::addGateway(), cmlabs::RequestExecutor::addGateway(), addTimeUsage(), cmlabs::ProcessMemory::addToProcessStats(), cmlabs::MemoryRequestQueues::AddToQueue(), ConvertDataFromOlderMessageFormat(), copyUserEntriesFromMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), DataMessage(), deleteEntry(), fillInDraftUserDataFrom(), findKey(), findSpace(), getArraySize(), getAsFloatArray(), getAsFloatMap(), getAsIntArray(), getAsIntMap(), getAsString(), getAsStringArray(), getAsStringMap(), getAttachedMessageArray(), getAttachedMessageMap(), getChainCount(), getChainCPUTime(), getChainWallTime(), getContextChange(), getCreatedTime(), getCycleCPUTime(), getCycleWallTime(), getDataCopy(), getDestination(), getDoubleArray(), getDoubleMap(), getEOL(), getFloatArray(), getFloatMap(), getFrom(), getIntArray(), getIntMap(), getKeyType(), getMapSize(), getMemID(), getOrigin(), getPolicy(), getPriority(), getRawData(), getRecvTime(), getReference(), getSendTime(), getSerial(), getSize(), getStatus(), getStringArray(), getStringMap(), getSystemID(), getTag(), getTimeArray(), getTimeMap(), getTo(), getTTL(), getType(), getUserCount(), getUserEntriesAsJSON(), getUserEntriesAsString(), getUserSize(), cmlabs::TemporalMemory::insertMessage(), cmlabs::Internal_StatsLog(), isArrayContent(), isMapContent(), isValid(), cmlabs::PsySpace::postMessage(), removeEntry(), cmlabs::MessageProtocol::SendMessage(), setAttachedMessage(), setChainCount(), setChainCPUTime(), setChainWallTime(), setContextChange(), setCreatedTime(), setCycleCPUTime(), setCycleWallTime(), setDestination(), setEOL(), setFrom(), setMemID(), setMultiple(), setOrigin(), setPolicy(), setPriority(), setRawData(), setRecvTime(), setReference(), setSendTime(), setSerial(), setStatus(), setSystemID(), cmlabs::MessagePlayer::setSystemIDs(), setTag(), setTo(), setTTL(), setType(), swapMessageData(), toCSV(), toJSON(), toXML(), cmlabs::NetworkManager::UnitTestDelayedConnect(), cmlabs::PsyAPI::waitForNewMessage(), cmlabs::PsySpace::waitForSignal(), cmlabs::MessagePlayer::writeMetadata(), and ~DataMessage().