DetectorGraph
2.0
|
Base struct for topic data types. More...
Public Types | |
enum | { kAnonymousTopicState = -1 } |
Default GetId() return value. More... | |
Public Member Functions | |
TopicState () | |
virtual | ~TopicState () |
const char * | GetName () const |
Get type name of itself. More... | |
virtual TopicStateIdType | GetId () const |
Returns the TopicStateId for this TopicState - to be implemented. More... | |
Static Public Member Functions | |
template<class TTopic > | |
static TopicStateIdType | GetId () |
Convenience templated static method to retrieve the ID for a Type when an instance is not available. More... | |
Base struct for topic data types.
This should be seen like a POD data container. A simple example could be:
Ideally all TopicStates are self-explanatory and self-contained; a subscriber shouldn't need anything else to act on it. The rationale for calling it 'struct' instead of 'class':
Definition at line 52 of file topicstate.hpp.
anonymous enum |
Default GetId() return value.
Enumerator | |
---|---|
kAnonymousTopicState |
Definition at line 76 of file topicstate.hpp.
|
inline |
Definition at line 54 of file topicstate.hpp.
|
inlinevirtual |
Definition at line 55 of file topicstate.hpp.
|
inlinevirtual |
Returns the TopicStateId for this TopicState - to be implemented.
If not implemented on a derived class it returns -1 (not implemented) meaning this TopicState is an anonymous TopicState (only used within the graph). This refers to a public number-space defined by the application for types that are intended to be provided to (or from) the outside (of the graph).
For a full discussion/example of how to use Named TopicStates see Trivial Vending Machine Example
Definition at line 90 of file topicstate.hpp.
|
inlinestatic |
Convenience templated static method to retrieve the ID for a Type when an instance is not available.
Definition at line 100 of file topicstate.hpp.
|
inline |
Get type name of itself.
This method is a convenience method that can be used for graph debugging. It uses RTTI to generate a descriptive string that identifies the child of TopicState. This strings are compiler-specific but mostly based on the actual name of struct that inherits from TopicState.
Definition at line 68 of file topicstate.hpp.