FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxSharedPtr< Type, Policy > Class Template Reference

#include <fbxalloc.h>

Class Description

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

Definition at line 294 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() [1/3]

FbxSharedPtr ( )
inline

Definition at line 298 of file fbxalloc.h.

298  :
299  mPtr(0),
300  mRef(0)
301  {}

◆ FbxSharedPtr() [2/3]

FbxSharedPtr ( Type *  pPtr)
inlineexplicit

Construct from a pointer.

Definition at line 304 of file fbxalloc.h.

304  :
305  mPtr(pPtr),
306  mRef(0)
307  {
308  if (pPtr != 0)
309  {
310  mRef = (RefCount*)FbxMalloc(sizeof(RefCount));
311  mRef->Init();
312  mRef->IncRef();
313  }
314  }
FbxSharedPtr class describes an object that stores a pointer to a single allocated object of type Typ...
Definition: fbxalloc.h:280

◆ FbxSharedPtr() [3/3]

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

Copy constructor.

Definition at line 317 of file fbxalloc.h.

317  :
318  mPtr(pSPtr.mPtr),
319  mRef(pSPtr.mRef)
320  {
321  if (pSPtr.mPtr != 0 && mRef != 0)
322  mRef->IncRef();
323  }

◆ ~FbxSharedPtr()

~FbxSharedPtr ( )
inline

Destructor.

Definition at line 344 of file fbxalloc.h.

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

Member Function Documentation

◆ operator=()

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

Definition at line 326 of file fbxalloc.h.

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

◆ Destroy()

void Destroy ( )
inline

Definition at line 346 of file fbxalloc.h.

346 { Reset(); }

◆ Get()

Type* Get ( ) const
inline

Retrieve the pointer it holds.

Definition at line 349 of file fbxalloc.h.

349 { return mPtr; }

◆ operator->()

Type* operator-> ( ) const
inline

Member access operator.

Definition at line 352 of file fbxalloc.h.

352 { return mPtr; }

◆ operator Type *()

operator Type * ( ) const
inline

Convert to a Type pointer.

Definition at line 355 of file fbxalloc.h.

355 { return mPtr; }

◆ operator*()

Type& operator* ( ) const
inline

Dereference operator.

Definition at line 358 of file fbxalloc.h.

358 { return *mPtr; }

◆ operator!()

bool operator! ( ) const
inline

Logical not operator.

Definition at line 361 of file fbxalloc.h.

361 { return mPtr == 0; }

◆ operator bool()

operator bool ( ) const
inline

Convert to boolean value.

Definition at line 364 of file fbxalloc.h.

364 { return mPtr != 0; }

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