Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vector_ptr< T > Class Template Reference

Manages resources for an array of objects. More...

#include <smartptr.h>

Public Member Functions

 vector_ptr (size_t size=0)
 Construct an arry of T. More...
 
 ~vector_ptr ()
 
Toperator[] (size_t index)
 
const Toperator[] (size_t index) const
 
size_t size () const
 
void resize (size_t newSize)
 
 operator const void * () const
 
 operator void * ()
 
 operator const T * () const
 
 operator T * ()
 

Private Member Functions

 vector_ptr (const vector_ptr< T > &c)
 
void operator= (const vector_ptr< T > &x)
 

Private Attributes

size_t m_size
 
Tm_ptr
 

Detailed Description

template<class T>
class vector_ptr< T >

Manages resources for an array of objects.

Template Parameters
Tclass or type

vector_ptr is used frequently in the library to avoid large stack allocations, and manage resources and ensure cleanup under the RAII pattern (Resource Acquisition Is Initialization).

Definition at line 229 of file smartptr.h.

Constructor & Destructor Documentation

template<class T>
vector_ptr< T >::vector_ptr ( size_t  size = 0)
inline

Construct an arry of T.

Parameters
sizethe size of the array, in elements

If T is a Plain Old Dataype (POD), then the array is uninitialized.

Definition at line 235 of file smartptr.h.

template<class T>
vector_ptr< T >::~vector_ptr ( )
inline

Definition at line 237 of file smartptr.h.

template<class T>
vector_ptr< T >::vector_ptr ( const vector_ptr< T > &  c)
private

Member Function Documentation

template<class T>
vector_ptr< T >::operator const T * ( ) const
inline

Definition at line 265 of file smartptr.h.

template<class T>
vector_ptr< T >::operator const void * ( ) const
inline

Definition at line 260 of file smartptr.h.

template<class T>
vector_ptr< T >::operator T * ( )
inline

Definition at line 267 of file smartptr.h.

Here is the call graph for this function:

template<class T>
vector_ptr< T >::operator void * ( )
inline

Definition at line 262 of file smartptr.h.

template<class T>
void vector_ptr< T >::operator= ( const vector_ptr< T > &  x)
private
template<class T>
T& vector_ptr< T >::operator[] ( size_t  index)
inline

Definition at line 240 of file smartptr.h.

template<class T>
const T& vector_ptr< T >::operator[] ( size_t  index) const
inline

Definition at line 242 of file smartptr.h.

template<class T>
void vector_ptr< T >::resize ( size_t  newSize)
inline

Definition at line 246 of file smartptr.h.

template<class T>
size_t vector_ptr< T >::size ( ) const
inline

Definition at line 245 of file smartptr.h.

Member Data Documentation

template<class T>
T* vector_ptr< T >::m_ptr
private

Definition at line 276 of file smartptr.h.

template<class T>
size_t vector_ptr< T >::m_size
private

Definition at line 275 of file smartptr.h.


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