= !ObjectList = == Description == !ObjectList is a wrapper to [wiki:ObjectListBase]. !ObjectListBase contains all objects of a given class, but threats the objects as [wiki:OrxonoxClass 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 just redirects to ClassIdentifier::''''''''''objects_ (which is an !ObjectListBase). So, in other words, !ObjectList is just a shortcut for: {{{ ClassIdentifier::getIdentifier()->getObjects() }}} == Functions == !ObjectList provides the same functions as !ObjectListBase but doesn't return an [wiki:ObjectListBase#ObjectListBase::Export Export] struct but a class-specific list element pointer which can not only be used by [wiki:Iterator] but also by [wiki: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 [wiki:Iterator] and [wiki:ObjectListIterator] for more information about the usage of those functions. == Illustration == [[Image(ObjectList.png)]] The illustration shows how the !ObjectList uses !ClassIdentifier to get the !ObjectListBase. Because !ObjectList knows about the right class (T) it casts the list element to the right type and gets the object pointer without dynamic_cast.