ObjectList
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:
Description
ObjectList is a wrapper to ObjectListBase. ObjectListBase contains all objects of a given class, but threats the objects as OrxonoxClasses. ObjectList in contrary is a template and knows about the correct class. By definition theres only one ObjectList per class. This is easy to proof because ObjectList<T> just redirects to ClassIdentifier<T>::objects_ (which is an ObjectListBase).
So, in other words, ObjectList<T> is just a shortcut for:
ClassIdentifier<T>::getIdentifier()->getObjects()
Functions
ObjectList provides the same functions as ObjectListBase but doesn't return an Export struct but a class-specific list element pointer which can not only be used by Iterator but also by ObjectListIterator. This is important because ObjectListIterator is much more performant than Iterator.
- begin(): Returns a pointer to the first element in the list
- end(): Returns a pointer to the list-element after the last element in the list
- rbegin(): Returns a pointer to the last element in the list
- rend(): Returns a pointer to the list-element before the first element in the list
See Iterator and ObjectListIterator for more information about the usage of those functions.
Illustration
The illustration shows how the ObjectList<T> uses ClassIdentifier<T> to get the ObjectListBase. Because ObjectList<T> knows about the right class (T) it casts the list element to the right type and gets the object pointer without dynamic_cast.
Attachments
-
ObjectList.png
(17.9 KB) - added by landauf
4 years ago.








