dtn::PointerList< T > Class Template Reference

#include <ProphetLists.h>

List of all members.


Detailed Description

template<class T>
class dtn::PointerList< T >

Auto deletes pointers in list destructor This object assumes ownership for member pointers Creates copies of members instead of copies of pointers to members.

Definition at line 88 of file ProphetLists.h.

Public Types

typedef std::vector< T * > List
typedef std::vector< T
* >::iterator 
iterator
typedef std::vector< T
* >::const_iterator 
const_iterator

Public Member Functions

 PointerList ()
 Default constructor.
 PointerList (const PointerList &a)
 Copy constructor.
virtual ~PointerList ()
 Destructor.
PointerListoperator= (const PointerList &a)
 Assignment operator creates deep copy, not pointer copy.
void erase (iterator i)
 Deletes member pointed to by iterator, then removes pointer.
void clear ()
 Delete all member variables, then remove pointers from container.

Protected Member Functions

void free ()
 Free memory pointed to by member variables.
void copy_from (const PointerList &a)
 Utility function to perform deep copy from peer object.


Member Typedef Documentation

template<class T>
typedef std::vector<T*> dtn::PointerList< T >::List

Definition at line 91 of file ProphetLists.h.

template<class T>
typedef std::vector<T*>::iterator dtn::PointerList< T >::iterator

Definition at line 92 of file ProphetLists.h.

template<class T>
typedef std::vector<T*>::const_iterator dtn::PointerList< T >::const_iterator

Definition at line 93 of file ProphetLists.h.


Constructor & Destructor Documentation

template<class T>
dtn::PointerList< T >::PointerList (  )  [inline]

Default constructor.

Definition at line 98 of file ProphetLists.h.

template<class T>
dtn::PointerList< T >::PointerList ( const PointerList< T > &  a  )  [inline]

Copy constructor.

Definition at line 104 of file ProphetLists.h.

References dtn::PointerList< T >::clear(), and dtn::PointerList< T >::copy_from().

template<class T>
virtual dtn::PointerList< T >::~PointerList (  )  [inline, virtual]

Destructor.

Definition at line 114 of file ProphetLists.h.

References dtn::PointerList< T >::clear().


Member Function Documentation

template<class T>
PointerList& dtn::PointerList< T >::operator= ( const PointerList< T > &  a  )  [inline]

Assignment operator creates deep copy, not pointer copy.

Definition at line 122 of file ProphetLists.h.

References dtn::PointerList< T >::clear(), and dtn::PointerList< T >::copy_from().

template<class T>
void dtn::PointerList< T >::erase ( iterator  i  )  [inline]

Deletes member pointed to by iterator, then removes pointer.

Definition at line 132 of file ProphetLists.h.

Referenced by dtn::BundleOfferList::remove_bundle().

template<class T>
void dtn::PointerList< T >::clear (  )  [inline]

Delete all member variables, then remove pointers from container.

Definition at line 142 of file ProphetLists.h.

References dtn::PointerList< T >::free().

Referenced by dtn::BundleOfferList::clear(), dtn::PointerList< T >::operator=(), dtn::PointerList< T >::PointerList(), dtn::BundleOfferList::~BundleOfferList(), and dtn::PointerList< T >::~PointerList().

template<class T>
void dtn::PointerList< T >::free (  )  [inline, protected]

Free memory pointed to by member variables.

Definition at line 152 of file ProphetLists.h.

References end.

Referenced by dtn::PointerList< T >::clear().

template<class T>
void dtn::PointerList< T >::copy_from ( const PointerList< T > &  a  )  [inline, protected]

Utility function to perform deep copy from peer object.

Definition at line 165 of file ProphetLists.h.

Referenced by dtn::PointerList< T >::operator=(), and dtn::PointerList< T >::PointerList().


The documentation for this class was generated from the following file:
Generated on Thu Jun 7 12:54:34 2007 for DTN Reference Implementation by  doxygen 1.5.1