xoreos  0.0.5
Public Member Functions | List of all members
Common::PtrVector< T, Deallocator > Class Template Reference

A vector of pointer to objects, with automatic deletion. More...

#include <ptrvector.h>

Inheritance diagram for Common::PtrVector< T, Deallocator >:
Inheritance graph
[legend]
Collaboration diagram for Common::PtrVector< T, Deallocator >:
Collaboration graph
[legend]

Public Member Functions

 ~PtrVector ()
 
void clear ()
 
void pop_back ()
 
std::vector< T * >::iterator erase (typename std::vector< T *>::iterator position)
 
std::vector< T * >::iterator erase (typename std::vector< T *>::iterator first, typename std::vector< T *>::iterator last)
 
void resize (typename std::vector< T *>::size_type n, typename std::vector< T *>::value_type val=typename std::vector< T *>::value_type())
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 
void assign (typename std::vector< T *>::size_type n, const typename std::vector< T *>::value_type &val)
 

Detailed Description

template<typename T, class Deallocator = DeallocatorDefault>
class Common::PtrVector< T, Deallocator >

A vector of pointer to objects, with automatic deletion.

A PtrVector expects to hold sole ownership of its contents.

Note: when overwriting elements in a PtrVector using operator[], no automatic deletion can take place!

Definition at line 44 of file ptrvector.h.

Constructor & Destructor Documentation

◆ ~PtrVector()

template<typename T, class Deallocator = DeallocatorDefault>
Common::PtrVector< T, Deallocator >::~PtrVector ( )
inline

Definition at line 46 of file ptrvector.h.

Member Function Documentation

◆ assign() [1/2]

template<typename T, class Deallocator = DeallocatorDefault>
template<class InputIterator >
void Common::PtrVector< T, Deallocator >::assign ( InputIterator  first,
InputIterator  last 
)
inline

Definition at line 93 of file ptrvector.h.

◆ assign() [2/2]

template<typename T, class Deallocator = DeallocatorDefault>
void Common::PtrVector< T, Deallocator >::assign ( typename std::vector< T *>::size_type  n,
const typename std::vector< T *>::value_type &  val 
)
inline

Definition at line 98 of file ptrvector.h.

◆ clear()

template<typename T, class Deallocator = DeallocatorDefault>
void Common::PtrVector< T, Deallocator >::clear ( )
inline

◆ erase() [1/2]

template<typename T, class Deallocator = DeallocatorDefault>
std::vector<T *>::iterator Common::PtrVector< T, Deallocator >::erase ( typename std::vector< T *>::iterator  position)
inline

Definition at line 62 of file ptrvector.h.

◆ erase() [2/2]

template<typename T, class Deallocator = DeallocatorDefault>
std::vector<T *>::iterator Common::PtrVector< T, Deallocator >::erase ( typename std::vector< T *>::iterator  first,
typename std::vector< T *>::iterator  last 
)
inline

Definition at line 67 of file ptrvector.h.

◆ pop_back()

template<typename T, class Deallocator = DeallocatorDefault>
void Common::PtrVector< T, Deallocator >::pop_back ( )
inline

Definition at line 57 of file ptrvector.h.

Referenced by Common::PtrVector< Graphics::Aurora::TTFFont::Page >::resize().

Here is the caller graph for this function:

◆ resize()

template<typename T, class Deallocator = DeallocatorDefault>
void Common::PtrVector< T, Deallocator >::resize ( typename std::vector< T *>::size_type  n,
typename std::vector< T *>::value_type  val = typename std::vector<T *>::value_type() 
)
inline

The documentation for this class was generated from the following file: