FbxSharedPtr< Type, Policy > Class Template Reference

FbxSharedPtr< Type, Policy > Class Template Reference
+ This reference page is linked to from the following overview topics:

#include <fbxalloc.h>

Class Description

template<class Type, class Policy = FbxDeletionPolicyDefault<Type>>
class FbxSharedPtr< Type, Policy >

Definition at line 292 of file fbxalloc.h.

Public Member Functions

 FbxSharedPtr ()
 
 FbxSharedPtr (Type *pPtr)
 Construct from a pointer. More...
 
 FbxSharedPtr (const FbxSharedPtr &pSPtr)
 Copy constructor. More...
 
FbxSharedPtroperator= (const FbxSharedPtr &pSPtr)
 
 ~FbxSharedPtr ()
 Destructor. More...
 
void Destroy ()
 
Type * Get () const
 Retrieve the pointer it holds. More...
 
Type * operator-> () const
 Member access operator. More...
 
 operator Type * () const
 Convert to a Type pointer. More...
 
Type & operator* () const
 Dereference operator. More...
 
bool operator! () const
 Logical not operator. More...
 
 operator bool () const
 Convert to boolean value. More...
 

Constructor & Destructor Documentation

FbxSharedPtr ( )
inline

Definition at line 296 of file fbxalloc.h.

296  :
297  mPtr(0),
298  mRef(0)
299  {}
FbxSharedPtr ( Type *  pPtr)
inlineexplicit

Construct from a pointer.

Definition at line 302 of file fbxalloc.h.

302  :
303  mPtr(pPtr),
304  mRef(0)
305  {
306  if (pPtr != 0)
307  {
308  mRef = (RefCount*)FbxMalloc(sizeof(RefCount));
309  mRef->Init();
310  mRef->IncRef();
311  }
312  }
FbxSharedPtr class describes an object that stores a pointer to a single allocated object of type Typ...
Definition: fbxalloc.h:278
FbxSharedPtr ( const FbxSharedPtr< Type, Policy > &  pSPtr)
inline

Copy constructor.

Definition at line 315 of file fbxalloc.h.

315  :
316  mPtr(pSPtr.mPtr),
317  mRef(pSPtr.mRef)
318  {
319  if (pSPtr.mPtr != 0 && mRef != 0)
320  mRef->IncRef();
321  }
~FbxSharedPtr ( )
inline

Destructor.

Definition at line 342 of file fbxalloc.h.

342 { Destroy(); }
void Destroy()
Definition: fbxalloc.h:344

Member Function Documentation

FbxSharedPtr& operator= ( const FbxSharedPtr< Type, Policy > &  pSPtr)
inline

Definition at line 324 of file fbxalloc.h.

325  {
326  if (this != &pSPtr) // avoid self assignment
327  {
328  Reset();
329 
330  if (pSPtr.mPtr)
331  {
332  mPtr = pSPtr.mPtr;
333  mRef = pSPtr.mRef;
334  FBX_ASSERT(mRef != NULL);
335  mRef->IncRef();
336  }
337  }
338  return *this;
339  }
#define NULL
Definition: fbxarch.h:207
void Destroy ( )
inline

Definition at line 344 of file fbxalloc.h.

344 { Reset(); }
Type* Get ( ) const
inline

Retrieve the pointer it holds.

Definition at line 347 of file fbxalloc.h.

347 { return mPtr; }
Type* operator-> ( ) const
inline

Member access operator.

Definition at line 350 of file fbxalloc.h.

350 { return mPtr; }
operator Type * ( ) const
inline

Convert to a Type pointer.

Definition at line 353 of file fbxalloc.h.

353 { return mPtr; }
Type& operator* ( ) const
inline

Dereference operator.

Definition at line 356 of file fbxalloc.h.

356 { return *mPtr; }
bool operator! ( ) const
inline

Logical not operator.

Definition at line 359 of file fbxalloc.h.

359 { return mPtr == 0; }
operator bool ( ) const
inline

Convert to boolean value.

Definition at line 362 of file fbxalloc.h.

362 { return mPtr != 0; }

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