FBX C++ API Reference
FbxSharedPtr< Type, Policy > Class Template Reference

#include <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...
 

Detailed Description

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

Definition at line 310 of file fbxalloc.h.

Constructor & Destructor Documentation

FbxSharedPtr ( )
inline

Definition at line 314 of file fbxalloc.h.

314  :
315  mPtr(0),
316  mRef(0)
317  {}
FbxSharedPtr ( Type *  pPtr)
inlineexplicit

Construct from a pointer.

Definition at line 320 of file fbxalloc.h.

320  :
321  mPtr(pPtr),
322  mRef(0)
323  {
324  if (pPtr != 0)
325  {
326  mRef = (RefCount*)FbxMalloc(sizeof(RefCount));
327  mRef->Init();
328  mRef->IncRef();
329  }
330  }
FbxSharedPtr class describes an object that stores a pointer to a single allocated object of type Typ...
Definition: fbxalloc.h:296
FbxSharedPtr ( const FbxSharedPtr< Type, Policy > &  pSPtr)
inline

Copy constructor.

Definition at line 333 of file fbxalloc.h.

333  :
334  mPtr(pSPtr.mPtr),
335  mRef(pSPtr.mRef)
336  {
337  if (pSPtr.mPtr != 0 && mRef != 0)
338  mRef->IncRef();
339  }
~FbxSharedPtr ( )
inline

Destructor.

Definition at line 360 of file fbxalloc.h.

360 { Destroy(); }
void Destroy()
Definition: fbxalloc.h:362

Member Function Documentation

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

Definition at line 342 of file fbxalloc.h.

343  {
344  if (this != &pSPtr) // avoid self assignment
345  {
346  Reset();
347 
348  if (pSPtr.mPtr)
349  {
350  mPtr = pSPtr.mPtr;
351  mRef = pSPtr.mRef;
352  FBX_ASSERT(mRef != NULL);
353  mRef->IncRef();
354  }
355  }
356  return *this;
357  }
#define NULL
Definition: fbxarch.h:213
void Destroy ( )
inline

Definition at line 362 of file fbxalloc.h.

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

Retrieve the pointer it holds.

Definition at line 365 of file fbxalloc.h.

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

Member access operator.

Definition at line 368 of file fbxalloc.h.

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

Convert to a Type pointer.

Definition at line 371 of file fbxalloc.h.

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

Dereference operator.

Definition at line 374 of file fbxalloc.h.

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

Logical not operator.

Definition at line 377 of file fbxalloc.h.

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

Convert to boolean value.

Definition at line 380 of file fbxalloc.h.

380 { return mPtr != 0; }

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