DetectorGraph
2.0
|
Internal - A limited-size Container for Topic<T>s More...
Public Member Functions | |
TopicRegistry () | |
template<class TTopicState > | |
Topic< TTopicState > * | Resolve () |
template<class TTopicState > | |
void | Register (Topic< TTopicState > *obj) |
TopicRegistry () | |
~TopicRegistry () | |
template<class TTopicState > | |
Topic< TTopicState > * | Resolve () |
Internal - Retrieves a Topic pointer for a given TopicState. More... | |
template<class TTopicState > | |
void | Register (Topic< TTopicState > *topicPtr) |
Internal - Registers a Topic pointer for a given TopicState. More... | |
template<class TTopicState > | |
Topic< TTopicState > * | Resolve () |
Internal - Retrieves a Topic pointer for a given TopicState. More... | |
template<class TTopicState > | |
void | Register (Topic< TTopicState > *obj) |
Internal - Registers a Topic pointer for a given TopicState. More... | |
Internal - A limited-size Container for Topic<T>s
Internal - A Registry of available Topics
Internal - A statically and automatically sized registry for Topics
Graph owns this to manage all the registered topics This Container uses a single pointer array to store BaseTopic* indexed by the topic's public ID.
This TopicRegistry needs no explicit sizing, does not depend on RTTI nor STL and puts no requirements on TopicStates. It's downside is that its storage is static and thus behaves like a singleton - this means only one instance of TopicRegistry can be alive at any time.
This implementation stores BaseTopic* on TTopicState-templated methods. The pointer can be set by calling ResolveOrRegister with a non-NULL argument and retrieved by calling the same method with a NULL argument.
The type stored in the templated methods - RegistryNode - is a single node for a linked-list stack. Each node holds a BaseTopic* and a pointer to another RegistryNode. This allows TopicRegistry to perform cleanup of the static/singleton nodes per topic at the destructor.
Graphs use a TopicRegistry to register and resolve (i.e. retrieve) Topics using a Type-aware API. This uses RTTI to retrieve an 'index' for each class.
Right now using 'name' because it's convenient for debugging.. But could use other stuff too.
Definition at line 33 of file topicregistry-lite.hpp.
|
inline |
Definition at line 37 of file topicregistry-lite.hpp.
|
inline |
Definition at line 57 of file topicregistry-lite2.hpp.
|
inline |
Definition at line 61 of file topicregistry-lite2.hpp.
|
inline |
Definition at line 56 of file topicregistry-lite.hpp.
|
inline |
Internal - Registers a Topic pointer for a given TopicState.
Definition at line 65 of file topicregistry-stl.hpp.
|
inline |
Internal - Registers a Topic pointer for a given TopicState.
Definition at line 90 of file topicregistry-lite2.hpp.
|
inline |
Definition at line 38 of file topicregistry-lite.hpp.
|
inline |
Internal - Retrieves a Topic pointer for a given TopicState.
Definition at line 47 of file topicregistry-stl.hpp.
|
inline |
Internal - Retrieves a Topic pointer for a given TopicState.
Definition at line 70 of file topicregistry-lite2.hpp.