Nebula
Loading...
Searching...
No Matches
Attr::AttributeDefinitionBase Class Reference

#include <attributedefinitionbase.h>

Detailed Description

Implements a universal attribute definition, consisting of an attribute name, attribute fourcc code, value type and access type.

Inherited by Attr::AttributeDefinition< VALUETYPE, TYPE >.

Public Member Functions

 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, bool isDynamic)
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const byte &defVal, bool isDynamic)
 Constructor with default byte value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const short &defVal, bool isDynamic)
 Constructor with default short value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const ushort &defVal, bool isDynamic)
 Constructor with default ushort value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const int &defVal, bool isDynamic)
 Constructor with default int value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const uint &defVal, bool isDynamic)
 Constructor with default uint value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const int64_t &defVal, bool isDynamic)
 Constructor with default int64 value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const uint64_t &defVal, bool isDynamic)
 Constructor with default uint64 value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const float &defVal, bool isDynamic)
 Constructor with default float value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const double &defVal, bool isDynamic)
 Constructor with default double value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const bool &defVal, bool isDynamic)
 Constructor with default bool value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Math::vec2 &defVal, bool isDynamic)
 Constructor with default float2 value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Math::vec4 &defVal, bool isDynamic)
 Constructor with default float4 value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Math::quat &defVal, bool isDynamic)
 Constructor with default quaternion value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::String &defVal, bool isDynamic)
 Constructor with default string value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Math::mat4 &defVal, bool isDynamic)
 Constructor with default mat4 value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Math::transform44 &defVal, bool isDynamic)
 Constructor with default transform44 value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Blob &defVal, bool isDynamic)
 Constructor with default blob value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Guid &defVal, bool isDynamic)
 Constructor with default guid value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, void *defVal, bool isDynamic)
 Constructor with default void pointer value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< int > &defVal, bool isDynamic)
 Constructor with default int array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< float > &defVal, bool isDynamic)
 Constructor with default float array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< bool > &defVal, bool isDynamic)
 Constructor with default bool array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< Math::vec2 > &defVal, bool isDynamic)
 Constructor with default float2 array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< Math::vec4 > &defVal, bool isDynamic)
 Constructor with default float4 array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< Util::String > &defVal, bool isDynamic)
 Constructor with default string array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< Math::mat4 > &defVal, bool isDynamic)
 Constructor with default mat4 array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< Util::Blob > &defVal, bool isDynamic)
 Constructor with default blob array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Array< Util::Guid > &defVal, bool isDynamic)
 Constructor with default guid array value.
 
 AttributeDefinitionBase (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, AccessMode accessMode, const Util::Variant &defVal, ValueType type, bool isDynamic)
 Constructor with default variant value.
 
 ~AttributeDefinitionBase ()
 destructor
 
bool IsDynamic () const
 return true if this is a dynamic attribute
 
const Util::StringGetName () const
 get attribute name
 
const Util::FourCCGetFourCC () const
 get fourcc code
 
const Util::StringGetTypeName () const
 get type name
 
const Util::VariantGetDefaultValue () const
 get default value
 
const uint GetSizeOfType () const
 get size of type in bytes
 
AccessMode GetAccessMode () const
 get access type
 
ValueType GetValueType () const
 get value type
 

Static Public Member Functions

static void Destroy ()
 static destruction method - call to cleanup the registry hashtable
 
static const AttributeDefinitionBaseFindByName (const Util::String &n)
 find by name
 
static const AttributeDefinitionBaseFindByFourCC (const Util::FourCC &fcc)
 find by FourCC
 
static void RegisterDynamicAttribute (const Util::String &name, const Util::String &typeName, const Util::FourCC &fourCC, ValueType valueType, AccessMode accessMode)
 register a dynamic attribute
 
static void ClearDynamicAttributes ()
 clear all dynamic attributes
 
static void InitializeRegistry ()
 setup registry if it doesn't exist
 

Protected Member Functions

void Register ()
 register an attribute definition
 

Private Member Functions

 AttributeDefinitionBase ()
 default constructor is private
 

Static Private Member Functions

static void CheckCreateNameRegistry ()
 check if name registry exists and create on demand
 
static void CheckCreateFourCCRegistry ()
 check if fourcc registry exists and create on demand
 
static void CheckCreateDynamicAttributesArray ()
 check if dynamic attribute array exists and create on demand
 

Private Attributes

Util::String name
 
Util::String typeName
 
Util::FourCC fourCC
 
AccessMode accessMode
 
Util::Variant defaultValue
 
const Attr::ValueType valueType
 
bool isDynamic
 

Static Private Attributes

static AttrExitHandler attrExitHandler
 
static Util::HashTable< Util::String, const AttributeDefinitionBase * > * NameRegistry = 0
 
static Util::Dictionary< Util::FourCC, const AttributeDefinitionBase * > * FourCCRegistry = 0
 
static Util::Array< const AttributeDefinitionBase * > * DynamicAttributes = 0
 

Friends

class AttrId
 

Constructor & Destructor Documentation

◆ AttributeDefinitionBase() [1/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
bool isDynamic )
explicit

◆ AttributeDefinitionBase() [2/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const byte & defVal,
bool isDynamic )
explicit

Constructor with default byte value.

◆ AttributeDefinitionBase() [3/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const short & defVal,
bool isDynamic )
explicit

Constructor with default short value.

◆ AttributeDefinitionBase() [4/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const ushort & defVal,
bool isDynamic )
explicit

Constructor with default ushort value.

◆ AttributeDefinitionBase() [5/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const int & defVal,
bool isDynamic )
explicit

Constructor with default int value.

◆ AttributeDefinitionBase() [6/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const uint & defVal,
bool isDynamic )
explicit

Constructor with default uint value.

◆ AttributeDefinitionBase() [7/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const int64_t & defVal,
bool isDynamic )
explicit

Constructor with default int64 value.

◆ AttributeDefinitionBase() [8/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const uint64_t & defVal,
bool isDynamic )
explicit

Constructor with default uint64 value.

◆ AttributeDefinitionBase() [9/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const float & defVal,
bool isDynamic )
explicit

Constructor with default float value.

◆ AttributeDefinitionBase() [10/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const double & defVal,
bool isDynamic )
explicit

Constructor with default double value.

◆ AttributeDefinitionBase() [11/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const bool & defVal,
bool isDynamic )
explicit

Constructor with default bool value.

◆ AttributeDefinitionBase() [12/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Math::vec2 & defVal,
bool isDynamic )
explicit

Constructor with default float2 value.

◆ AttributeDefinitionBase() [13/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Math::vec4 & defVal,
bool isDynamic )
explicit

Constructor with default float4 value.

◆ AttributeDefinitionBase() [14/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Math::quat & defVal,
bool isDynamic )
explicit

Constructor with default quaternion value.

◆ AttributeDefinitionBase() [15/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::String & defVal,
bool isDynamic )
explicit

Constructor with default string value.

◆ AttributeDefinitionBase() [16/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Math::mat4 & defVal,
bool isDynamic )
explicit

Constructor with default mat4 value.

◆ AttributeDefinitionBase() [17/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Math::transform44 & defVal,
bool isDynamic )
explicit

Constructor with default transform44 value.

◆ AttributeDefinitionBase() [18/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Blob & defVal,
bool isDynamic )
explicit

Constructor with default blob value.

◆ AttributeDefinitionBase() [19/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Guid & defVal,
bool isDynamic )
explicit

Constructor with default guid value.

◆ AttributeDefinitionBase() [20/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
void * defVal,
bool isDynamic )
explicit

Constructor with default void pointer value.

◆ AttributeDefinitionBase() [21/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< int > & defVal,
bool isDynamic )
explicit

Constructor with default int array value.

◆ AttributeDefinitionBase() [22/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< float > & defVal,
bool isDynamic )
explicit

Constructor with default float array value.

◆ AttributeDefinitionBase() [23/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< bool > & defVal,
bool isDynamic )
explicit

Constructor with default bool array value.

◆ AttributeDefinitionBase() [24/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< Math::vec2 > & defVal,
bool isDynamic )
explicit

Constructor with default float2 array value.

◆ AttributeDefinitionBase() [25/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< Math::vec4 > & defVal,
bool isDynamic )
explicit

Constructor with default float4 array value.

◆ AttributeDefinitionBase() [26/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< Util::String > & defVal,
bool isDynamic )
explicit

Constructor with default string array value.

◆ AttributeDefinitionBase() [27/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< Math::mat4 > & defVal,
bool isDynamic )
explicit

Constructor with default mat4 array value.

◆ AttributeDefinitionBase() [28/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< Util::Blob > & defVal,
bool isDynamic )
explicit

Constructor with default blob array value.

◆ AttributeDefinitionBase() [29/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Array< Util::Guid > & defVal,
bool isDynamic )
explicit

Constructor with default guid array value.

◆ AttributeDefinitionBase() [30/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
AccessMode accessMode,
const Util::Variant & defVal,
ValueType type,
bool isDynamic )
explicit

Constructor with default variant value.

◆ ~AttributeDefinitionBase()

Attr::AttributeDefinitionBase::~AttributeDefinitionBase ( )

destructor

◆ AttributeDefinitionBase() [31/31]

Attr::AttributeDefinitionBase::AttributeDefinitionBase ( )
private

default constructor is private

Member Function Documentation

◆ CheckCreateDynamicAttributesArray()

void Attr::AttributeDefinitionBase::CheckCreateDynamicAttributesArray ( )
staticprivate

check if dynamic attribute array exists and create on demand

Check if dynamic attrs array exists and create if necessary.

◆ CheckCreateFourCCRegistry()

void Attr::AttributeDefinitionBase::CheckCreateFourCCRegistry ( )
staticprivate

check if fourcc registry exists and create on demand

Check if fourcc registry exists and create if necessary.

◆ CheckCreateNameRegistry()

void Attr::AttributeDefinitionBase::CheckCreateNameRegistry ( )
staticprivate

check if name registry exists and create on demand

Check if name registry exists and create if necessary.

◆ ClearDynamicAttributes()

void Attr::AttributeDefinitionBase::ClearDynamicAttributes ( )
static

clear all dynamic attributes

This clears all dynamic attributes.

◆ Destroy()

void Attr::AttributeDefinitionBase::Destroy ( )
static

static destruction method - call to cleanup the registry hashtable

Cleanup the name registry!

◆ FindByFourCC()

const AttributeDefinitionBase * Attr::AttributeDefinitionBase::FindByFourCC ( const Util::FourCC & fcc)
inlinestatic

find by FourCC

◆ FindByName()

const AttributeDefinitionBase * Attr::AttributeDefinitionBase::FindByName ( const Util::String & n)
inlinestatic

find by name

◆ GetAccessMode()

AccessMode Attr::AttributeDefinitionBase::GetAccessMode ( ) const
inline

get access type

◆ GetDefaultValue()

const Util::Variant & Attr::AttributeDefinitionBase::GetDefaultValue ( ) const
inline

get default value

◆ GetFourCC()

const Util::FourCC & Attr::AttributeDefinitionBase::GetFourCC ( ) const
inline

get fourcc code

◆ GetName()

const Util::String & Attr::AttributeDefinitionBase::GetName ( ) const
inline

get attribute name

◆ GetSizeOfType()

const uint Attr::AttributeDefinitionBase::GetSizeOfType ( ) const
inline

get size of type in bytes

◆ GetTypeName()

const Util::String & Attr::AttributeDefinitionBase::GetTypeName ( ) const
inline

get type name

◆ GetValueType()

ValueType Attr::AttributeDefinitionBase::GetValueType ( ) const
inline

get value type

◆ InitializeRegistry()

void Attr::AttributeDefinitionBase::InitializeRegistry ( )
static

setup registry if it doesn't exist

◆ IsDynamic()

bool Attr::AttributeDefinitionBase::IsDynamic ( ) const
inline

return true if this is a dynamic attribute

◆ Register()

void Attr::AttributeDefinitionBase::Register ( )
protected

register an attribute definition

Register this static attribute definition in the name and fourcc registries.

Since the order of initialization is not defined for static objects we need to use pointers and creation-on-demand for the registry objects.

◆ RegisterDynamicAttribute()

void Attr::AttributeDefinitionBase::RegisterDynamicAttribute ( const Util::String & name,
const Util::String & typeName,
const Util::FourCC & fourCC,
ValueType valueType,
AccessMode accessMode )
static

register a dynamic attribute

This method registers a new dynamic attribut.

Friends And Related Symbol Documentation

◆ AttrId

friend class AttrId
friend

Member Data Documentation

◆ accessMode

AccessMode Attr::AttributeDefinitionBase::accessMode
private

◆ attrExitHandler

AttrExitHandler Attr::AttributeDefinitionBase::attrExitHandler
staticprivate

◆ defaultValue

Util::Variant Attr::AttributeDefinitionBase::defaultValue
private

◆ DynamicAttributes

Util::Array< const AttributeDefinitionBase * > * Attr::AttributeDefinitionBase::DynamicAttributes = 0
staticprivate

◆ fourCC

Util::FourCC Attr::AttributeDefinitionBase::fourCC
private

◆ FourCCRegistry

Util::Dictionary< Util::FourCC, const AttributeDefinitionBase * > * Attr::AttributeDefinitionBase::FourCCRegistry = 0
staticprivate

◆ isDynamic

bool Attr::AttributeDefinitionBase::isDynamic
private

◆ name

Util::String Attr::AttributeDefinitionBase::name
private

◆ NameRegistry

Util::HashTable< Util::String, const AttributeDefinitionBase * > * Attr::AttributeDefinitionBase::NameRegistry = 0
staticprivate

◆ typeName

Util::String Attr::AttributeDefinitionBase::typeName
private

◆ valueType

const Attr::ValueType Attr::AttributeDefinitionBase::valueType
private

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