HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AttributeType Class Referenceabstract

#include <GA_AttributeType.h>

Public Member Functions

 GA_AttributeType (const UT_StringHolder &name)
 
virtual ~GA_AttributeType ()
 
GA_Attributecreate (const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, const UT_Options *creation_options, const GA_AttributeOptions *attribute_options) const
 
bool recycleAttribute (GA_Attribute &attrib, const GA_ReuseStrategy &strategy, const GA_AttributeType &requested_type, const UT_Options *creation_options, const GA_AttributeOptions *attribute_options) const
 
SYS_FORCE_INLINE const
UT_StringHolder
getTypeName () const
 Return information about the type. More...
 
SYS_FORCE_INLINE int getTypeId () const
 
bool isFactoryType () const
 
bool isStandardType () const
 
bool isTopologyType () const
 
virtual bool jsonLoadDeltaDefinition (UT_JSONParser &p, GA_AIFEditDelta *&delta) const
 

Static Public Member Functions

static const GA_AttributeTypefindType (const UT_StringRef &name)
 
template<typename AIF_TYPE >
static GA_AIFDefinition< AIF_TYPE > registerAIF (AIF_TYPE *default_impl)
 

Protected Member Functions

virtual GA_Attributealloc (const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, const UT_Options *creation_options) const =0
 Allocate the attribute. More...
 
virtual bool recycle (GA_Attribute &attrib, const GA_ReuseStrategy &strategy, const UT_Options *creation_options) const =0
 

Friends

template<typename AIF_TYPE >
class GA_AIFDefinition
 

Detailed Description

Definition at line 42 of file GA_AttributeType.h.

Constructor & Destructor Documentation

GA_AttributeType::GA_AttributeType ( const UT_StringHolder name)
virtual GA_AttributeType::~GA_AttributeType ( )
virtual

Member Function Documentation

virtual GA_Attribute* GA_AttributeType::alloc ( const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
const UT_Options creation_options 
) const
protectedpure virtual

Allocate the attribute.

GA_Attribute* GA_AttributeType::create ( const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
const UT_Options creation_options,
const GA_AttributeOptions attribute_options 
) const

Method to create and initialize a new attribute. The pure virtual alloc() method is used to allocate the attribute.

static const GA_AttributeType* GA_AttributeType::findType ( const UT_StringRef name)
static
SYS_FORCE_INLINE int GA_AttributeType::getTypeId ( ) const
inline

Definition at line 78 of file GA_AttributeType.h.

SYS_FORCE_INLINE const UT_StringHolder& GA_AttributeType::getTypeName ( ) const
inline

Return information about the type.

Definition at line 76 of file GA_AttributeType.h.

bool GA_AttributeType::isFactoryType ( ) const
inline

Definition at line 80 of file GA_AttributeType.h.

bool GA_AttributeType::isStandardType ( ) const
inline

Definition at line 81 of file GA_AttributeType.h.

bool GA_AttributeType::isTopologyType ( ) const
inline

Definition at line 82 of file GA_AttributeType.h.

virtual bool GA_AttributeType::jsonLoadDeltaDefinition ( UT_JSONParser p,
GA_AIFEditDelta *&  delta 
) const
virtual

This method is used to parse the GA_AIFEditDelta type arguments saved to a JSON stream in order to allocate the appropriate subclass. The type arguments should be stored as the next object. TODO: Maybe we should parse a UT_Options object externally and pass that in?

virtual bool GA_AttributeType::recycle ( GA_Attribute attrib,
const GA_ReuseStrategy strategy,
const UT_Options creation_options 
) const
protectedpure virtual

This method is the type-specific implementation of recycleAttribute().

Precondition
&attrib.getType() == this
bool GA_AttributeType::recycleAttribute ( GA_Attribute attrib,
const GA_ReuseStrategy strategy,
const GA_AttributeType requested_type,
const UT_Options creation_options,
const GA_AttributeOptions attribute_options 
) const

There may already be an attribute with the same name when we attempt to add a new attribute. Whenever possible we want to try to recycle the existing attribute, updating it for our current needs, instead of allocating a new attribute and copying any compatible values.

This method returns false whenever it was not possible to update the supplied attribute to meet the new requirements. The attribute may be partially modified even on failure.

Note
Always fails if findType(requested_type) != this, regardless of strategy.
template<typename AIF_TYPE >
static GA_AIFDefinition<AIF_TYPE> GA_AttributeType::registerAIF ( AIF_TYPE *  default_impl)
inlinestatic

This method is used to register a new AIF type. The returned object can be used to bind custom implementations to specific types and get the implementation bound to a given type. A default implementation can be specified during the registration that will be used for those types without an explicitly bound custom implementation.

Definition at line 99 of file GA_AttributeType.h.

Friends And Related Function Documentation

template<typename AIF_TYPE >
friend class GA_AIFDefinition
friend

Definition at line 144 of file GA_AttributeType.h.


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