GA_AttributeType Class Reference

#include <GA_AttributeType.h>

List of all members.

Classes

class  ValidatedPtr

Public Member Functions

 GA_AttributeType (const char *name)
virtual ~GA_AttributeType ()
GA_Attributecreate (const GA_IndexMap &index_map, GA_AttributeScope scope, const char *name, const UT_Options *creation_options, const UT_Options *attribute_options) const
bool recycleAttribute (GA_Attribute &attrib, const GA_ReuseStrategy &strategy, const char *requested_type, const UT_Options *creation_options, const UT_Options *attribute_options) const
const char * getTypeName () const
 Return information about the type.
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 char *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 char *name, const UT_Options *creation_options) const =0
 Allocate the attribute.
virtual bool recycle (GA_Attribute &attrib, const GA_ReuseStrategy &strategy, const UT_Options *creation_options) const =0

Friends

class GA_AIFDefinition


Detailed Description

Definition at line 46 of file GA_AttributeType.h.


Constructor & Destructor Documentation

GA_AttributeType::GA_AttributeType ( const char *  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 char *  name,
const UT_Options creation_options 
) const [protected, pure virtual]

Allocate the attribute.

GA_Attribute* GA_AttributeType::create ( const GA_IndexMap index_map,
GA_AttributeScope  scope,
const char *  name,
const UT_Options creation_options,
const UT_Options 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 char *  name  )  [static]

int GA_AttributeType::getTypeId (  )  const [inline]

Definition at line 80 of file GA_AttributeType.h.

const char* GA_AttributeType::getTypeName (  )  const [inline]

Return information about the type.

Definition at line 79 of file GA_AttributeType.h.

bool GA_AttributeType::isFactoryType (  )  const [inline]

Definition at line 82 of file GA_AttributeType.h.

bool GA_AttributeType::isStandardType (  )  const [inline]

Definition at line 83 of file GA_AttributeType.h.

bool GA_AttributeType::isTopologyType (  )  const [inline]

Definition at line 84 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 [protected, pure 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 char *  requested_type,
const UT_Options creation_options,
const UT_Options 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  )  [inline, static]

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 101 of file GA_AttributeType.h.


Friends And Related Function Documentation

friend class GA_AIFDefinition [friend]

Definition at line 157 of file GA_AttributeType.h.


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

Generated on Thu Jan 31 00:30:40 2013 for HDK by  doxygen 1.5.9