|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Hierarchical execution-context identifier. More...
#include <Types.h>
Public Member Functions | |
| bool | isValid () |
| bool | operator== (const PsyContext &othercontext) const |
| bool | operator!= (const PsyContext &othercontext) const |
| bool | operator< (const PsyContext &othercontext) const |
| bool | operator> (const PsyContext &othercontext) const |
| uint16 | operator[] (int i) const |
| bool | setLevel (int i, uint16 value) |
| bool | matches (const PsyContext &othercontext) const |
| Wildcard-aware context matching: levels are considered matching when equal, or when either side is 0xFFFF or 0 (both act as wildcards here). | |
| std::string | toString () |
| std::string | toString (std::map< uint16, std::string > *subcontexts) |
| bool | fromString (const char *text) |
| uint8 | compare (const PsyContext &othercontext) const |
| Classify the hierarchical relationship between this context and another. | |
Public Attributes | |
| uint16 | levels [PSYCONTEXTLEVELS] |
| Hierarchy levels, most significant first; 0 terminates (and wildcards in matches()), 0xFFFF is a wildcard. | |
Hierarchical execution-context identifier.
Structurally identical to PsyType (16 uint16 levels, dotted notation, 0xFFFF wildcard) but semantically different: a PsyContext describes the situation/state a system is operating in (e.g. "dialog.greeting"). Components can be active only in certain contexts, and messages can switch the current context via DataMessageHeader::contextchange. Unlike PsyType::matches(), PsyContext::matches() also treats level value 0 as a wildcard, so a more general context matches a more specific one. Use compare() to get the precise relationship (equal / supersedes / included / different root). Use NOCONTEXT for the empty value.
|
inline |
Classify the hierarchical relationship between this context and another.
| othercontext | context to compare with |
Definition at line 414 of file Types.h.
References CONTEXT_EQUAL, CONTEXT_INCLUDED, CONTEXT_OTHER_ROOT, CONTEXT_SUPERSEDES, levels, and PSYCONTEXTLEVELS.
Referenced by _wrap_PsyContext_compare().
|
inline |
Definition at line 374 of file Types.h.
References isValid(), levels, and PSYCONTEXTLEVELS.
|
inline |
Definition at line 289 of file Types.h.
References levels.
Referenced by _wrap_PsyContext_isValid(), fromString(), and cmlabs::PsyAPI::postOutputMessage().
|
inline |
Wildcard-aware context matching: levels are considered matching when equal, or when either side is 0xFFFF or 0 (both act as wildcards here).
| othercontext | the context to compare against |
Definition at line 329 of file Types.h.
References levels, and PSYCONTEXTLEVELS.
Referenced by _wrap_PsyContext_matches().
|
inline |
|
inline |
Definition at line 296 of file Types.h.
References levels, and PSYCONTEXTLEVELS.
|
inline |
|
inline |
Definition at line 305 of file Types.h.
References levels, and PSYCONTEXTLEVELS.
|
inline |
Definition at line 314 of file Types.h.
References levels, and PSYCONTEXTLEVELS.
|
inline |
Definition at line 319 of file Types.h.
References levels, and PSYCONTEXTLEVELS.
|
inline |
Definition at line 341 of file Types.h.
References levels, and PSYCONTEXTLEVELS.
Referenced by toString().
|
inline |
Definition at line 352 of file Types.h.
References levels, PSYTYPELEVELS, and toString().
| uint16 PsyContext::levels[PSYCONTEXTLEVELS] |
Hierarchy levels, most significant first; 0 terminates (and wildcards in matches()), 0xFFFF is a wildcard.
Definition at line 285 of file Types.h.
Referenced by _wrap_PsyContext_levels_set(), compare(), fromString(), isValid(), matches(), operator!=(), operator<(), operator==(), operator>(), operator[](), setLevel(), toString(), and toString().