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

#include <PDG_AttributeData.h>

+ Inheritance diagram for PDG_AttributeData:

Public Member Functions

 PDG_AttributeData ()
 
virtual ~PDG_AttributeData ()
 
virtual int64 getMemoryUsage (bool inclusive) const =0
 Returns the memory usage of the attribute and its data. More...
 
virtual bool hash (SYS_HashType &hash_value, UT_WorkBuffer &errors) const =0
 Return a hash value derived from the attribute data. More...
 
virtual PDG_AttributeDataclone () const =0
 Deep copies this attribute. More...
 
virtual bool saveData (UT_JSONWriter &) const =0
 Serializes the data to a JSON writer. More...
 
virtual bool loadData (const UT_JSONValue &)=0
 Loads data from a JSON value. More...
 
virtual bool compare (const PDG_AttributeData *) const =0
 Compares this data object with another data object. More...
 
virtual PDG_AttributeMergeError merge (PDG_AttributeMergeOp merge_op, int stride)=0
 Applies a merge op to the data in this attribute. More...
 

Static Public Member Functions

static PDG_AttributeDatafromType (PDG_AttributeType type)
 
static PDG_EventType eventType (PDG_AttributeType type)
 Static utility for returnign an event from type from an attribute type. More...
 
static PDG_AttributeType typeFromString (const UT_StringHolder &type_name)
 Returns an attribute type enum from the specified string name. More...
 
static PDG_AttributeIntrinsic intrinsicFromName (const UT_StringRef &name)
 Returns an intrinsic type from an attribue name. More...
 
static UT_StringHolder nameFromIntrinsic (PDG_AttributeIntrinsic attrib_type, const UT_StringHolder &name)
 Returns an attribute name from a intrinsic type a name string. More...
 
static bool validName (const UT_StringHolder &str, bool allow_internal=false)
 
static bool makeValidName (UT_StringHolder &name, const UT_StringHolder &str, bool allow_internal=false)
 
static UT_StringHolder typeName (PDG_AttributeType type)
 Returns the string name for the specififed attribute type. More...
 
static UT_StringHolder mergeName (PDG_AttributeMergeOp merge)
 Returns the string name for the specified merge op. More...
 

Static Public Attributes

static constexpr PDG_AttributeType TypeEnum = PDG_AttributeType::eUndefined
 Attribute data version number. More...
 
static const UT_StringHolder theFlagKey
 
static const UT_StringHolder theTypeKey
 
static const UT_StringHolder theRuntimeKey
 
static const UT_StringHolder theConcatKey
 
static const UT_StringHolder theOwnKey
 
static const UT_StringHolder theValueKey
 

Static Protected Member Functions

static PDG_AttributeMergeError merge (UT_StringArray &data, PDG_AttributeMergeOp merge_op, int stride)
 Merge op utility for string array data. More...
 
static PDG_AttributeMergeError merge (PDG_File::Array &data, PDG_AttributeMergeOp merge_op, int stride)
 Merge op utility for file array data. More...
 
static PDG_AttributeMergeError merge (UT_ValArray< fpreal > &data, PDG_AttributeMergeOp merge_op, int stride)
 Merge op utility for float array data. More...
 
static PDG_AttributeMergeError merge (UT_ValArray< exint > &data, PDG_AttributeMergeOp merge_op, int stride)
 Merge op utility for int array data. More...
 

Detailed Description

Base class for all types of PDG attribute data

Definition at line 33 of file PDG_AttributeData.h.

Constructor & Destructor Documentation

PDG_AttributeData::PDG_AttributeData ( )

Constructs a new instance with a specified type and owning map, called by child classes.

virtual PDG_AttributeData::~PDG_AttributeData ( )
virtual

Member Function Documentation

virtual PDG_AttributeData* PDG_AttributeData::clone ( ) const
pure virtual
virtual bool PDG_AttributeData::compare ( const PDG_AttributeData ) const
pure virtual
static PDG_EventType PDG_AttributeData::eventType ( PDG_AttributeType  type)
static

Static utility for returnign an event from type from an attribute type.

static PDG_AttributeData* PDG_AttributeData::fromType ( PDG_AttributeType  type)
static

Static utility for constructing an attribute of the specified type, used during deserialization

virtual int64 PDG_AttributeData::getMemoryUsage ( bool  inclusive) const
pure virtual
virtual bool PDG_AttributeData::hash ( SYS_HashType hash_value,
UT_WorkBuffer errors 
) const
pure virtual
static PDG_AttributeIntrinsic PDG_AttributeData::intrinsicFromName ( const UT_StringRef name)
static

Returns an intrinsic type from an attribue name.

virtual bool PDG_AttributeData::loadData ( const UT_JSONValue )
pure virtual
static bool PDG_AttributeData::makeValidName ( UT_StringHolder name,
const UT_StringHolder str,
bool  allow_internal = false 
)
static

Forces the string into a valid attribute name as described above, and returns true if any changes were made. If allow_internal is false then a __pdg prefix is replaced with __.

virtual PDG_AttributeMergeError PDG_AttributeData::merge ( PDG_AttributeMergeOp  merge_op,
int  stride 
)
pure virtual
static PDG_AttributeMergeError PDG_AttributeData::merge ( UT_StringArray data,
PDG_AttributeMergeOp  merge_op,
int  stride 
)
staticprotected

Merge op utility for string array data.

static PDG_AttributeMergeError PDG_AttributeData::merge ( PDG_File::Array data,
PDG_AttributeMergeOp  merge_op,
int  stride 
)
staticprotected

Merge op utility for file array data.

static PDG_AttributeMergeError PDG_AttributeData::merge ( UT_ValArray< fpreal > &  data,
PDG_AttributeMergeOp  merge_op,
int  stride 
)
staticprotected

Merge op utility for float array data.

static PDG_AttributeMergeError PDG_AttributeData::merge ( UT_ValArray< exint > &  data,
PDG_AttributeMergeOp  merge_op,
int  stride 
)
staticprotected

Merge op utility for int array data.

static UT_StringHolder PDG_AttributeData::mergeName ( PDG_AttributeMergeOp  merge)
static

Returns the string name for the specified merge op.

static UT_StringHolder PDG_AttributeData::nameFromIntrinsic ( PDG_AttributeIntrinsic  attrib_type,
const UT_StringHolder name 
)
static

Returns an attribute name from a intrinsic type a name string.

virtual bool PDG_AttributeData::saveData ( UT_JSONWriter ) const
pure virtual
static PDG_AttributeType PDG_AttributeData::typeFromString ( const UT_StringHolder type_name)
static

Returns an attribute type enum from the specified string name.

static UT_StringHolder PDG_AttributeData::typeName ( PDG_AttributeType  type)
static

Returns the string name for the specififed attribute type.

static bool PDG_AttributeData::validName ( const UT_StringHolder str,
bool  allow_internal = false 
)
static

Returns true if the specified string is a valid attribute name. A valid name cannot start with __pdg prefix unless allow_interal is true. All names must begin with a letter or _ character and only contain letters/numbers/_ for subsequent character. E.g. they must match UT_String::isValidVariableName.

Member Data Documentation

const UT_StringHolder PDG_AttributeData::theConcatKey
static

Definition at line 44 of file PDG_AttributeData.h.

const UT_StringHolder PDG_AttributeData::theFlagKey
static

Static stringholder keys, used during json serialization and deserialization.

Definition at line 41 of file PDG_AttributeData.h.

const UT_StringHolder PDG_AttributeData::theOwnKey
static

Definition at line 45 of file PDG_AttributeData.h.

const UT_StringHolder PDG_AttributeData::theRuntimeKey
static

Definition at line 43 of file PDG_AttributeData.h.

const UT_StringHolder PDG_AttributeData::theTypeKey
static

Definition at line 42 of file PDG_AttributeData.h.

const UT_StringHolder PDG_AttributeData::theValueKey
static

Definition at line 46 of file PDG_AttributeData.h.

constexpr PDG_AttributeType PDG_AttributeData::TypeEnum = PDG_AttributeType::eUndefined
static

Attribute data version number.

Definition at line 37 of file PDG_AttributeData.h.


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