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

This class holds a reference to an attribute. Such an indirection level allows an easy way to invalidate attribute references when an attribute gets deleted (or when the detail itself is deleted). More...

#include <GA_AttributeProxy.h>

Public Member Functions

 GA_AttributeProxy (GA_Attribute *atr)
 Constructor. More...
 
 ~GA_AttributeProxy ()
 
SYS_FORCE_INLINE bool isValid () const
 Returns true if the proxy is still pointing to a valid attribute. More...
 
bool isLastReference () const
 Checks if there is only one reference to this proxy (held by the caller) More...
 
int64 getMemoryUsage (bool inclusive) const
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const
 
SYS_FORCE_INLINE void intrusive_ptr_release () const
 
SYS_FORCE_INLINE GA_AttributegetAttribute ()
 
SYS_FORCE_INLINE const
GA_Attribute
getAttribute () const
 

Friends

class GA_AttributeSet
 

Detailed Description

This class holds a reference to an attribute. Such an indirection level allows an easy way to invalidate attribute references when an attribute gets deleted (or when the detail itself is deleted).

Definition at line 30 of file GA_AttributeProxy.h.

Constructor & Destructor Documentation

GA_AttributeProxy::GA_AttributeProxy ( GA_Attribute atr)
explicit

Constructor.

GA_AttributeProxy::~GA_AttributeProxy ( )

Member Function Documentation

void GA_AttributeProxy::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const

Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)

NOTE: This treats GA_AttributeProxy as unshared, despite myReferenceCount, because the count should always be 1.

SYS_FORCE_INLINE GA_Attribute* GA_AttributeProxy::getAttribute ( )
inline

Obtains an actual attribute. May be NULL, if the attribute got deleted or was never actually found (or sussessfully created).

Definition at line 40 of file GA_AttributeProxy.h.

SYS_FORCE_INLINE const GA_Attribute* GA_AttributeProxy::getAttribute ( ) const
inline

Obtains an actual attribute. May be NULL, if the attribute got deleted or was never actually found (or sussessfully created).

Definition at line 42 of file GA_AttributeProxy.h.

int64 GA_AttributeProxy::getMemoryUsage ( bool  inclusive) const

Returns the memory footprint of the proxy and the attribute it represents.

SYS_FORCE_INLINE void GA_AttributeProxy::intrusive_ptr_release ( ) const
inline

Definition at line 72 of file GA_AttributeProxy.h.

bool GA_AttributeProxy::isLastReference ( ) const

Checks if there is only one reference to this proxy (held by the caller)

SYS_FORCE_INLINE bool GA_AttributeProxy::isValid ( ) const
inline

Returns true if the proxy is still pointing to a valid attribute.

Definition at line 47 of file GA_AttributeProxy.h.

Friends And Related Function Documentation

friend class GA_AttributeSet
friend

Definition at line 88 of file GA_AttributeProxy.h.


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