List< I, P, R > Class Template Reference
[Classes for basic data types and vectors/arrays (tjutils library)]

#include <tjlist.h>

Inheritance diagram for List< I, P, R >:

Inheritance graph
[legend]
Collaboration diagram for List< I, P, R >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 List ()
 ~List ()
Listoperator= (const List &l)
Listclear ()
Listappend (R item)
Listremove (R item)
unsigned int size () const
STD_list< P >::const_iterator get_element_by_index (unsigned int index) const
STD_list< P >::iterator get_begin ()
STD_list< P >::iterator get_end ()
STD_list< P >::const_iterator get_const_begin () const
STD_list< P >::const_iterator get_const_end () const

Public Attributes

STD_list< P >::iterator iter
STD_list< P >::const_iterator constiter

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>
List< I, P, R >::List (  )  [inline]

Constructs an empty List

Definition at line 146 of file tjlist.h.

template<class I, class P, class R>
List< I, P, R >::~List (  )  [inline]

Destructor

Definition at line 156 of file tjlist.h.


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]

Removes all items from the list

Reimplemented in SeqMethod, and SeqSimultanVector.

Definition at line 180 of file tjlist.h.

template<class I, class P, class R>
List& List< I, P, R >::append ( 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 ( 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>
STD_list<P>::const_iterator List< I, P, R >::constiter [mutable]

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  doxygen 1.5.1