|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Specification of a query against a catalog/service/feed, attached to a TriggerSpec. More...
#include <Subscriptions.h>
Public Member Functions | |
| std::string | toXML () |
| Serialise as a <query .../> XML element. | |
| bool | fromXML (const char *xml) |
| Parse from an XML string containing a <query .../> element. | |
| bool | fromXML (XMLNode &node) |
| Parse from an already-parsed <query> XML node. | |
Public Attributes | |
| uint32 | source |
| Component id of the source to query. | |
| uint32 | origin |
| Restrict to data originating from this component id (0 = any). | |
| uint64 | maxage |
| Maximum age of results in MICROSECONDS (XML gives ms; parser multiplies by 1000). | |
| uint32 | maxcount |
| Maximum number of results to return (0 = unlimited). | |
| PsyContext | context |
| Restrict to data matching this context. | |
| bool | binary |
| Request results in binary form rather than text. | |
| uint32 | ipHost |
| External source: IPv4 host (as uint32), 0 if not used. | |
| uint16 | ipPort |
| External source: TCP/UDP port, 0 if not used. | |
| char | sourceName [MAXKEYNAMELEN+1] |
| Name of the source component (alternative to numeric id). | |
| char | hostName [MAXKEYNAMELEN+1] |
| External source: host name (alternative to ipHost). | |
| char | name [MAXKEYNAMELEN+1] |
| Name of this query, used to reference its results in the crank. | |
| char | key [MAXKEYNAMELEN+1] |
| Key to query on. | |
| char | value [MAXVALUENAMELEN+1] |
| Value to match. | |
| char | type [MAXKEYNAMELEN+1] |
| Requested data/content type. | |
| char | subdir [MAXKEYNAMELEN+1] |
| Sub-directory/collection within the source. | |
| char | ext [MAXKEYNAMELEN+1] |
| File extension / data format selector. | |
| char | operation [MAXKEYNAMELEN+1] |
| Operation to perform (source-specific verb). | |
Specification of a query against a catalog/service/feed, attached to a TriggerSpec.
When its trigger fires, the runtime executes this query against the named source component (or an external host/port) and delivers the results to the crank alongside the trigger message. Fixed-size POD stored back-to-back inside the TriggerSpec block.
Definition at line 126 of file Subscriptions.h.
|
inline |
Parse from an XML string containing a <query .../> element.
| xml | XML text. |
Definition at line 151 of file Subscriptions.h.
References cmlabs::XMLResults::error, cmlabs::eXMLErrorNone, fromXML(), and cmlabs::XMLNode::isEmpty().
Referenced by fromXML(), and Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1fromXML_1_1SWIG_10().
|
inline |
Parse from an already-parsed <query> XML node.
| node | the XML node. |
Definition at line 161 of file Subscriptions.h.
References cmlabs::utils::Ascii2Uint32(), cmlabs::utils::Ascii2Uint64(), binary, context, ext, cmlabs::XMLNode::getAttribute(), hostName, ipHost, ipPort, key, maxage, maxcount, MAXKEYNAMELEN, MAXVALUENAMELEN, name, operation, origin, source, sourceName, cmlabs::utils::strcpyavail(), stricmp, subdir, type, and value.
|
inline |
Serialise as a <query .../> XML element.
Definition at line 145 of file Subscriptions.h.
References binary, ext, hostName, ipHost, ipPort, key, maxage, maxcount, name, operation, origin, source, sourceName, cmlabs::utils::StringFormat(), subdir, type, and value.
Referenced by cmlabs::TriggerSpec::toXML().
| bool cmlabs::QuerySpec::binary |
Request results in binary form rather than text.
Definition at line 132 of file Subscriptions.h.
Referenced by fromXML(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| PsyContext cmlabs::QuerySpec::context |
Restrict to data matching this context.
Definition at line 131 of file Subscriptions.h.
Referenced by fromXML().
| char cmlabs::QuerySpec::ext[MAXKEYNAMELEN+1] |
File extension / data format selector.
Definition at line 142 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_ext_set(), _wrap_QuerySpec_ext_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1ext_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::hostName[MAXKEYNAMELEN+1] |
External source: host name (alternative to ipHost).
Definition at line 136 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_hostName_set(), _wrap_QuerySpec_hostName_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1hostName_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| uint32 cmlabs::QuerySpec::ipHost |
External source: IPv4 host (as uint32), 0 if not used.
Definition at line 133 of file Subscriptions.h.
Referenced by fromXML(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| uint16 cmlabs::QuerySpec::ipPort |
External source: TCP/UDP port, 0 if not used.
Definition at line 134 of file Subscriptions.h.
Referenced by fromXML(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::key[MAXKEYNAMELEN+1] |
Key to query on.
Definition at line 138 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_key_set(), _wrap_QuerySpec_key_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1key_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| uint64 cmlabs::QuerySpec::maxage |
Maximum age of results in MICROSECONDS (XML gives ms; parser multiplies by 1000).
Definition at line 129 of file Subscriptions.h.
| uint32 cmlabs::QuerySpec::maxcount |
Maximum number of results to return (0 = unlimited).
Definition at line 130 of file Subscriptions.h.
| char cmlabs::QuerySpec::name[MAXKEYNAMELEN+1] |
Name of this query, used to reference its results in the crank.
Definition at line 137 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_name_set(), _wrap_QuerySpec_name_set(), fromXML(), cmlabs::TriggerSpec::getQuerySpec(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1name_1set(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::operation[MAXKEYNAMELEN+1] |
Operation to perform (source-specific verb).
Definition at line 143 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_operation_set(), _wrap_QuerySpec_operation_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1operation_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| uint32 cmlabs::QuerySpec::origin |
Restrict to data originating from this component id (0 = any).
Definition at line 128 of file Subscriptions.h.
| uint32 cmlabs::QuerySpec::source |
Component id of the source to query.
Definition at line 127 of file Subscriptions.h.
Referenced by fromXML(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::sourceName[MAXKEYNAMELEN+1] |
Name of the source component (alternative to numeric id).
Definition at line 135 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_sourceName_set(), _wrap_QuerySpec_sourceName_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1sourceName_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::subdir[MAXKEYNAMELEN+1] |
Sub-directory/collection within the source.
Definition at line 141 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_subdir_set(), _wrap_QuerySpec_subdir_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1subdir_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::type[MAXKEYNAMELEN+1] |
Requested data/content type.
Definition at line 140 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_type_set(), _wrap_QuerySpec_type_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1type_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().
| char cmlabs::QuerySpec::value[MAXVALUENAMELEN+1] |
Value to match.
Definition at line 139 of file Subscriptions.h.
Referenced by _wrap_QuerySpec_value_set(), _wrap_QuerySpec_value_set(), fromXML(), Java_com_cmlabs_cmsdk_cmsdkJNI_QuerySpec_1value_1set(), cmlabs::PsyAPI::queryCatalog(), cmlabs::PsyAPI::queryCatalog(), and toXML().