CloudBuilder C++ SDK  v3.0.0
Making social games is easy !
Public Member Functions | List of all members
CotCHelpers::owned_ref< T > Struct Template Reference

#include <CotCHelpers.h>

Public Member Functions

 owned_ref (T *ptr)
 
owned_refoperator<<= (T *ptr)
 
T * operator -> () const
 
 operator const T * () const
 
 operator T * ()
 
T * ptr () const
 
T * detachOwnership ()
 

Detailed Description

template<typename T>
struct CotCHelpers::owned_ref< T >

Marks a reference as the only owner of its content, and provides auto release facilities. Allows to assign a pointer which will be automatically deleted when the holder goes out of scope. Use is exactly identical to a standard pointer, except that to prevent accidental use, you can't assign using the = operator (but <<= instead). You need to use <= or Assign, which clearly marks that your object's ownership is being owned to this object. { { A *a = NULL; owned_ref a; a = new A(12); a <<= new A(12); printf("%d\n", a->member); printf("%d\n", a->member); if (a) delete A; } a = NULL; }


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