Image Component Library (ICL)
Public Types | Public Member Functions | List of all members
icl::utils::SmartArray< T > Struct Template Reference

Specialization of the SmartPtrBase class for Arrays. More...

#include <SmartArray.h>

Inheritance diagram for icl::utils::SmartArray< T >:
icl::utils::SmartPtrBase< T, ArrayDelOp >

Public Types

typedef SmartPtrBase< T, ArrayDelOpsuper
 

Public Member Functions

 SmartArray ()
 creates a null pointer More...
 
template<class DerivedT >
 SmartArray (DerivedT *ptData, bool bOwn=true)
 gets pointer, ownership is passed optionally More...
 
 SmartArray (T *ptData, bool bOwn=true)
 gets pointer, ownership is passed optionally More...
 
template<class DerivedT >
 SmartArray (const SmartPtrBase< DerivedT, ArrayDelOp > &r)
 reference counting copy constructor More...
 
 SmartArray (const SmartPtrBase< T, ArrayDelOp > &r)
 reference counting copy constructor More...
 
T & operator[] (int idx)
 index access operator (no index checks) More...
 
const T & operator[] (int idx) const
 index access operator (const, no index checks) More...
 
- Public Member Functions inherited from icl::utils::SmartPtrBase< T, ArrayDelOp >
 SmartPtrBase ()
 e and c will become NULL More...
 
 SmartPtrBase (DerivedT *ptData, bool bOwn=true)
 ptData is given, reference counter is set to 1 More...
 
 SmartPtrBase (const SmartPtrBase< DerivedT, ArrayDelOp > &r)
 Create a copy of given smart pointer with more general type. More...
 
 SmartPtrBase (const SmartPtrBase< T, ArrayDelOp > &r)
 Create a copy of given smart pointer. More...
 
SmartPtrBase< T, ArrayDelOp > & operator= (const SmartPtrBase< DerivedT, ArrayDelOp > &r)
 sets the pointer to hold another reference More...
 
SmartPtrBase< T, ArrayDelOp > & operator= (const SmartPtrBase< T, ArrayDelOp > &r)
 explicit implmentation of the same type assignment operator More...
 
SmartPtrBase< T, ArrayDelOp > & operator= (DerivedT *p)
 allows for direct assignment of pointers to a SmartPtr object More...
 
SmartPtrBase< T, ArrayDelOp > & operator= (T *p)
 allows for direct assignment of pointers to a SmartPtr object More...
 
virtual ~SmartPtrBase ()
 decreases the reference counter (cleanup on demand) More...
 
T & operator * ()
 returns a reference of the currently hold element More...
 
const T & operator * () const
 returns a reference of the currently hold element (const) More...
 
T * get ()
 returns the pointer to the data More...
 
const T * get () const
 returns the pointer to the data (const) More...
 
T * operator-> ()
 returns the currently hold element More...
 
const T * operator-> () const
 returns the currently hold element (const) More...
 
 operator bool () const
 this may be used to check if * or -> operator may be used More...
 
int use_count () const
 current reference count More...
 
void setNull ()
 sets the smart pointer to null More...
 

Additional Inherited Members

- Protected Member Functions inherited from icl::utils::SmartPtrBase< T, ArrayDelOp >
void inc ()
 save reference counter increment More...
 
void dec ()
 save reference counter decrement (cleanup on demand) More...
 
void set (T *e, int *c, bool d)
 sets e and c More...
 
SmartPtrBase< T, ArrayDelOp > & assign (const SmartPtrBase< DerivedT, ArrayDelOp > &r)
 utility assignment method used in the SmartPtrBase assignment operators More...
 
- Protected Attributes inherited from icl::utils::SmartPtrBase< T, ArrayDelOp >
T * e
 
int * c
 
bool d
 

Detailed Description

template<class T>
struct icl::utils::SmartArray< T >

Specialization of the SmartPtrBase class for Arrays.

If the internal reference counter becomes 0, the contained data pointer is release using delete []

Member Typedef Documentation

◆ super

template<class T>
typedef SmartPtrBase<T,ArrayDelOp> icl::utils::SmartArray< T >::super

Constructor & Destructor Documentation

◆ SmartArray() [1/5]

template<class T>
icl::utils::SmartArray< T >::SmartArray ( )
inline

creates a null pointer

◆ SmartArray() [2/5]

template<class T>
template<class DerivedT >
icl::utils::SmartArray< T >::SmartArray ( DerivedT *  ptData,
bool  bOwn = true 
)
inline

gets pointer, ownership is passed optionally

◆ SmartArray() [3/5]

template<class T>
icl::utils::SmartArray< T >::SmartArray ( T *  ptData,
bool  bOwn = true 
)
inline

gets pointer, ownership is passed optionally

◆ SmartArray() [4/5]

template<class T>
template<class DerivedT >
icl::utils::SmartArray< T >::SmartArray ( const SmartPtrBase< DerivedT, ArrayDelOp > &  r)
inline

reference counting copy constructor

◆ SmartArray() [5/5]

template<class T>
icl::utils::SmartArray< T >::SmartArray ( const SmartPtrBase< T, ArrayDelOp > &  r)
inline

reference counting copy constructor

Member Function Documentation

◆ operator[]() [1/2]

template<class T>
T& icl::utils::SmartArray< T >::operator[] ( int  idx)
inline

index access operator (no index checks)

◆ operator[]() [2/2]

template<class T>
const T& icl::utils::SmartArray< T >::operator[] ( int  idx) const
inline

index access operator (const, no index checks)


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