HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_COWHandle< T > Class Template Reference

#include <DEP_ContextOptionsFwd.h>

Public Member Functions

 UT_COWHandle ()
 
 UT_COWHandle (const UT_COWHandle< Data > &src)
 
virtual ~UT_COWHandle ()
 
const UT_COWHandle< Data > & operator= (const UT_COWHandle< Data > &src)
 
void allocate ()
 Calls the default constructor on the object. More...
 
void copy (const Data *src)
 
void steal (Data *src)
 
void resetHandle ()
 
int getRefCount () const
 Returns the number of shared pointer references to the same Data. More...
 

Friends

template<typename OtherData >
class UT_COWReadHandle
 Grant our friends direct access. More...
 
template<typename OtherData >
class UT_COWTransientReadHandle
 
template<typename OtherData >
class UT_COWWriteHandle
 

Detailed Description

template<typename T>
class UT_COWHandle< T >

A plain handle is an opaque refernce to the data. You can't read or write to it with this sort of handle, but you can copy and store it. Assign a plain handle into a ReadHandle or a WriteHandle to gain more privelages.

Definition at line 18 of file DEP_ContextOptionsFwd.h.

Constructor & Destructor Documentation

template<typename T>
UT_COWHandle< T >::UT_COWHandle ( )
inline

Default constructor creates a null pointer. To assign the pointer:

handle.steal( new Type(...) );

Definition at line 51 of file UT_COW.h.

template<typename T>
UT_COWHandle< T >::UT_COWHandle ( const UT_COWHandle< Data > &  src)
inline

Definition at line 56 of file UT_COW.h.

template<typename T>
virtual UT_COWHandle< T >::~UT_COWHandle ( )
inlinevirtual

Definition at line 63 of file UT_COW.h.

Member Function Documentation

template<typename T>
void UT_COWHandle< T >::allocate ( )
inline

Calls the default constructor on the object.

Definition at line 82 of file UT_COW.h.

template<typename T>
void UT_COWHandle< T >::copy ( const Data *  src)
inline

Makes a copy of the source data. This is the safest approach as the caller will retain ownership.

Note
This uses the Data copy constructor.

Definition at line 91 of file UT_COW.h.

template<typename T>
int UT_COWHandle< T >::getRefCount ( ) const
inline

Returns the number of shared pointer references to the same Data.

Definition at line 115 of file UT_COW.h.

template<typename T>
const UT_COWHandle<Data>& UT_COWHandle< T >::operator= ( const UT_COWHandle< Data > &  src)
inline

Definition at line 69 of file UT_COW.h.

template<typename T>
void UT_COWHandle< T >::resetHandle ( )
inline

Turns us into a null pointer, a useful way to end our use of a handle without having to play weird scope games.

Definition at line 108 of file UT_COW.h.

template<typename T>
void UT_COWHandle< T >::steal ( Data *  src)
inline

Be careful when initializing using this function. The handle will gain ownership of the provided pointer, so the caller should cease referring to it.

Definition at line 100 of file UT_COW.h.

Friends And Related Function Documentation

template<typename T>
template<typename OtherData >
friend class UT_COWReadHandle
friend

Grant our friends direct access.

Definition at line 140 of file UT_COW.h.

template<typename T>
template<typename OtherData >
friend class UT_COWTransientReadHandle
friend

Definition at line 141 of file UT_COW.h.

template<typename T>
template<typename OtherData >
friend class UT_COWWriteHandle
friend

Definition at line 142 of file UT_COW.h.


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