UT_COWWriteHandle< Data > Class Template Reference

#include <UT_COW.h>

List of all members.

Public Member Functions

 UT_COWWriteHandle ()
 ~UT_COWWriteHandle ()
 UT_COWWriteHandle (const UT_COWWriteHandle< Data > &src)
 UT_COWWriteHandle (UT_COWHandle< Data > *src)
const UT_COWWriteHandle< Data > & operator= (const UT_COWWriteHandle< Data > &src)
const UT_COWWriteHandle< Data > & operator= (UT_COWHandle< Data > *src)
void resetHandle ()
 Turns this into a null handle to drop references.
bool isNull () const
 Test if this is a NULL pointer.
Data & operator* () const
Data * operator-> () const


Detailed Description

template<typename Data>
class UT_COWWriteHandle< Data >

A write handle can be thought of as a pointer to the actual data. It allows you to modify the underlying data. To do this, it will unique the plain-handle's data so no outstanding readlocks will be affected by the writes.

Building read handles while a write handle is active is valid so long as no dereference occurs during the lifetime of the read handle.

Examples:

standalone/gengeovolume.C, and standalone/geo2voxel.C.

Definition at line 233 of file UT_COW.h.


Constructor & Destructor Documentation

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

Definition at line 236 of file UT_COW.h.

template<typename Data>
UT_COWWriteHandle< Data >::~UT_COWWriteHandle (  )  [inline]

Definition at line 241 of file UT_COW.h.

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

Definition at line 246 of file UT_COW.h.

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

Definition at line 252 of file UT_COW.h.


Member Function Documentation

template<typename Data>
bool UT_COWWriteHandle< Data >::isNull (  )  const [inline]

Test if this is a NULL pointer.

Definition at line 300 of file UT_COW.h.

template<typename Data>
Data& UT_COWWriteHandle< Data >::operator* ( void   )  const [inline]

Definition at line 305 of file UT_COW.h.

template<typename Data>
Data* UT_COWWriteHandle< Data >::operator-> ( void   )  const [inline]

Definition at line 324 of file UT_COW.h.

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

Converting from a handle into a write handle can only be done once. This prevents other threads or methods from invalidating our uniqueness property. Note we up case from a *pointer* to a UT_COWHandle, not from a UT_COWHandle. This avoids people accidentally using an temporary as the source and underlines that write handles are like pointers while read handles are like values.

Definition at line 278 of file UT_COW.h.

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

Passing write handles by value is fine as the users understand they all share the same underlying data, so is responsible for thread safety, etc.

Definition at line 261 of file UT_COW.h.

template<typename Data>
void UT_COWWriteHandle< Data >::resetHandle (  )  [inline]

Turns this into a null handle to drop references.

Definition at line 293 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