19 #ifndef __GU_DetailHandle__
20 #define __GU_DetailHandle__
32 class GU_DetailHandleRef;
65 uint hash()
const {
return SYSpointerHash(myHandle); }
74 bool isUnique()
const {
return getRefCount() <= 1; }
90 void allocateAndSet(
GU_Detail *gdp,
bool own=
true);
108 int getRefCount()
const;
118 void addPreserveRequest();
119 void removePreserveRequest();
120 int getPreserveRequest()
const;
125 void addExternalReference();
126 void removeExternalReference();
127 int getExternalReference()
const;
133 int64 getMemoryUsage(
bool inclusive)
const;
161 bool hasActiveLock()
const;
165 int getLockCount()
const;
173 GU_DetailHandleRef *myHandle;
186 { myDetailHandle = handle; }
190 myDetailHandle = handle;
195 {
return myDetailHandle == handle.myDetailHandle; }
197 {
return myDetailHandle != handle.myDetailHandle; }
199 uint hash()
const {
return myDetailHandle.hash(); }
202 { myDetailHandle.clear(); }
208 {
return myDetailHandle; }
220 {
return myDetailHandle.isNull(); }
223 {
return myDetailHandle.isValid(); }
230 {
return myDetailHandle.getRefCount(); }
238 { myDetailHandle.addPreserveRequest(); }
240 { myDetailHandle.removePreserveRequest(); }
242 {
return myDetailHandle.getPreserveRequest(); }
249 {
return myDetailHandle.getMemoryUsage(inclusive); }
257 {
return myDetailHandle.readLock(); }
265 { myDetailHandle.unlock(gdp); }
270 {
return myDetailHandle.getLockCount(); }
280 static void unregisterGeometries(
UT_IntArray ®istered);
316 myHandle.unlock(myGdp);
346 myHandle.unlock(myGdp);
365 template <
typename T>
struct DefaultClearer;
385 static const bool clearNeedsDestruction =
false;
406 static const bool clearNeedsDestruction =
false;
GU_Detail * getGdp() const
~GU_DetailHandleAutoReadLock()
const GU_DetailHandle & handle() const
bool isValid() const
Determine if this is a valid handle (!isNull())
GU_DetailHandle castAwayConst() const
const GU_Detail * readLock()
const GU_Detail * readLock()
int64 getMemoryUsage(bool inclusive) const
GU_ConstDetailHandle(const GU_DetailHandle &handle)
GU_DetailHandleAutoWriteLock(const GU_DetailHandle &handle)
GU_DetailHandleAutoReadLock(const GU_ConstDetailHandle &handle)
static void clearConstruct(GU_DetailHandle *p)
GU_Detail & operator*() const
GU_DetailHandle duplicateGeometry(GA_DataIdStrategy data_id_strategy=GA_DATA_ID_BUMP) const
const GU_Detail * gdp() const
Unlocked readable pointers.
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
int getRefCount() const
Returns the number of references made to the base handle.
const GU_ConstDetailHandle & handle() const
GU_Detail * operator->() const
static void clearConstruct(GU_ConstDetailHandle *p)
bool operator!=(const GU_ConstDetailHandle &handle) const
void unlock(const GU_Detail *gdp)
static bool isClear(const GU_DetailHandle &v)
static bool isClear(const GU_ConstDetailHandle &v)
static void clear(GU_ConstDetailHandle &v)
int getPreserveRequest() const
void addPreserveRequest()
static void clear(GU_DetailHandle &v)
const GU_Detail * operator->() const
~GU_DetailHandleAutoWriteLock()
LeafData & operator=(const LeafData &)=delete
bool operator==(const GU_ConstDetailHandle &handle) const
GU_DetailHandle getWriteableCopy(GA_DataIdStrategy data_id_strategy=GA_DATA_ID_BUMP) const
Create a writeable copy of the detail.
const GU_Detail & operator*() const
GU_DetailHandleAutoReadLock(const GU_DetailHandle &handle)
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void removePreserveRequest()
const GU_Detail * getGdp() const
const GU_ConstDetailHandle & operator=(const GU_DetailHandle &handle)
bool isValid() const
Check if this is a valid handle.