#include <tjlist.h>
Inheritance diagram for List< I, P, R >:
[legend]Collaboration diagram for List< I, P, R >:
[legend]List of all members.
Detailed Description
template<class I, class P, class R>
class List< I, P, R >
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.
Definition at line 138 of file tjlist.h.
Constructor & Destructor Documentation
template<class I, class P, class R>
template<class I, class P, class R>
Member Function Documentation
template<class I, class P, class R>
| List& List< I, P, R >::operator= |
( |
const List< I, P, R > & |
l |
) |
[inline] |
Assignment operator that will result in a list that holds references to all objects for which 'l' contains a reference
Definition at line 168 of file tjlist.h.
template<class I, class P, class R>
| List& List< I, P, R >::clear |
( |
|
) |
[inline] |
template<class I, class P, class R>
| List& List< I, P, R >::append |
( |
R |
item |
) |
[inline] |
Appends a reference to 'item'
Definition at line 192 of file tjlist.h.
template<class I, class P, class R>
| List& List< I, P, R >::remove |
( |
R |
item |
) |
[inline] |
Removes all references to 'item'
Definition at line 205 of file tjlist.h.
template<class I, class P, class R>
| unsigned int List< I, P, R >::size |
( |
|
) |
const [inline] |
Returns the number of items in the list
Definition at line 218 of file tjlist.h.
template<class I, class P, class R>
| STD_list<P>::iterator List< I, P, R >::get_begin |
( |
|
) |
[inline] |
returns an iterator that points to the head of the list (for mutable lists)
Definition at line 247 of file tjlist.h.
template<class I, class P, class R>
| STD_list<P>::iterator List< I, P, R >::get_end |
( |
|
) |
[inline] |
returns an iterator that points to the end of the list (for mutable lists)
Definition at line 252 of file tjlist.h.
template<class I, class P, class R>
| STD_list<P>::const_iterator List< I, P, R >::get_const_begin |
( |
|
) |
const [inline] |
returns an iterator that points to the head of the list (for const lists)
Definition at line 257 of file tjlist.h.
template<class I, class P, class R>
| STD_list<P>::const_iterator List< I, P, R >::get_const_end |
( |
|
) |
const [inline] |
returns an iterator that points to the end of the list (for const lists)
Definition at line 262 of file tjlist.h.
Member Data Documentation
template<class I, class P, class R>
STD_list<P>::iterator List< I, P, R >::iter [mutable] |
Iterator for mutable lists
Definition at line 237 of file tjlist.h.
template<class I, class P, class R>
Iterator for const lists
Definition at line 242 of file tjlist.h.
The documentation for this class was generated from the following file:
Generated on Sat Jun 14 12:31:43 2008 by
1.5.1