19 #ifndef __GU_DetailHandle__
20 #define __GU_DetailHandle__
28 class GU_DetailHandleRef;
61 uint hash()
const {
return SYSpointerHash(myHandle); }
70 bool isUnique()
const {
return getRefCount() <= 1; }
86 void allocateAndSet(
GU_Detail *gdp,
bool own=
true);
98 bool isValid()
const {
return !isNull(); }
104 int getRefCount()
const;
114 void addPreserveRequest();
115 void removePreserveRequest();
116 int getPreserveRequest()
const;
121 void addExternalReference();
122 void removeExternalReference();
123 int getExternalReference()
const;
129 int64 getMemoryUsage(
bool inclusive)
const;
157 bool hasActiveLock()
const;
161 int getLockCount()
const;
169 GU_DetailHandleRef *myHandle;
182 { myDetailHandle =
handle; }
191 {
return myDetailHandle == handle.myDetailHandle; }
193 {
return myDetailHandle != handle.myDetailHandle; }
195 uint hash()
const {
return myDetailHandle.hash(); }
198 { myDetailHandle.clear(); }
204 {
return myDetailHandle; }
216 {
return myDetailHandle.isNull(); }
219 {
return myDetailHandle.isValid(); }
226 {
return myDetailHandle.getRefCount(); }
234 { myDetailHandle.addPreserveRequest(); }
236 { myDetailHandle.removePreserveRequest(); }
238 {
return myDetailHandle.getPreserveRequest(); }
245 {
return myDetailHandle.getMemoryUsage(inclusive); }
253 {
return myDetailHandle.readLock(); }
261 { myDetailHandle.unlock(gdp); }
266 {
return myDetailHandle.getLockCount(); }
291 myGdp = myHandle.readLock();
296 myGdp = myHandle.readLock();
300 myHandle.unlock(myGdp);
326 myGdp = myHandle.writeLock();
330 myHandle.unlock(myGdp);
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()
int64 getMemoryUsage(bool inclusive) const
GU_ConstDetailHandle(const GU_DetailHandle &handle)
GU_DetailHandleAutoWriteLock(const GU_DetailHandle &handle)
GU_DetailHandleAutoReadLock(const GU_ConstDetailHandle &handle)
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
bool operator!=(const GU_ConstDetailHandle &handle) const
void unlock(const GU_Detail *gdp)
int getPreserveRequest() const
void addPreserveRequest()
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.