OSB_LIB::PtrList< T, Cont > Struct Template Reference

Collaboration diagram for OSB_LIB::PtrList< T, Cont >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T, typename Cont = std::list<T*>>
struct OSB_LIB::PtrList< T, Cont >

Support to store pointers in STL containters.

Parameters:
T Defines the type to store in the containter.
It must provide a function std::auto_ptr<T> clone() const.
Cont Defines which STL container to use.
This template class is a beta version: the interface and functionality may change as further needs are found.
In particular no specialization for std::map exists.

Definition at line 71 of file osbptrlist.h.

Public Types

Public Member Functions

Private Attributes


Member Typedef Documentation

template<typename T, typename Cont = std::list<T*>>
typedef std::auto_ptr<T> OSB_LIB::PtrList< T, Cont >::AutoPtr

Auto-pointer for the stored type.

Definition at line 80 of file osbptrlist.h.

template<typename T, typename Cont = std::list<T*>>
typedef Cont::const_iterator OSB_LIB::PtrList< T, Cont >::ConstIter

Alias for the container const iterator.

Definition at line 78 of file osbptrlist.h.

template<typename T, typename Cont = std::list<T*>>
typedef Cont::iterator OSB_LIB::PtrList< T, Cont >::Iter

Alias for the container iterator.

Definition at line 76 of file osbptrlist.h.

template<typename T, typename Cont = std::list<T*>>
typedef Cont::size_type OSB_LIB::PtrList< T, Cont >::Size

Alias for the container size.

Definition at line 74 of file osbptrlist.h.


Constructor & Destructor Documentation

template<typename T, typename C>
OSB_LIB::PtrList< T, C >::PtrList (  )  [inline]

Empty constructor.

Definition at line 128 of file osbptrlist.h.

template<typename T, typename C>
OSB_LIB::PtrList< T, C >::~PtrList (  ) 

Destructor: delete all elements in cont_.

Definition at line 133 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

template<typename T, typename C>
OSB_LIB::PtrList< T, C >::PtrList ( const PtrList< T, Cont > &  rhs  ) 

Copy constructor: clone the members of cont_.

Definition at line 143 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::begin(), OSB_LIB::PtrList< T, Cont >::cont_, OSB_LIB::PtrList< T, Cont >::end(), and OSB_LIB::PtrList< T, Cont >::pushBack().


Member Function Documentation

template<typename T, typename C>
PtrList< T, C >::ConstIter OSB_LIB::PtrList< T, C >::begin (  )  const [inline]

Get const iterator to the beginning of cont_.

Definition at line 183 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

template<typename T, typename C>
PtrList< T, C >::Iter OSB_LIB::PtrList< T, C >::begin (  )  [inline]

Get iterator to the beginning of cont_.

Definition at line 177 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

Referenced by OSB_LIB::PtrList< T, Cont >::PtrList().

template<typename T, typename C>
bool OSB_LIB::PtrList< T, C >::empty (  )  const [inline]

STL container empty?

Definition at line 165 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

template<typename T, typename C>
PtrList< T, C >::ConstIter OSB_LIB::PtrList< T, C >::end (  )  const [inline]

Get const iterator to the end of cont_.

Definition at line 195 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

template<typename T, typename C>
PtrList< T, C >::Iter OSB_LIB::PtrList< T, C >::end (  )  [inline]

Get iterator to the end of cont_.

Definition at line 189 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

Referenced by OSB_LIB::PtrList< T, Cont >::PtrList().

template<typename T, typename C>
PtrList< T, C >::Iter OSB_LIB::PtrList< T, C >::erase ( Iter  pos  ) 

Erase an element.

Parameters:
pos Iterator to element to erase.
Returns:
Iterator to the next element.

Definition at line 208 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

template<typename T, typename C>
PtrList< T, C > & OSB_LIB::PtrList< T, C >::operator= ( const PtrList< T, Cont > &  rhs  ) 

Assignment: creates a copy of rhs and calls swap().

Definition at line 155 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::swap().

template<typename T, typename C>
void OSB_LIB::PtrList< T, C >::pushBack ( AutoPtr  e  ) 

Add an element.

Definition at line 201 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

Referenced by OSB_LIB::PtrList< T, Cont >::PtrList().

template<typename T, typename C>
PtrList< T, C >::Size OSB_LIB::PtrList< T, C >::size (  )  const [inline]

Size of STL container.

Definition at line 171 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

template<typename T, typename C>
void OSB_LIB::PtrList< T, C >::swap ( PtrList< T, Cont > &  other  )  [inline]

Swap cont_ with another pointer list.

Definition at line 216 of file osbptrlist.h.

References OSB_LIB::PtrList< T, Cont >::cont_.

Referenced by OSB_LIB::PtrList< T, Cont >::operator=().


Member Data Documentation

template<typename T, typename Cont = std::list<T*>>
Cont OSB_LIB::PtrList< T, Cont >::cont_ [private]

STL container to store the elements.

Definition at line 120 of file osbptrlist.h.

Referenced by OSB_LIB::PtrList< T, Cont >::begin(), OSB_LIB::PtrList< T, Cont >::empty(), OSB_LIB::PtrList< T, Cont >::end(), OSB_LIB::PtrList< T, Cont >::erase(), OSB_LIB::PtrList< T, Cont >::PtrList(), OSB_LIB::PtrList< T, Cont >::pushBack(), OSB_LIB::PtrList< T, Cont >::size(), OSB_LIB::PtrList< T, Cont >::swap(), and OSB_LIB::PtrList< T, Cont >::~PtrList().


The documentation for this struct was generated from the following file:
Generated on Sat Sep 2 14:12:17 2006 for OSB Library by  doxygen 1.4.7