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

One filter condition attached to a TriggerSpec: a test on a user entry of the candidate message. More...

#include <Subscriptions.h>

Public Member Functions

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

Public Attributes

uint8 filter
 Filter operation, one of the TRIGGERFILTER_... codes.
uint64 time
 Time operand in milliseconds (used by TRIGGERFILTER_MAXAGE).
char key [MAXKEYNAMELEN+1]
 Name of the user entry to test.
char value [MAXVALUENAMELEN+1]
 Comparison operand as text (parsed numerically for the numeric operations).

Detailed Description

One filter condition attached to a TriggerSpec: a test on a user entry of the candidate message.

A trigger only fires when ALL of its filters pass. Stored as fixed-size POD directly after the TriggerSpec in the same memory block.

Definition at line 87 of file Subscriptions.h.

Member Function Documentation

◆ fromXML() [1/2]

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

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

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

Definition at line 98 of file Subscriptions.h.

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

Referenced by fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_FilterSpec_1fromXML_1_1SWIG_10(), and cmlabs::TriggerSpec::UnitTest().

◆ fromXML() [2/2]

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

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

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

Definition at line 108 of file Subscriptions.h.

References cmlabs::utils::Ascii2Uint32(), cmlabs::utils::Ascii2Uint64(), filter, cmlabs::XMLNode::getAttribute(), key, MAXKEYNAMELEN, MAXVALUENAMELEN, cmlabs::utils::strcpyavail(), time, and value.

◆ toXML()

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

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

Definition at line 93 of file Subscriptions.h.

References filter, key, cmlabs::utils::StringFormat(), time, and value.

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

Member Data Documentation

◆ filter

uint8 cmlabs::FilterSpec::filter

Filter operation, one of the TRIGGERFILTER_... codes.

Definition at line 88 of file Subscriptions.h.

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

◆ key

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

◆ time

uint64 cmlabs::FilterSpec::time

Time operand in milliseconds (used by TRIGGERFILTER_MAXAGE).

Definition at line 89 of file Subscriptions.h.

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

◆ value

char cmlabs::FilterSpec::value[MAXVALUENAMELEN+1]

Comparison operand as text (parsed numerically for the numeric operations).

Definition at line 91 of file Subscriptions.h.

Referenced by _wrap_FilterSpec_value_set(), _wrap_FilterSpec_value_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_FilterSpec_1value_1set(), toXML(), and cmlabs::TriggerSpec::UnitTest().


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