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

#include <DEP_ContextOptionsFwd.h>

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. More...
 
bool isNull () const
 Test if this is a NULL pointer. More...
 
Data & operator* () const
 
Data * operator-> () const
 
Data * get () const
 
int getRefCount () const
 

Detailed Description

template<typename T>
class UT_COWWriteHandle< T >

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:
field3d/f3d_io.C, GEO/GEO_VoxelTranslator.C, standalone/gengeovolume.C, and standalone/geo2voxel.C.

Definition at line 17 of file DEP_ContextOptionsFwd.h.

Constructor & Destructor Documentation

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

Definition at line 338 of file UT_COW.h.

template<typename T>
UT_COWWriteHandle< T >::~UT_COWWriteHandle ( )
inline

Definition at line 343 of file UT_COW.h.

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

Definition at line 348 of file UT_COW.h.

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

Definition at line 354 of file UT_COW.h.

Member Function Documentation

template<typename T>
Data* UT_COWWriteHandle< T >::get ( ) const
inline
Examples:
field3d/f3d_io.C.

Definition at line 439 of file UT_COW.h.

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

Definition at line 449 of file UT_COW.h.

template<typename T>
bool UT_COWWriteHandle< T >::isNull ( ) const
inline

Test if this is a NULL pointer.

Definition at line 402 of file UT_COW.h.

template<typename T>
Data& UT_COWWriteHandle< T >::operator* ( ) const
inline

Definition at line 407 of file UT_COW.h.

template<typename T>
Data* UT_COWWriteHandle< T >::operator-> ( ) const
inline

Definition at line 426 of file UT_COW.h.

template<typename T>
const UT_COWWriteHandle<Data>& UT_COWWriteHandle< T >::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 363 of file UT_COW.h.

template<typename T>
const UT_COWWriteHandle<Data>& UT_COWWriteHandle< T >::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 380 of file UT_COW.h.

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

Turns this into a null handle to drop references.

Definition at line 395 of file UT_COW.h.


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