ClassIdentifier
TracNav
Development
- Overview
- SVN
Download...
- Contribute
Programming:
- Modules
Documentation
- Overview
Core
- Overview
- ArgumentCompleter
- ArgumentCompletionFunctions
- ArgumentCompletionList
- BaseObject
- ClassFactory
- ClassIdentifier
- ClassTreeMask
- Clock
- CommandEvaluation
- CommandExecutor
- CommandLine
- ConfigFileManager
- ConfigValueContainer
- ConfigValueIncludes
- ConsoleCommand
- CoreIncludes
- Executor
- Factory
- Functor
- GameStates
- Identifier
Input...
- IRC
- Iterator
- Language
- Level
- Loader?
- MetaObjectList
- Namespace?
- ObjectList
- ObjectListBase
- ObjectListIterator
- OrxonoxClass
- RootGameState?
- Script?
- Shell?
- SubclassIdentifier
- Super
- TclBind
- TclThreadManager?
- XMLPort
Network...
Orxonox...
Util...
- API Reference
HowTo...
- FAQ
- Styleguide
More...
Content Creation:
Important: The ClassIdentifier is derived from Identifier. Read the related Wiki-page to learn about all inherited features and functions.
- Go to the Identifier
Description
The ClassIdentifier is a template and a singleton, derived from Identifier, with two important tasks:
- Doing some class-specific stuff
- Fast and easy link to the Identifier of a class
Uniqueness
Specially the second point is of major importance: ClassIdentifier is a singleton, meaning there's only one instance of ClassIdentifier<T> for every T. This allows you to get the Identifier of any class by calling ClassIdentifier<classname>::getIdentifier():
Identifier* identifier = ClassIdentifier<SomeClass>::getIdentifier();
This is in fact just what the Class(classname) macro in CoreIncludes does.
To assure uniqueness even in different libraries, a ClassIdentifier has to register in a map. If the Identifier for a specific class already exists, the second ClassIdentifier will just refer to the first one.







