HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_DetailHandleAutoReadLock Class Reference

#include <GU_DetailHandle.h>

+ Inheritance diagram for GU_DetailHandleAutoReadLock:

Public Member Functions

 GU_DetailHandleAutoReadLock (const GU_ConstDetailHandle &handle)
 
 GU_DetailHandleAutoReadLock (const GU_DetailHandle &handle)
 
 ~GU_DetailHandleAutoReadLock ()
 
bool isValid () const
 
const GU_DetailgetGdp () const
 
const GU_ConstDetailHandlehandle () const
 
const GU_Detailoperator-> () const
 
const GU_Detailoperator* () const
 
SYS_SAFE_BOOL operator bool () const
 Safe-bool operator to return whether the handle is valid. More...
 

Additional Inherited Members

- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Detailed Description

NOTE: Locking is no longer encouraged, and never was enforced. Use .gdp() instead.

GU_DetalHandleAutoFOOLock is a utility class to allow the easy extraction of const GU_Detail * from GU_DetailHandles. It uses the C++ scoping mechanism to make the locking & unlocking transparent to the caller. One can thus do: GU_DetailHandleAutoFOOLock gdl(sop->getCookedGeo()) const GU_Detail *gdp = gdl.getGdp(); The FOO = Read returns const GU_Details and does a read lock. The FOO = Write returns non-const GU_Details and does a write lock.

Examples:
field3d/ROP_Field3D.C, packedsphere/GT_GEOPackedSphere.C, packedsphere/GU_PackedSphere.C, SIM/SIM_SolverHair.C, SIM/SNOW_Solver.C, tetprim/GR_PrimTetra.C, and tetprim/GT_PrimTetra.C.

Definition at line 284 of file GU_DetailHandle.h.

Constructor & Destructor Documentation

GU_DetailHandleAutoReadLock::GU_DetailHandleAutoReadLock ( const GU_ConstDetailHandle handle)
inline

Definition at line 288 of file GU_DetailHandle.h.

GU_DetailHandleAutoReadLock::GU_DetailHandleAutoReadLock ( const GU_DetailHandle handle)
inline

Definition at line 293 of file GU_DetailHandle.h.

GU_DetailHandleAutoReadLock::~GU_DetailHandleAutoReadLock ( )
inline

Definition at line 298 of file GU_DetailHandle.h.

Member Function Documentation

const GU_Detail* GU_DetailHandleAutoReadLock::getGdp ( ) const
inline

Definition at line 304 of file GU_DetailHandle.h.

const GU_ConstDetailHandle& GU_DetailHandleAutoReadLock::handle ( ) const
inline

Definition at line 305 of file GU_DetailHandle.h.

bool GU_DetailHandleAutoReadLock::isValid ( ) const
inline

Definition at line 303 of file GU_DetailHandle.h.

SYS_SAFE_BOOL GU_DetailHandleAutoReadLock::operator bool ( ) const
inline

Safe-bool operator to return whether the handle is valid.

Definition at line 310 of file GU_DetailHandle.h.

const GU_Detail& GU_DetailHandleAutoReadLock::operator* ( ) const
inline

Definition at line 307 of file GU_DetailHandle.h.

const GU_Detail* GU_DetailHandleAutoReadLock::operator-> ( ) const
inline

Definition at line 306 of file GU_DetailHandle.h.


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