ADTF  3.18.2
cDDLContainerNoClone< T >

Utility class that stores DDL entities. More...

Inheritance diagram for cDDLContainerNoClone< T >:
[legend]

Public Types

typedef T ** iterator
 iterator for DDL container
 
typedef T *const * const_iterator
 const iterator for DDL container
 

Public Member Functions

 cDDLContainerNoClone (bool bSorted=true)
 Constructor. More...
 
void Insert (T *pElem, int nPos=-1)
 Insert. More...
 
T * Find (const A_UTILS_NS::cString &strName)
 Finds an element by name. More...
 
iterator FindIt (const A_UTILS_NS::cString &strName)
 Finds an element by name. More...
 
const T * Find (const A_UTILS_NS::cString &strName) const
 Finds an element by name. More...
 
void CopyFromRef (cDDLContainerNoClone &oOther)
 Copies the pointers from the other container. More...
 
void Delete ()
 Deletes all stored items (by calling delete on the pointers)
 
void Sort ()
 Sort the items by name.
 
bool IsSorted () const
 Returns Whether or not the container is sorted by name or not. More...
 
iterator begin ()
 Returns an iterator to the first element. More...
 
const_iterator begin () const
 Returns an iterator to the first element. More...
 
iterator end ()
 Returns an iterator to the element after the last element. More...
 
const_iterator end () const
 Returns an iterator to the element after the last element. More...
 
void clear ()
 clears the container (does not destroy the elements)
 
iterator erase (iterator itPos)
 removes an element from the container More...
 
iterator erase (iterator itPosFirst, iterator itPosLast)
 removes a sequence of elements from the container More...
 
bool empty () const
 Returns whether the container is empty or not. More...
 
unsigned int size () const
 Returns the size of the container. More...
 
T *& operator[] (unsigned int nPos)
 random access operator. More...
 
T *const & operator[] (unsigned int nPos) const
 random access operator. More...
 
T *& at (unsigned int nPos)
 random access method. More...
 
T *const & at (unsigned int nPos) const
 random access method. More...
 

Private Attributes

std::vector< T * > m_vecPointers
 
bool m_bSorted
 

Detailed Description

template<typename T>
class adtf_ddl::cDDLContainerNoClone< T >

Utility class that stores DDL entities.

Definition at line 17 of file ddlcontainer.h.

Constructor & Destructor Documentation

◆ cDDLContainerNoClone()

cDDLContainerNoClone ( bool  bSorted = true)

Constructor.

Parameters
[in]bSortedwhether the items should be sorted by name (this improves access times)

Member Function Documentation

◆ at() [1/2]

T*& at ( unsigned int  nPos)

random access method.

Parameters
[in]nPosThe index of the element.
Returns
The element.

◆ at() [2/2]

T* const& at ( unsigned int  nPos) const

random access method.

Parameters
[in]nPosThe index of the element.
Returns
The element.

◆ begin() [1/2]

iterator begin ( )

Returns an iterator to the first element.

Returns
an iterator to the first element.

◆ begin() [2/2]

const_iterator begin ( ) const

Returns an iterator to the first element.

Returns
an iterator to the first element.

◆ CopyFromRef()

void CopyFromRef ( cDDLContainerNoClone< T > &  oOther)

Copies the pointers from the other container.

Parameters
[in]oOtherThge other container
Returns
void

◆ empty()

bool empty ( ) const

Returns whether the container is empty or not.

Returns
whether the container is empty or not.

◆ end() [1/2]

iterator end ( )

Returns an iterator to the element after the last element.

Returns
an iterator to the element after the last element.

◆ end() [2/2]

const_iterator end ( ) const

Returns an iterator to the element after the last element.

Returns
an iterator to the element after the last element.

◆ erase() [1/2]

iterator erase ( iterator  itPos)

removes an element from the container

Parameters
[in]itPosThe element which should be removed.
Returns
iterator to the element after the erased element.

◆ erase() [2/2]

iterator erase ( iterator  itPosFirst,
iterator  itPosLast 
)

removes a sequence of elements from the container

Parameters
itPosFirstthe first element to erase.
itPosLastthe first one that should not be erased.
Returns
iterator to the element after the erased elements.

◆ Find() [1/2]

T* Find ( const A_UTILS_NS::cString strName)

Finds an element by name.

Parameters
[in]strName
Returns
pointer to the element or NULL

◆ Find() [2/2]

const T* Find ( const A_UTILS_NS::cString strName) const

Finds an element by name.

Parameters
[in]strName
Returns
pointer to the element or NULL

◆ FindIt()

iterator FindIt ( const A_UTILS_NS::cString strName)

Finds an element by name.

Parameters
[in]strName
Returns
iterator to the element or end()

◆ Insert()

void Insert ( T *  pElem,
int  nPos = -1 
)

Insert.

Parameters
[in]pElemThe element to insert.
[in]nPosPosition to add the element
Returns
void

◆ IsSorted()

bool IsSorted ( ) const

Returns Whether or not the container is sorted by name or not.

Returns
whether or not the container is sorted by name or not.

◆ operator[]() [1/2]

T*& operator[] ( unsigned int  nPos)

random access operator.

Parameters
[in]nPosThe index of the element.
Returns
The element.

◆ operator[]() [2/2]

T* const& operator[] ( unsigned int  nPos) const

random access operator.

Parameters
[in]nPosThe index of the element.
Returns
The element.

◆ size()

unsigned int size ( ) const

Returns the size of the container.

Returns
the size of the container.