ZeusBase-Library  2.0.4
zeus::TValueTypeList< T, I > Class Template Reference

#include <ValueTypeList.hpp>

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

Public Member Functions

virtual ~TValueTypeList ()
 Destructor (avoids waring C4265) More...
 
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 More...
 

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

§ ~TValueTypeList()

template<class T , class I >
virtual zeus::TValueTypeList< T, I >::~TValueTypeList ( )
inlinevirtual

Destructor (avoids waring C4265)

Member Function Documentation

§ add()

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::add ( const I rItem)
inlinevirtual

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 >.

§ addAll()

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 >.

§ addEmptyItem()

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

Adds an empty item to the list

Returns
Position of the last item added

Implements zeus::IList< I >.

§ clear()

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

Clears the list. All elements are removed from the list

Precondition
no preconditions
Postcondition
getSize() = 0

Implements zeus::IList< I >.

§ copyToList()

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 >.

§ deleteItem()

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

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_FAILEDCould not remove element

Implements zeus::IList< I >.

§ equals()

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 >.

§ equalsItem()

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

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
falseItem is not equal

Implements zeus::IList< I >.

§ getConstIterator()

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

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 >.

§ getCount()

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

Returns the number of items

Returns
number of items

Implements zeus::IList< I >.

§ getFirstItem()

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

returns the first item of the list

Returns
first item

Implements zeus::IList< I >.

§ getFirstItemConst()

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

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

See also
IList::getFirstItem

Implements zeus::IList< I >.

§ getItem()

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

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 >.

§ getItemConst()

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

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

See also
IList::getItem

Implements zeus::IList< I >.

§ getIterator()

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

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 >.

§ getLastItem()

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

returns the last item of the list

Returns
last item

Implements zeus::IList< I >.

§ getLastItemConst()

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

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

See also
IList::getLastItem

Implements zeus::IList< I >.

§ hasAllItems()

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 >.

§ hasItem()

template<class T , class I >
virtual bool MQUALIFIER zeus::TValueTypeList< T, I >::hasItem ( const I rItem) const
inlinevirtual

checks if the list contains an item

Parameters
rItemitem to check
Return values
true: item is included by the list
falseitem is not included by the list

Implements zeus::IList< I >.

§ indexOf()

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::indexOf ( const I rItem) const
inlinevirtual

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 >.

§ insert()

template<class T , class I >
virtual Int MQUALIFIER zeus::TValueTypeList< T, I >::insert ( Int  iIndex,
const I rItem 
)
inlinevirtual

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 >.

§ isEmpty()

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

Checks if the list is empty

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

Implements zeus::IList< I >.

§ operator[]() [1/2]

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

§ operator[]() [2/2]

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

§ releaseIterator()

template<class T , class I >
virtual void MQUALIFIER zeus::TValueTypeList< T, I >::releaseIterator ( const IListIterator< I > *  pIterator) const
inlinevirtual

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 >.

§ remove()

template<class T , class I >
virtual Retval MQUALIFIER zeus::TValueTypeList< T, I >::remove ( const I rItem)
inlinevirtual

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_FAILEDCould not remove element

Implements zeus::IList< I >.

§ removeAll()

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

§ m_lstData

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:


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Tue Sep 13 2016 22:32:15