Artec 3D Scanning SDK
2.0
|
This class is intended for safe manipulation of arrays in terms of their life time. More...
#include <artec/sdk/base/TArrayRef.h>
Public Types | |
typedef T::elementType | elementType |
Public Types inherited from artec::sdk::base::TRef< T > | |
typedef T | base |
Public Member Functions | |
TArrayRef () | |
TArrayRef (T *p) | |
TArrayRef (const TRef< T > &p) | |
TArrayRef (const TArrayRef &p) | |
~TArrayRef () | |
int | size () const |
elementType & | operator[] (int i) const |
elementType * | getPointer () const |
TArrayRef & | operator= (T *p) |
TArrayRef & | operator= (const TRef< T > &p) |
TArrayRef & | operator= (const TArrayRef &p) |
Public Member Functions inherited from artec::sdk::base::TRef< T > | |
TRef (T *p=NULL) | |
TRef (const TRef< T > &p) | |
TRef (TRef< T > &&p) | |
~TRef () | |
operator bool () const | |
T * | operator-> () const |
operator T * () const | |
const T & | operator* () const |
T & | operator* () |
TRef< T > & | operator= (T *p) |
TRef< T > & | operator= (const TRef< T > &p) |
TRef< T > & | operator= (TRef< T > &&p) |
Move operator. More... | |
T ** | operator& () |
bool | operator== (T *p) const |
bool | operator!= (T *p) const |
void | attach (T *p) |
Attach to the interface pointer without calling addref() for it. More... | |
T * | detach () |
Detach the interface pointer without calling release() for it. More... | |
void | release () |
Protected Member Functions | |
void | keep () |
Protected Attributes | |
int | dataSize_ |
elementType * | dataPointer_ |
Protected Attributes inherited from artec::sdk::base::TRef< T > | |
T * | tObject_ |
Friends | |
template<class T2 > | |
ErrorCode | createArray (TArrayRef< T2 > &src, int elementsCount, bool zeroFill) |
template<class T2 > | |
ErrorCode | resizeArray (TArrayRef< T2 > &src, int elementsCount) |
template<class T2 > | |
ErrorCode | resizeArray (TArrayRef< T2 > &src, int elementsCount, bool zeroFill) |
This class is intended for safe manipulation of arrays in terms of their life time.
Those arrays should implement one of the IArrayXXX interfaces that provides reference counting support. TArrayRef objects should hold pointers to the instances of such classes. Below is an example of how to create an instance of the IArrayInt implementation: TArrayRef<IArrayInt> arrayInt; createArrayInt( &arrayInt, 100 ); Operator &() is overloaded so that createArrayInt() function can fill the passed TArrayRef with a newly created instance. At the very moment of definition TArrayRef object has a count of references equal to 1.
This class is similar to TRef, however, some important differences should be noted. TArrayRef class has the []() operator. In order to optimize and avoid excessive virtual calls, the array size and the data pointer are cached once the array is created. This is why the array instance cannot be replaced inside. Some TArrayRef operators are also private in order to prohibit their usage.
Definition at line 43 of file TArrayRef.h.
typedef T::elementType artec::sdk::base::TArrayRef< T >::elementType |
Definition at line 46 of file TArrayRef.h.
|
inline |
Definition at line 48 of file TArrayRef.h.
|
inline |
Definition at line 53 of file TArrayRef.h.
|
inline |
Definition at line 58 of file TArrayRef.h.
|
inline |
Definition at line 63 of file TArrayRef.h.
|
inline |
Definition at line 68 of file TArrayRef.h.
|
inline |
Definition at line 74 of file TArrayRef.h.
|
inlineprotected |
Definition at line 98 of file TArrayRef.h.
|
inline |
Definition at line 76 of file TArrayRef.h.
|
inline |
Definition at line 83 of file TArrayRef.h.
|
inline |
Definition at line 90 of file TArrayRef.h.
|
inline |
Definition at line 72 of file TArrayRef.h.
|
inline |
Definition at line 70 of file TArrayRef.h.
|
friend |
|
friend |
|
friend |
|
protected |
Definition at line 113 of file TArrayRef.h.
|
protected |
Definition at line 112 of file TArrayRef.h.