Menu

object::ConstantSizeList< T, N, callDestructor > Class Template Reference

ConstantSizeList is a simple abstraction of a list with a maximum length of N elements, supporting an iterator interface. More...

#include <ConstantSizeList.h>

Data Structures

class  ConstantSizeListIterator
 defines a usual iterator More...

Public Types

typedef T value_type
 Type definition of instatiated type.
typedef T * pointer
 Type definition of pointer to intantiated type.
typedef T & reference
 Type definition of a reference to intantiated type.
typedef ConstantSizeListIterator iterator

Public Member Functions

 ConstantSizeList ()
 ~ConstantSizeList ()
iterator begin ()
 Get an iterator which references this chain element.
iterator end ()
 Get an iterator which marks the end of the Chain.
void delElement (const T *value)
 Removes the specified element from the storage.
T * newElement ()
 Delivers a new Element.

Detailed Description

template<typename T, unsigned int N, bool callDestructor = true>
class object::ConstantSizeList< T, N, callDestructor >

ConstantSizeList is a simple abstraction of a list with a maximum length of N elements, supporting an iterator interface.

The N elements are allocated withing the list itself, thus none additional memory allocator facility is needed. Furthermore, it provides methodes for getting new elements and for the deletion of such one.

Template Parameters:
T is the element type that is stored
N is the count of elements that is stored
callDestructor enables switiching between the destruction of all objects residing in the underlying container or doing nothing, in order to safe program space. In embedded environments it is sometimes possible to forbear destruction.
Todo:
ConstantSizeList supports up to 255 elements, at the moment. To avoid false usage, the parameter N should be checked against this boundary, and if N is defined to high, a compile time error has to arise. It is also possible to invent an implementation, that configures automatically the correct types to circumvent the shortcoming.

Member Typedef Documentation

template<typename T , unsigned int N, bool callDestructor = true>
typedef ConstantSizeListIterator object::ConstantSizeList< T, N, callDestructor >::iterator
template<typename T , unsigned int N, bool callDestructor = true>
typedef T* object::ConstantSizeList< T, N, callDestructor >::pointer

Type definition of pointer to intantiated type.

template<typename T , unsigned int N, bool callDestructor = true>
typedef T& object::ConstantSizeList< T, N, callDestructor >::reference

Type definition of a reference to intantiated type.

template<typename T , unsigned int N, bool callDestructor = true>
typedef T object::ConstantSizeList< T, N, callDestructor >::value_type

Type definition of instatiated type.


Constructor & Destructor Documentation

template<typename T , unsigned int N, bool callDestructor = true>
object::ConstantSizeList< T, N, callDestructor >::ConstantSizeList (  )  [inline]

Member Function Documentation

template<typename T , unsigned int N, bool callDestructor = true>
iterator object::ConstantSizeList< T, N, callDestructor >::begin (  )  [inline]

Get an iterator which references this chain element.

Referenced by object::ConstantSizeList< T, N, callDestructor >::~ConstantSizeList().

template<typename T , unsigned int N, bool callDestructor = true>
void object::ConstantSizeList< T, N, callDestructor >::delElement ( const T *  value  )  [inline]

Removes the specified element from the storage.

Referenced by object::ConstantSizeList< T, N, callDestructor >::~ConstantSizeList().

template<typename T , unsigned int N, bool callDestructor = true>
iterator object::ConstantSizeList< T, N, callDestructor >::end (  )  [inline]

Get an iterator which marks the end of the Chain.

Referenced by object::ConstantSizeList< T, N, callDestructor >::~ConstantSizeList().

template<typename T , unsigned int N, bool callDestructor = true>
T* object::ConstantSizeList< T, N, callDestructor >::newElement (  )  [inline]

Delivers a new Element.

Returns:
a pointer to an element or Null pointer if there are no free elements

The documentation for this class was generated from the following file: