UT_COWHandle< Data > Class Template Reference

#include <UT_COW.h>

List of all members.

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.
void copy (Data *src)
void steal (Data *src)
void resetHandle ()

Friends

class UT_COWReadHandle
 Grant our friends direct access.
class UT_COWWriteHandle


Detailed Description

template<typename Data>
class UT_COWHandle< Data >

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 53 of file UT_COW.h.


Constructor & Destructor Documentation

template<typename Data>
UT_COWHandle< Data >::UT_COWHandle (  )  [inline]

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

         UT_COWHandle<Type>  handle;
         handle.steal( new Type(...) );

Definition at line 61 of file UT_COW.h.

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

Definition at line 66 of file UT_COW.h.

template<typename Data>
virtual UT_COWHandle< Data >::~UT_COWHandle (  )  [inline, virtual]

Definition at line 73 of file UT_COW.h.


Member Function Documentation

template<typename Data>
void UT_COWHandle< Data >::allocate (  )  [inline]

Calls the default constructor on the object.

Definition at line 92 of file UT_COW.h.

template<typename Data>
void UT_COWHandle< Data >::copy ( 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 101 of file UT_COW.h.

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

Definition at line 79 of file UT_COW.h.

template<typename Data>
void UT_COWHandle< Data >::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 118 of file UT_COW.h.

template<typename Data>
void UT_COWHandle< Data >::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 110 of file UT_COW.h.


Friends And Related Function Documentation

template<typename Data>
friend class UT_COWReadHandle [friend]

Grant our friends direct access.

Definition at line 147 of file UT_COW.h.

template<typename Data>
friend class UT_COWWriteHandle [friend]

Definition at line 148 of file UT_COW.h.


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

Generated on Mon Jan 28 00:30:06 2013 for HDK by  doxygen 1.5.9