MIDataPtr< DataStruct > Class Template Reference
#include
<adskMIDataPtr.h>
List of all
members.
Detailed Description
template<typename DataStruct>
class MIDataPtr< DataStruct >
Smart pointer class that manages the accessing and unpinning of
mental ray database elements.
- Template Parameters:
-
|
DataStruct |
The type of the data the smart pointer will reference. |
|
Public Member Functions
|
|
MIDataPtr
() |
|
Default constructor.
|
|
MIDataPtr
(const miTag &pTag) |
|
Construct by database tag.
|
|
MIDataPtr
(DataStruct *pData, const miTag &pTag, bool
pBadEndian=false) |
|
Construct using pre-accessed data.
|
|
MIDataPtr
(const MIDataPtr
&pPtr) |
|
Copy constructor.
|
|
~MIDataPtr
() |
|
Destructor.
|
void |
set
(const miTag &pTag) |
|
Reinitialization with new database tag.
|
MIDataPtr<
DataStruct > & |
operator=
(const MIDataPtr
&pPtr) |
|
Assignment operator.
|
DataStruct * |
operator->
() |
|
Dereferencing operator.
|
DataStruct & |
operator[]
(int pIndex) |
|
Array access operator.
|
const DataStruct & |
operator[]
(int pIndex) const |
|
Const array access operator.
|
DataStruct * |
get
() const |
|
Pointer access.
|
const DataStruct * |
operator->
() const |
|
Const dereferencing operator.
|
bool |
isNull
() const |
|
Check pointer nullness.
|
bool |
badEndian
() const |
|
Get the endianness of the data.
|
|
operator
bool () const |
|
Implicit cast to bool.
|
void |
unbind
() |
|
Unreference pointed data.
|
Constructor & Destructor Documentation
template<typename DataStruct>
Construct by database tag.
- Parameters:
-
[in] |
pTag |
The miTag to look up. |
template<typename DataStruct>
MIDataPtr< DataStruct
>::MIDataPtr |
( |
DataStruct * |
pData, |
|
|
const miTag & |
pTag, |
|
|
bool |
pBadEndian = false |
|
|
) |
|
|
[inline] |
Construct using pre-accessed data.
- Parameters:
-
[in] |
pData |
The pre-accessed data. |
[in] |
pTag |
The miTag associated with the data. |
[in] |
pBadEndian |
True if an endian switch is necessary. |
template<typename DataStruct>
Copy constructor.
- Attention:
- This smart pointer passes ownership, so the smart pointer being
constructed from will no longer be valid.
- Parameters:
-
Member Function Documentation
template<typename DataStruct>
void MIDataPtr< DataStruct
>::set |
( |
const miTag & |
pTag |
) |
[inline] |
Reinitialization with new database tag.
- Parameters:
-
|
pTag |
The miTag to use for reinitialization. |
template<typename DataStruct>
Assignment operator.
- Attention:
- This smart pointer passes ownership, so the smart pointer being
assigned from will no longer be valid.
- Parameters:
-
template<typename DataStruct>
DataStruct* MIDataPtr< DataStruct
>::operator-> |
( |
|
) |
[inline] |
Dereferencing operator.
- Returns:
- The underlying pointer.
template<typename DataStruct>
DataStruct& MIDataPtr< DataStruct
>::operator[] |
( |
int |
pIndex |
) |
[inline] |
Array access operator.
- Parameters:
-
|
pIndex |
The index in the DataStruct array. Bounds checking is the
responsability of the user. |
- Returns:
- The array element.
template<typename DataStruct>
const DataStruct& MIDataPtr< DataStruct
>::operator[] |
( |
int |
pIndex |
) |
const [inline] |
Const array access operator.
- Parameters:
-
|
pIndex |
The index in the DataStruct array. Bounds checking is the
responsability of the user. |
- Returns:
- The (const) array element.
template<typename DataStruct>
DataStruct* MIDataPtr< DataStruct
>::get |
( |
|
) |
const [inline] |
Pointer access.
- Returns:
- The underlying pointer.
template<typename DataStruct>
const DataStruct* MIDataPtr< DataStruct
>::operator-> |
( |
|
) |
const [inline] |
Const dereferencing operator.
- Returns:
- The underlying (const) pointer.
template<typename DataStruct>
bool MIDataPtr< DataStruct
>::isNull |
( |
|
) |
const [inline] |
Check pointer nullness.
- Returns:
- True if the pointer is null.
template<typename DataStruct>
bool MIDataPtr< DataStruct
>::badEndian |
( |
|
) |
const [inline] |
Get the endianness of the data.
- Returns:
- True if the data has an endianness which needs to be
switched.
template<typename DataStruct>
MIDataPtr< DataStruct
>::operator bool |
( |
|
) |
const [inline] |
Implicit cast to bool.
- Returns:
- True if the pointer is non-null, false otherwise.