|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
The current (version 10) DataMessage wire/shared-memory header. More...
#include <DataMessage.h>
Public Member Functions | |
| std::string | toJSON (std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL) |
| Render the header fields as a JSON object (header only, no user entries). | |
| std::string | toXML (std::map< uint16, std::string > *subtypes=NULL, std::map< uint16, std::string > *subcontexts=NULL, std::map< uint32, std::string > *compNames=NULL) |
| Render the header fields as an XML fragment (header only, no user entries). | |
Public Attributes | |
| uint32 | size |
| Total size of the whole message block in bytes (header + all entries). | |
| uint32 | cid |
| Object id, always DATAMESSAGEID for a valid current-format message; used by isValid(). | |
| uint16 | cver |
| Message format version (CURRENTDATAMESSAGEVERSION). | |
| uint16 | cenc |
| Encoding flags (reserved for compression/encryption of the payload). | |
| uint64 | memid |
| Shared-memory id assigned when the message is stored in a memory map. | |
| uint64 | time |
| Creation time in microseconds since epoch (see PsyTime). | |
| uint64 | sendtime |
| Time the message was posted/sent, in microseconds. | |
| uint64 | recvtime |
| Time the message was received by the current component, in microseconds. | |
| uint16 | origin |
| NodeID of the node the message originated on. | |
| uint16 | destination |
| NodeID of the target node (0 = local/any). | |
| uint64 | ttl |
| Time-to-live in microseconds; 0 means deliver-and-forget (not retained in memory). | |
| uint16 | priority |
| Scheduling priority; higher values are processed first by whiteboards and modules. | |
| uint8 | policy |
| Delivery policy flags, e.g. | |
| uint32 | from |
| Component id of the sender. | |
| uint32 | to |
| Component id of the addressee; 0 for publish/subscribe distribution. | |
| PsyType | type |
| Hierarchical message type (e.g. | |
| uint32 | tag |
| User tag id for temporal/semantic grouping of related messages. | |
| uint16 | status |
| User/application status code. | |
| uint64 | reference |
| Reference id linking this message to another (e.g. | |
| uint64 | serial |
| Serial number, e.g. | |
| PsyContext | contextchange |
| Context switch this message announces (NOCONTEXT if none). | |
| uint32 | userSize |
| Total size in bytes of all user entries currently in use. | |
| uint32 | userCount |
| Number of user entries currently in use. | |
| uint32 | cyclecputime |
| CPU time spent processing the triggering message in this cycle, in microseconds (profiling). | |
| uint32 | cyclewalltime |
| Wall-clock time spent in this cycle, in microseconds (profiling). | |
| uint32 | chaincputime |
| Accumulated CPU time across the whole causal message chain, in microseconds. | |
| uint32 | chainwalltime |
| Accumulated wall time across the whole causal message chain, in microseconds. | |
| uint32 | chaincount |
| Number of messages in the causal chain leading to (and including) this one. | |
| uint32 | systemid |
| Id of the Psyclone system instance that sent the message. | |
The current (version 10) DataMessage wire/shared-memory header.
This struct is the first thing in every DataMessage memory block; the user entries follow immediately after it. It is written verbatim into shared memory and onto the network, so its size, alignment and field order form a binary contract between all nodes and all recorded data.
Field provenance conventions used in the trailing comments:
Definition at line 188 of file DataMessage.h.
| std::string cmlabs::DataMessageHeader::toJSON | ( | std::map< uint16, std::string > * | subtypes = NULL, |
| std::map< uint16, std::string > * | subcontexts = NULL, | ||
| std::map< uint32, std::string > * | compNames = NULL ) |
Render the header fields as a JSON object (header only, no user entries).
| subtypes | optional map translating type level ids to readable names |
| subcontexts | optional map translating context level ids to readable names |
| compNames | optional map translating component ids to readable names |
Definition at line 53 of file DataMessage.cpp.
References chaincount, chaincputime, chainwalltime, cid, contextchange, cyclecputime, cyclewalltime, DATAMESSAGEID, destination, from, memid, origin, policy, cmlabs::PrintTimeString(), priority, recvtime, reference, sendtime, serial, size, status, cmlabs::utils::StringFormat(), tag, time, to, ttl, type, userCount, and userSize.
| std::string cmlabs::DataMessageHeader::toXML | ( | std::map< uint16, std::string > * | subtypes = NULL, |
| std::map< uint16, std::string > * | subcontexts = NULL, | ||
| std::map< uint32, std::string > * | compNames = NULL ) |
Render the header fields as an XML fragment (header only, no user entries).
| subtypes | optional map translating type level ids to readable names |
| subcontexts | optional map translating context level ids to readable names |
| compNames | optional map translating component ids to readable names |
Definition at line 101 of file DataMessage.cpp.
References chaincount, chaincputime, chainwalltime, cid, contextchange, cyclecputime, cyclewalltime, DATAMESSAGEID, destination, from, memid, origin, policy, cmlabs::PrintTimeString(), priority, recvtime, reference, sendtime, serial, size, status, cmlabs::utils::StringFormat(), tag, time, to, ttl, type, userCount, and userSize.
| uint16 cmlabs::DataMessageHeader::cenc |
Encoding flags (reserved for compression/encryption of the payload).
auto
Definition at line 192 of file DataMessage.h.
| uint32 cmlabs::DataMessageHeader::chaincount |
Number of messages in the causal chain leading to (and including) this one.
Definition at line 221 of file DataMessage.h.
Referenced by toJSON(), toXML(), and cmlabs::PsyAPI::waitForNewMessage().
| uint32 cmlabs::DataMessageHeader::chaincputime |
Accumulated CPU time across the whole causal message chain, in microseconds.
Definition at line 219 of file DataMessage.h.
Referenced by cmlabs::Internal_StatsLog(), toJSON(), toXML(), and cmlabs::PsyAPI::waitForNewMessage().
| uint32 cmlabs::DataMessageHeader::chainwalltime |
Accumulated wall time across the whole causal message chain, in microseconds.
Definition at line 220 of file DataMessage.h.
Referenced by cmlabs::Internal_StatsLog(), toJSON(), toXML(), and cmlabs::PsyAPI::waitForNewMessage().
| uint32 cmlabs::DataMessageHeader::cid |
Object id, always DATAMESSAGEID for a valid current-format message; used by isValid().
auto
Definition at line 190 of file DataMessage.h.
Referenced by cmlabs::DataMessage::ConvertDataFromOlderMessageFormat(), cmlabs::DataMessage::copyUserEntriesFromMessage(), toJSON(), and toXML().
| PsyContext cmlabs::DataMessageHeader::contextchange |
Context switch this message announces (NOCONTEXT if none).
api/user
Definition at line 212 of file DataMessage.h.
| uint16 cmlabs::DataMessageHeader::cver |
Message format version (CURRENTDATAMESSAGEVERSION).
auto
Definition at line 191 of file DataMessage.h.
Referenced by cmlabs::DataMessage::ConvertDataFromOlderMessageFormat().
| uint32 cmlabs::DataMessageHeader::cyclecputime |
CPU time spent processing the triggering message in this cycle, in microseconds (profiling).
Definition at line 217 of file DataMessage.h.
Referenced by cmlabs::Internal_StatsLog(), toJSON(), and toXML().
| uint32 cmlabs::DataMessageHeader::cyclewalltime |
Wall-clock time spent in this cycle, in microseconds (profiling).
Definition at line 218 of file DataMessage.h.
Referenced by cmlabs::Internal_StatsLog(), toJSON(), and toXML().
| uint16 cmlabs::DataMessageHeader::destination |
| uint32 cmlabs::DataMessageHeader::from |
| uint64 cmlabs::DataMessageHeader::memid |
Shared-memory id assigned when the message is stored in a memory map.
auto
Definition at line 193 of file DataMessage.h.
Referenced by cmlabs::PsySpace::postMessage(), toJSON(), and toXML().
| uint16 cmlabs::DataMessageHeader::origin |
| uint8 cmlabs::DataMessageHeader::policy |
Delivery policy flags, e.g.
MESSAGE_NON_GUARANTEED. spec
Definition at line 202 of file DataMessage.h.
| uint16 cmlabs::DataMessageHeader::priority |
Scheduling priority; higher values are processed first by whiteboards and modules.
spec
Definition at line 201 of file DataMessage.h.
| uint64 cmlabs::DataMessageHeader::recvtime |
Time the message was received by the current component, in microseconds.
api
Definition at line 196 of file DataMessage.h.
| uint64 cmlabs::DataMessageHeader::reference |
Reference id linking this message to another (e.g.
request/reply correlation). api
Definition at line 210 of file DataMessage.h.
| uint64 cmlabs::DataMessageHeader::sendtime |
Time the message was posted/sent, in microseconds.
api
Definition at line 195 of file DataMessage.h.
| uint64 cmlabs::DataMessageHeader::serial |
Serial number, e.g.
sequence position in a recording. api/user
Definition at line 211 of file DataMessage.h.
| uint32 cmlabs::DataMessageHeader::size |
Total size of the whole message block in bytes (header + all entries).
auto
Definition at line 189 of file DataMessage.h.
Referenced by cmlabs::ComponentMemory::addComponentStats(), cmlabs::ProcessMemory::addToProcessStats(), cmlabs::DataMessage::ConvertDataFromOlderMessageFormat(), cmlabs::DataMessage::copyUserEntriesFromMessage(), cmlabs::DataMessage::DataMessage(), cmlabs::DataMessage::fillInDraftUserDataFrom(), cmlabs::DataMessage::setAttachedMessage(), toJSON(), toXML(), and cmlabs::MessagePlayer::writeMetadata().
| uint16 cmlabs::DataMessageHeader::status |
| uint32 cmlabs::DataMessageHeader::systemid |
Id of the Psyclone system instance that sent the message.
Definition at line 223 of file DataMessage.h.
| uint32 cmlabs::DataMessageHeader::tag |
User tag id for temporal/semantic grouping of related messages.
api/user
Definition at line 208 of file DataMessage.h.
| uint64 cmlabs::DataMessageHeader::time |
Creation time in microseconds since epoch (see PsyTime).
auto
Definition at line 194 of file DataMessage.h.
| uint32 cmlabs::DataMessageHeader::to |
Component id of the addressee; 0 for publish/subscribe distribution.
user
Definition at line 205 of file DataMessage.h.
| uint64 cmlabs::DataMessageHeader::ttl |
Time-to-live in microseconds; 0 means deliver-and-forget (not retained in memory).
spec
Definition at line 200 of file DataMessage.h.
| PsyType cmlabs::DataMessageHeader::type |
Hierarchical message type (e.g.
"2.201.3") used for subscription matching. api/user
Definition at line 207 of file DataMessage.h.
| uint32 cmlabs::DataMessageHeader::userCount |
Number of user entries currently in use.
Definition at line 215 of file DataMessage.h.
Referenced by cmlabs::DataMessage::copyUserEntriesFromMessage(), cmlabs::DataMessage::fillInDraftUserDataFrom(), cmlabs::MessagePlayer::setSystemIDs(), toJSON(), and toXML().
| uint32 cmlabs::DataMessageHeader::userSize |
Total size in bytes of all user entries currently in use.
Definition at line 214 of file DataMessage.h.
Referenced by cmlabs::DataMessage::fillInDraftUserDataFrom(), toJSON(), and toXML().