CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::RetrieveSpec Struct Reference

Specification of a whiteboard retrieval attached to a TriggerSpec. More...

#include <Subscriptions.h>

Collaboration diagram for cmlabs::RetrieveSpec:
[legend]

Public Member Functions

std::string toXML ()
 Serialise as a <retrieve .../> XML element.
bool fromXML (const char *xml)
 Parse from an XML string containing a <retrieve .../> element.
bool fromXML (XMLNode &node)
 Parse from an already-parsed <retrieve> XML node.

Public Attributes

uint32 source
 Component id of the whiteboard to retrieve from.
uint32 origin
 Restrict to messages originating from this component id (0 = any).
uint64 maxage
 Maximum message age in MICROSECONDS (XML gives ms; parser multiplies by 1000).
uint32 maxcount
 Maximum number of messages to return (0 = unlimited).
PsyType type
 Message type to match (wildcards allowed).
PsyContext context
 Context to match.
uint32 tag
 Tag to match (0 = any).
char name [MAXKEYNAMELEN+1]
 Name of this retrieve, used to reference its results in the crank.
char key [MAXKEYNAMELEN+1]
 Indexed user entry to range-query on (empty = time/type retrieval only).
uint8 keytype
 Interpretation of key: INDEX_TIME, INDEX_STRING, INDEX_INTEGER or INDEX_FLOAT.
uint32 from
 Restrict to messages sent by this component id (0 = any).
uint32 to
 Restrict to messages addressed to this component id (0 = any).
uint64 startTime
 Range start when keytype == INDEX_TIME (microseconds).
uint64 endTime
 Range end when keytype == INDEX_TIME (microseconds).
int64 startInt
 Range start when keytype == INDEX_INTEGER.
int64 endInt
 Range end when keytype == INDEX_INTEGER.
float64 startFloat
 Range start when keytype == INDEX_FLOAT.
float64 endFloat
 Range end when keytype == INDEX_FLOAT.
char startString [MAXVALUENAMELEN+1]
 Range start when keytype == INDEX_STRING.
char endString [MAXVALUENAMELEN+1]
 Range end when keytype == INDEX_STRING.

Detailed Description

Specification of a whiteboard retrieval attached to a TriggerSpec.

When its trigger fires, the runtime retrieves matching messages from the whiteboard's MessageIndex — by type, context, tag, sender/addressee, age, and optionally a value/range condition on an indexed user entry (see keytype and the start/end pairs) — and hands them to the crank together with the trigger message. Fixed-size POD stored inside the TriggerSpec block.

Definition at line 193 of file Subscriptions.h.

Member Function Documentation

◆ fromXML() [1/2]

bool cmlabs::RetrieveSpec::fromXML ( const char * xml)
inline

Parse from an XML string containing a <retrieve .../> element.

Parameters
xmlXML text.
Returns
true if all attributes were present and valid.

Definition at line 222 of file Subscriptions.h.

References cmlabs::XMLResults::error, cmlabs::eXMLErrorNone, fromXML(), and cmlabs::XMLNode::isEmpty().

Referenced by fromXML(), and Java_com_cmlabs_cmsdk_cmsdkJNI_RetrieveSpec_1fromXML_1_1SWIG_10().

◆ fromXML() [2/2]

bool cmlabs::RetrieveSpec::fromXML ( XMLNode & node)
inline

Parse from an already-parsed <retrieve> XML node.

Parameters
nodethe XML node.
Returns
true if all attributes were present and valid.

Definition at line 232 of file Subscriptions.h.

References cmlabs::utils::Ascii2Float64(), cmlabs::utils::Ascii2Int64(), cmlabs::utils::Ascii2Uint32(), cmlabs::utils::Ascii2Uint64(), context, endFloat, endInt, endString, endTime, from, cmlabs::XMLNode::getAttribute(), key, keytype, maxage, maxcount, MAXKEYNAMELEN, MAXVALUENAMELEN, name, origin, source, startFloat, startInt, startString, startTime, cmlabs::utils::strcpyavail(), tag, to, and type.

◆ toXML()

std::string cmlabs::RetrieveSpec::toXML ( )
inline

Serialise as a <retrieve .../> XML element.

Definition at line 215 of file Subscriptions.h.

References context, endFloat, endInt, endString, endTime, from, key, keytype, maxage, maxcount, name, origin, source, startFloat, startInt, startString, startTime, cmlabs::utils::StringFormat(), tag, to, and type.

Referenced by cmlabs::TriggerSpec::toXML().

Member Data Documentation

◆ context

PsyContext cmlabs::RetrieveSpec::context

Context to match.

Definition at line 199 of file Subscriptions.h.

Referenced by fromXML(), and toXML().

◆ endFloat

float64 cmlabs::RetrieveSpec::endFloat

Range end when keytype == INDEX_FLOAT.

Definition at line 211 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), cmlabs::PsyAPI::retrieveFloatParam(), and toXML().

◆ endInt

int64 cmlabs::RetrieveSpec::endInt

Range end when keytype == INDEX_INTEGER.

Definition at line 209 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), cmlabs::PsyAPI::retrieveIntegerParam(), and toXML().

◆ endString

◆ endTime

uint64 cmlabs::RetrieveSpec::endTime

Range end when keytype == INDEX_TIME (microseconds).

Definition at line 207 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), cmlabs::PsyAPI::retrieveTimeParam(), and toXML().

◆ from

uint32 cmlabs::RetrieveSpec::from

Restrict to messages sent by this component id (0 = any).

Definition at line 204 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), and toXML().

◆ key

char cmlabs::RetrieveSpec::key[MAXKEYNAMELEN+1]

◆ keytype

uint8 cmlabs::RetrieveSpec::keytype

Interpretation of key: INDEX_TIME, INDEX_STRING, INDEX_INTEGER or INDEX_FLOAT.

Definition at line 203 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), toXML(), and cmlabs::MessageIndex::UnitTest().

◆ maxage

◆ maxcount

◆ name

char cmlabs::RetrieveSpec::name[MAXKEYNAMELEN+1]

Name of this retrieve, used to reference its results in the crank.

Definition at line 201 of file Subscriptions.h.

Referenced by _wrap_RetrieveSpec_name_set(), _wrap_RetrieveSpec_name_set(), fromXML(), cmlabs::TriggerSpec::getRetrieveSpec(), Java_com_cmlabs_cmsdk_cmsdkJNI_RetrieveSpec_1name_1set(), and toXML().

◆ origin

uint32 cmlabs::RetrieveSpec::origin

Restrict to messages originating from this component id (0 = any).

Definition at line 195 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::PsyAPI::retrieve(), and toXML().

◆ source

uint32 cmlabs::RetrieveSpec::source

Component id of the whiteboard to retrieve from.

Definition at line 194 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::PsyAPI::retrieve(), and toXML().

◆ startFloat

float64 cmlabs::RetrieveSpec::startFloat

Range start when keytype == INDEX_FLOAT.

Definition at line 210 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), cmlabs::PsyAPI::retrieveFloatParam(), and toXML().

◆ startInt

int64 cmlabs::RetrieveSpec::startInt

Range start when keytype == INDEX_INTEGER.

Definition at line 208 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), cmlabs::PsyAPI::retrieveIntegerParam(), and toXML().

◆ startString

◆ startTime

uint64 cmlabs::RetrieveSpec::startTime

Range start when keytype == INDEX_TIME (microseconds).

Definition at line 206 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), cmlabs::PsyAPI::retrieveTimeParam(), and toXML().

◆ tag

uint32 cmlabs::RetrieveSpec::tag

Tag to match (0 = any).

Definition at line 200 of file Subscriptions.h.

Referenced by fromXML(), and toXML().

◆ to

uint32 cmlabs::RetrieveSpec::to

Restrict to messages addressed to this component id (0 = any).

Definition at line 205 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), and toXML().

◆ type

PsyType cmlabs::RetrieveSpec::type

Message type to match (wildcards allowed).

Definition at line 198 of file Subscriptions.h.

Referenced by fromXML(), cmlabs::MessageIndex::queryMessages(), and toXML().


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