Public Member Functions | Protected Attributes

zeus::TValueTypeList< T, I > Class Template Reference

#include <ValueTypeList.hpp>

Inheritance diagram for zeus::TValueTypeList< T, I >:
zeus::IList< I > zeus::IValueType

List of all members.

Public Member Functions

virtual ~TValueTypeList ()
 Destructor (avoids waring C4265)
virtual Int MQUALIFIER add (const I &rItem)
virtual Int MQUALIFIER addAll (const IList< I > &rlstItems)
virtual Int MQUALIFIER addEmptyItem ()
virtual void MQUALIFIER copyToList (IList< I > &rList) const
virtual void MQUALIFIER clear ()
virtual Retval MQUALIFIER deleteItem (Int iIndex)
virtual Retval MQUALIFIER remove (const I &rItem)
virtual Retval MQUALIFIER removeAll (const IList< I > &rlstItems)
virtual Int MQUALIFIER getCount () const
virtual I &MQUALIFIER getItem (Int iIndex)
virtual const I &MQUALIFIER getItemConst (Int iIndex) const
virtual Int MQUALIFIER indexOf (const I &rItem) const
virtual Int MQUALIFIER insert (Int iIndex, const I &rItem)
virtual bool MQUALIFIER equalsItem (Int iIndex, const I &rItem) const
virtual bool MQUALIFIER equals (const IList< I > &rList) const
virtual IListIterator< I >
*MQUALIFIER 
getIterator () const
virtual const IListIterator< I >
*MQUALIFIER 
getConstIterator () const
virtual void MQUALIFIER releaseIterator (const IListIterator< I > *pIterator) const
virtual bool MQUALIFIER isEmpty () const
virtual I &MQUALIFIER getFirstItem ()
virtual const I &MQUALIFIER getFirstItemConst () const
virtual I &MQUALIFIER getLastItem ()
virtual const I &MQUALIFIER getLastItemConst () const
virtual bool MQUALIFIER hasItem (const I &rItem) const
virtual bool MQUALIFIER hasAllItems (const IList< I > &rlstItems) const
T & operator[] (Int iIndex)
const T & operator[] (Int iIndex) const

Protected Attributes

TSingleLinkedList< T > m_lstData
 internal list containing the data

Detailed Description

template<class T, class I>
class zeus::TValueTypeList< T, I >

template class implements a list based on a class "T". The class "T" implements the interface "I". This is put together to the list of "T" implementing the IList of "I"


Constructor & Destructor Documentation

template<class T , class I >
virtual zeus::TValueTypeList< T, I >::~TValueTypeList (  ) [inline, virtual]

Destructor (avoids waring C4265)


Member Function Documentation

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::add ( const I &  rItem ) [inline, virtual]

Adds an element to the list.

Precondition:
no precondition
Postcondition:
newSize = oldSize + 1 and element rItem on the place [Length-1]
Before: e0, e1, e2 ... en
After: e0, e1, e2 ... en, rItem
Parameters:
rItem: Item to add
Returns:
Position of the added item

Implements zeus::IList< I >.

template<class T , class I >
Int MQUALIFIER zeus::TValueTypeList< T, I >::addAll ( const IList< I > &  rlstItems ) [virtual]
See also:
IList::addAll

Implements zeus::IList< I >.

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::addEmptyItem (  ) [inline, virtual]

Adds an empty item to the list

Returns:
Position of the last item added

Implements zeus::IList< I >.

template<class T , class I >
virtual void MQUALIFIER zeus::TValueTypeList< T, I >::clear (  ) [inline, virtual]

Clears the list. All elements are removed from the list

Precondition:
no preconditions
Postcondition:
getSize() = 0

Implements zeus::IList< I >.

template<class T , class I >
void MQUALIFIER zeus::TValueTypeList< T, I >::copyToList ( IList< I > &  rList ) const [virtual]
See also:
IList::copyToList

Implements zeus::IList< I >.

template<class T , class I >
virtual Retval MQUALIFIER zeus::TValueTypeList< T, I >::deleteItem ( Int  iIndex ) [inline, virtual]

Removes an element out of the list

Precondition:
iIndex >= 0 and iIndex < Size
Postcondition:
newSize = oldSize - 1 and the Element[iIndex] was before at the place lIndex + 1
Before: e0, e1, ... iIndex, iIndex+1 ... en
After: e0, e1, ... iIndex+1, iIndex+2 ... en
Parameters:
iIndex: Index of the element to remove
Return values:
RET_NOERROR: Element removed
RET_REQUEST_FAILED,:Could not remove element

Implements zeus::IList< I >.

template<class T , class I >
bool MQUALIFIER zeus::TValueTypeList< T, I >::equals ( const IList< I > &  rList ) const [virtual]
See also:
IList::equals

Implements zeus::IList< I >.

template<class T , class I >
virtual bool MQUALIFIER zeus::TValueTypeList< T, I >::equalsItem ( Int  iIndex,
const I &  rItem 
) const [inline, virtual]

This method checks if an item is equal to an item inside this list

Parameters:
iIndex: Index of the item to be checked
rItem: Item to check
Return values:
true: Item is equal
false,:Item is not equal

Implements zeus::IList< I >.

template<class T , class I >
virtual const IListIterator<I>* MQUALIFIER zeus::TValueTypeList< T, I >::getConstIterator (  ) const [inline, virtual]

Returns the const iterator of this list object. This iterator is used to traverse the list. The iterator will be allocated inside this method and must be released through the method releaseIterator(). Its possible to use the method as nested calls. The order of the releasing doesn't has to mach the getIterator() calls.

Returns:
pointer to a allocated iterator.

Implements zeus::IList< I >.

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::getCount (  ) const [inline, virtual]

Returns the number of items

Returns:
number of items

Implements zeus::IList< I >.

template<class T , class I >
virtual I& MQUALIFIER zeus::TValueTypeList< T, I >::getFirstItem (  ) [inline, virtual]

returns the first item of the list

Returns:
first item

Implements zeus::IList< I >.

template<class T , class I >
virtual const I& MQUALIFIER zeus::TValueTypeList< T, I >::getFirstItemConst (  ) const [inline, virtual]

returns the first item of the list. The return value is const.

See also:
IList::getFirstItem

Implements zeus::IList< I >.

template<class T , class I >
virtual I& MQUALIFIER zeus::TValueTypeList< T, I >::getItem ( Int  iIndex ) [inline, virtual]

Returns the indexed item at position iIndex

Precondition:
iIndex >= 0 und iIndex < Size
Postcondition:
no changes on the list
Parameters:
iIndex: Index of requested item
Return values:
Emptyelement : Could not find the item at iIndex
Element[iIndex]: item at [iIndex]

Implements zeus::IList< I >.

template<class T , class I >
virtual const I& MQUALIFIER zeus::TValueTypeList< T, I >::getItemConst ( Int  iIndex ) const [inline, virtual]

Returns the indexed item at position iIndex. The return value is const.

See also:
IList::getItem

Implements zeus::IList< I >.

template<class T , class I >
virtual IListIterator<I>* MQUALIFIER zeus::TValueTypeList< T, I >::getIterator (  ) const [inline, virtual]

Returns the iterator of this list object. This iterator is used to traverse the list. The iterator will be allocated inside this method and must be released through the method releaseIterator(). Its possible to use the method as nested calls. The order of the releasing doesn't has to mach the getIterator() calls.

Returns:
pointer to a allocated iterator.

Implements zeus::IList< I >.

template<class T , class I >
virtual I& MQUALIFIER zeus::TValueTypeList< T, I >::getLastItem (  ) [inline, virtual]

returns the last item of the list

Returns:
last item

Implements zeus::IList< I >.

template<class T , class I >
virtual const I& MQUALIFIER zeus::TValueTypeList< T, I >::getLastItemConst (  ) const [inline, virtual]

returns the last item of the list. The return value is const.

See also:
IList::getLastItem

Implements zeus::IList< I >.

template<class T , class I >
bool MQUALIFIER zeus::TValueTypeList< T, I >::hasAllItems ( const IList< I > &  rlstItems ) const [virtual]
See also:
IList::hasAllItems

Implements zeus::IList< I >.

template<class T , class I >
virtual bool MQUALIFIER zeus::TValueTypeList< T, I >::hasItem ( const I &  rItem ) const [inline, virtual]

checks if the list contains an item

Parameters:
rItem,:item to check
Return values:
true: item is included by the list
false,:item is not included by the list

Implements zeus::IList< I >.

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::indexOf ( const I &  rItem ) const [inline, virtual]

returns the index of an item.

Parameters:
rItem: Item to check
Return values:
INVALID_INDEX: Item is not inserted in this list
>=0: Index of the item

Implements zeus::IList< I >.

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::insert ( Int  iIndex,
const I &  rItem 
) [inline, virtual]

Inserts an item into the list at position iIndex.

Precondition:
iIndex must be valid (>= 0).
Postcondition:
if iIndex = 0, then the rItem is placed in the front (prepend); if the iIndex == count, the item is placed at the end (append); else the rItem is placed at position iIndex:
Parameters:
rItem: Item to insert
iIndex: insert position
Return values:
INVALID_INDEX: Could not insert the element (invalid insert position)
>=0: Item inserted. The return value is the insert position

Implements zeus::IList< I >.

template<class T , class I >
virtual bool MQUALIFIER zeus::TValueTypeList< T, I >::isEmpty (  ) const [inline, virtual]

Checks if the list is empty

Return values:
true: List is empty
false: List is not empty

Implements zeus::IList< I >.

template<class T , class I >
T& zeus::TValueTypeList< T, I >::operator[] ( Int  iIndex ) [inline]
template<class T , class I >
const T& zeus::TValueTypeList< T, I >::operator[] ( Int  iIndex ) const [inline]
template<class T , class I >
virtual void MQUALIFIER zeus::TValueTypeList< T, I >::releaseIterator ( const IListIterator< I > *  pIterator ) const [inline, virtual]

This method releases a iterator object. This must be called after a call of getIterator(), otherwise it will cause a memory leak.

Parameters:
pIterator: Iterator to release.

Implements zeus::IList< I >.

template<class T , class I >
virtual Retval MQUALIFIER zeus::TValueTypeList< T, I >::remove ( const I &  rItem ) [inline, virtual]

Removes the element rItem out of the list.

Precondition:
no precondition
Postcondition:
see deleteItem()
Parameters:
rItem: Element to remove
Return values:
RET_NOERROR: Element removed
RET_REQUEST_FAILED,:Could not remove element

Implements zeus::IList< I >.

template<class T , class I >
Retval MQUALIFIER zeus::TValueTypeList< T, I >::removeAll ( const IList< I > &  rlstItems ) [virtual]
See also:
IList::removeAll

Implements zeus::IList< I >.


Member Data Documentation

template<class T , class I >
TSingleLinkedList<T> zeus::TValueTypeList< T, I >::m_lstData [protected]

internal list containing the data


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:41