HDK
|
#include <PDG_AttributeData.h>
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_AttributeData * | clone () const =0 |
Deep copies this attribute. More... | |
virtual bool | saveData (UT_JSONWriter &) const =0 |
Serializes the data to a JSON writer. More... | |
virtual void | saveData (const UT_StringHolder &, UT_OptionsHolder &) const =0 |
Serializes the data to a UT options. More... | |
virtual bool | loadData (const UT_JSONValue &)=0 |
Loads data from a JSON value. More... | |
virtual bool | loadData (const UT_StringHolder &, const UT_OptionsHolder &)=0 |
Loads data from a dict. 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_AttributeData * | fromType (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... | |
static PDG_AttributeMergeError | merge (UT_Array< UT_OptionsHolder > &data, PDG_AttributeMergeOp merge_op, int stride) |
Merge op utility for dict array data. More... | |
Base class for all types of PDG attribute data
Definition at line 35 of file PDG_AttributeData.h.
PDG_AttributeData::PDG_AttributeData | ( | ) |
Constructs a new instance with a specified type and owning map, called by child classes.
|
virtual |
|
pure virtual |
Deep copies this attribute.
Implemented in PDG_AttributeFile, PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >, PDG_AttributeDictionary, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
pure virtual |
Compares this data object with another data object.
Implemented in PDG_AttributeArray< AttribType, DataType, ArrayType >, PDG_AttributeArray< PDG_AttributeType::eFileArray, PDG_File, PDG_File::Array >, PDG_AttributeArray< PDG_AttributeType::eDictArray, UT_OptionsHolder, UT_Array< UT_OptionsHolder > >, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
static |
Static utility for returnign an event from type from an attribute type.
|
static |
Static utility for constructing an attribute of the specified type, used during deserialization
|
pure virtual |
Returns the memory usage of the attribute and its data.
Implemented in PDG_AttributeFile, PDG_AttributeDictionary, PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
pure virtual |
Return a hash value derived from the attribute data.
Implemented in PDG_AttributeArray< AttribType, DataType, ArrayType >, PDG_AttributeArray< PDG_AttributeType::eFileArray, PDG_File, PDG_File::Array >, PDG_AttributeArray< PDG_AttributeType::eDictArray, UT_OptionsHolder, UT_Array< UT_OptionsHolder > >, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
static |
Returns an intrinsic type from an attribue name.
|
pure virtual |
Loads data from a JSON value.
Implemented in PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >, PDG_AttributeFile, PDG_AttributeDictionary, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
pure virtual |
Loads data from a dict.
Implemented in PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >, PDG_AttributeFile, PDG_AttributeDictionary, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
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 __.
|
pure virtual |
Applies a merge op to the data in this attribute.
Implemented in PDG_AttributeArray< AttribType, DataType, ArrayType >, PDG_AttributeArray< PDG_AttributeType::eFileArray, PDG_File, PDG_File::Array >, PDG_AttributeArray< PDG_AttributeType::eDictArray, UT_OptionsHolder, UT_Array< UT_OptionsHolder > >, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
staticprotected |
Merge op utility for string array data.
|
staticprotected |
Merge op utility for file array data.
|
staticprotected |
Merge op utility for float array data.
|
staticprotected |
Merge op utility for int array data.
|
staticprotected |
Merge op utility for dict array data.
|
static |
Returns the string name for the specified merge op.
|
static |
Returns an attribute name from a intrinsic type a name string.
|
pure virtual |
Serializes the data to a JSON writer.
Implemented in PDG_AttributeFile, PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >, PDG_AttributeDictionary, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
pure virtual |
Serializes the data to a UT options.
Implemented in PDG_AttributeFile, PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >, PDG_AttributeDictionary, PDG_AttributePyObject, and PDG_AttributeGeometry.
|
static |
Returns an attribute type enum from the specified string name.
|
static |
Returns the string name for the specififed attribute type.
|
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.
|
static |
Definition at line 46 of file PDG_AttributeData.h.
|
static |
Static stringholder keys, used during json serialization and deserialization.
Definition at line 43 of file PDG_AttributeData.h.
|
static |
Definition at line 47 of file PDG_AttributeData.h.
|
static |
Definition at line 45 of file PDG_AttributeData.h.
|
static |
Definition at line 44 of file PDG_AttributeData.h.
|
static |
Definition at line 48 of file PDG_AttributeData.h.
|
static |
Attribute data version number.
Definition at line 39 of file PDG_AttributeData.h.