ApparatusFramework::list< T, maxSize > Class Template Reference
[RT-STL]

#include <RT_STL/current/include/List.h>

List of all members.

Classes

class  iterator
struct  Node

Public Types

typedef T value_type
typedef int size_type
typedef int difference_type

Public Member Functions

 list ()
 list (int n, const T &val=T())
 list (const list &lvalue)
 list (iterator first, iterator last)
 ~list ()
T & front ()
T & back ()
void push_back (const T &val)
void pop_back ()
void push_front (const T &val)
void pop_front ()
void insert (iterator pos, const T &item)
void remove (const T &val)
void clear ()
void erase (const iterator pos)
void assign (const iterator first, const iterator last)
void unique ()
iterator begin () const
iterator end () const
bool empty () const
int size () const

Friends

class iterator

Detailed Description

template<class T, int maxSize>
class ApparatusFramework::list< T, maxSize >

The list class implements the equivalent of the list class defined in the standard template library. But our class does not use any dynamic memory allocation scheme. Therefore the additional template parameter maxSize defines the maximum number of elements the list can ever contain. On the other hand, we do not support allocators.

We support the same interface as the STL class. This feature allows an easy switch between the dynamic and the static bound list class.

Our list is implemented using a double linked list. Therefore inserting and removing elements is very efficient, as required by the definition of list.

Definition at line 67 of file List.h.


Member Typedef Documentation

template<class T, int maxSize>
typedef int ApparatusFramework::list< T, maxSize >::difference_type

The type for difference information.

Definition at line 103 of file List.h.

template<class T, int maxSize>
typedef int ApparatusFramework::list< T, maxSize >::size_type

The type for size information.

Definition at line 99 of file List.h.

template<class T, int maxSize>
typedef T ApparatusFramework::list< T, maxSize >::value_type

The type of an entry into this list.

Definition at line 95 of file List.h.


Constructor & Destructor Documentation

template<class T , int maxSize>
ApparatusFramework::list< T, maxSize >::list (  )  [inline]

constructors, destructors Constructs a new empty list object.

Definition at line 391 of file List.h.

template<class T, int maxSize>
ApparatusFramework::list< T, maxSize >::list ( int  n,
const T &  val = T() 
) [inline, explicit]

Constructs a new list object containing a repetition of n elements of value v.

Parameters:
n number of elements.
val initial value.

Definition at line 398 of file List.h.

template<class T, int maxSize>
ApparatusFramework::list< T, maxSize >::list ( const list< T, maxSize > &  lvalue  )  [inline]

The copy constructor constructs a new list object from an existing one.

Parameters:
lvalue list used to generate a new object.

Definition at line 419 of file List.h.

template<class T, int maxSize>
ApparatusFramework::list< T, maxSize >::list ( iterator  first,
iterator  last 
) [inline]

Constructs a new list object containing a sequence.

Parameters:
first first element of the sequence.
last last element of the sequence.

Definition at line 442 of file List.h.

template<class T , int maxSize>
ApparatusFramework::list< T, maxSize >::~list (  )  [inline]

Destroys the object and releases all the associated resources.

Definition at line 464 of file List.h.


Member Function Documentation

template<class T , int maxSize>
void ApparatusFramework::list< T, maxSize >::assign ( const iterator  first,
const iterator  last 
) [inline]

Replaces the sequence controlled by this object with the sequence [first, last).

Parameters:
first iterator where the assigned sequence starts (first element).
last points to the last element of the sequence to assign.

Definition at line 656 of file List.h.

template<class T , int maxSize>
T & ApparatusFramework::list< T, maxSize >::back (  )  [inline]

Returns the object stored at the front of the list.

Returns:
T& reference to the item at the given position.

Definition at line 475 of file List.h.

template<class T , int maxSize>
list< T, maxSize >::iterator ApparatusFramework::list< T, maxSize >::begin (  )  const [inline]

queries Returns an iterator pointing at the beginning of the container.

Returns:
iterator iterator to the beginning of the container.

Definition at line 683 of file List.h.

Referenced by ApparatusFramework::PriorityList< Timer, BBVPKG_PATTERNSERVICES_TIMERMGR_TIMERLIST_SIZE >::begin(), ApparatusFramework::PriorityList< Item, maxSize >::insert(), and ApparatusFramework::list< T, maxSize >::remove().

template<class T , int maxSize>
void ApparatusFramework::list< T, maxSize >::clear (  )  [inline]

Clears the whole content of the content.

Definition at line 611 of file List.h.

template<class T , int maxSize>
bool ApparatusFramework::list< T, maxSize >::empty (  )  const [inline]

True if the container is empty, false otherwise.

Returns:
bool result of the query.

Definition at line 703 of file List.h.

Referenced by ApparatusFramework::PriorityList< Item, maxSize >::empty().

template<class T , int maxSize>
list< T, maxSize >::iterator ApparatusFramework::list< T, maxSize >::end (  )  const [inline]

Returns an iterator pointing at the end of the container.

Returns:
iterator iterator to the end of the container.

Definition at line 693 of file List.h.

Referenced by ApparatusFramework::PriorityList< Timer, BBVPKG_PATTERNSERVICES_TIMERMGR_TIMERLIST_SIZE >::end(), ApparatusFramework::PriorityList< Item, maxSize >::insert(), and ApparatusFramework::list< T, maxSize >::remove().

template<class T , int maxSize>
void ApparatusFramework::list< T, maxSize >::erase ( const iterator  pos  )  [inline]

Removes the item at the position shown by the iterator.

Parameters:
pos iterator showing which item should be removed.

Definition at line 621 of file List.h.

Referenced by ApparatusFramework::list< T, maxSize >::remove().

template<class T , int maxSize>
T & ApparatusFramework::list< T, maxSize >::front (  )  [inline]

modifiers Returns the object stored at the front of the list.

Returns:
T& reference to the item at the given position.

Definition at line 468 of file List.h.

Referenced by ApparatusFramework::PriorityList< Item, maxSize >::front().

template<class T, int maxSize>
void ApparatusFramework::list< T, maxSize >::insert ( iterator  pos,
const T &  item 
) [inline]

Inserts at the given position the given item.

Parameters:
pos iterator indicating where the item should be inserted. We insert after this position.
item item to be inserted.

Definition at line 567 of file List.h.

Referenced by ApparatusFramework::PriorityList< Item, maxSize >::insert().

template<class T , int maxSize>
void ApparatusFramework::list< T, maxSize >::pop_back (  )  [inline]

Removes the item at the back of the container.

Definition at line 505 of file List.h.

template<class T , int maxSize>
void ApparatusFramework::list< T, maxSize >::pop_front (  )  [inline]

Removes the item at the front of the container.

Definition at line 545 of file List.h.

Referenced by ApparatusFramework::PriorityList< Item, maxSize >::pop_front().

template<class T, int maxSize>
void ApparatusFramework::list< T, maxSize >::push_back ( const T &  val  )  [inline]

Pushes the given item at the back of the container.

Parameters:
val item to be inserted at the back of the container.

Definition at line 482 of file List.h.

Referenced by ApparatusFramework::MultipleObservable< Event >::attach(), and ApparatusFramework::PriorityList< Item, maxSize >::insert().

template<class T, int maxSize>
void ApparatusFramework::list< T, maxSize >::push_front ( const T &  val  )  [inline]

Pushes the given item at the front of the container.

Parameters:
val item to be inserted at the front of the container.

Definition at line 522 of file List.h.

template<class T, int maxSize>
void ApparatusFramework::list< T, maxSize >::remove ( const T &  val  )  [inline]

Removes the given item if it is part of the container. If not found nothing is done.

Parameters:
val item be removed from the container.

Definition at line 597 of file List.h.

References ApparatusFramework::list< T, maxSize >::begin(), ApparatusFramework::list< T, maxSize >::end(), and ApparatusFramework::list< T, maxSize >::erase().

Referenced by ApparatusFramework::MultipleObservable< Event >::detach(), and ApparatusFramework::PriorityList< Item, maxSize >::remove().

template<class T , int maxSize>
int ApparatusFramework::list< T, maxSize >::size (  )  const [inline]

Returns the size of the container.

Returns:
int size of the containter.

Definition at line 709 of file List.h.

Referenced by ApparatusFramework::PriorityList< Item, maxSize >::size().

template<class T, int maxSize>
void ApparatusFramework::list< T, maxSize >::unique (  ) 

Removes from the controlled sequence every element that compares equal to its preceding element (not implemented so far).


Friends And Related Function Documentation

template<class T, int maxSize>
friend class iterator [friend]

Make friends with our iterator type.

Definition at line 87 of file List.h.

© 2004-2010 bbv Software Services AG / Apparatus Services