ODIN
|
#include <tjlist.h>
Public Types | |
typedef STD_list< P >::iterator | iter |
typedef STD_list< P >::const_iterator | constiter |
Public Member Functions | |
List () | |
~List () | |
List & | operator= (const List &l) |
List & | clear () |
List & | append (R item) |
List & | remove (R item) |
unsigned int | size () const |
iter | get_begin () |
iter | get_end () |
constiter | get_const_begin () const |
constiter | get_const_end () const |
This template class handles a list of references to other objects. In contrast to the STL list, it stores only pointers to the members of the list instead of storing copies. That means, if a member of the list is modified, the property of the whole list changes. This list is well suited to build blocks of objects that will be modified after they have been inserted into the list, e.g. a list of parameters.
If you want to use this list, i.e. create an instantiation for a specific data type T, you must first decide whether to use const objects, i.e. which will not changed via the list, or non-const objects that can be modified via the list. In the former case, create a list by instatiating
List<T,const T*,const T&>
otherwise
List<T,T*,T&>
Classes which are to be inserted into the list must be derived from the base class
ListItem<T>
This construct ensures that whenever an item of the list is deleted, it deregisters itself from the list.
Constructs an empty List
Definition at line 39 of file tjlist_code.h.
Destructor
Definition at line 47 of file tjlist_code.h.
Appends a reference to 'item'
Definition at line 82 of file tjlist_code.h.
Removes all items from the list
Definition at line 65 of file tjlist_code.h.
List< I, P, R > & List< I, P, R >::operator= | ( | const List< I, P, R > & | l | ) |
Assignment operator that will result in a list that holds references to all objects for which 'l' contains a reference
Definition at line 56 of file tjlist_code.h.
Removes all references to 'item'
Definition at line 93 of file tjlist_code.h.
|
inline |