HDK
|
#include <PDG_AttributeDictionary.h>
Public Types | |
using | Base = PDG_AttributeArray< PDG_AttributeType::eDictArray, UT_OptionsHolder, UT_Array< UT_OptionsHolder >> |
![]() | |
using | Self = PDG_AttributeArray< AttribType, UT_OptionsHolder, UT_Array< UT_OptionsHolder > > |
using | Data = UT_OptionsHolder |
using | Array = UT_Array< UT_OptionsHolder > |
using | Map = UT_StringMap< UT_Array< UT_OptionsHolder > > |
Public Member Functions | |
~PDG_AttributeDictionary () override | |
int64 | getMemoryUsage (bool inclusive) const override |
Returns the total memory usage of all data on this attribute. More... | |
PDG_AttributeData * | clone () const override |
bool | saveData (UT_JSONWriter &writer) const override |
Writes the dictionary data to the json writer. More... | |
void | saveData (const UT_StringHolder &key, UT_OptionsHolder &dict) const override |
Writes the dictionary data to the json writer. More... | |
bool | loadData (const UT_JSONValue &value) override |
Reads the dictionary data from the json value. More... | |
bool | loadData (const UT_StringHolder &key, const UT_OptionsHolder &dict) override |
Reads the dictionary data from the dict. More... | |
bool | desc (UT_WorkBuffer &result, bool pretty_print=false) const |
Writes a string representation of the dictionaries to the buffer. More... | |
bool | desc (UT_StringHolder &result, bool pretty_print=false) const |
bool | desc (UT_WorkBuffer &result, int component, bool pretty_print=false) const |
bool | desc (UT_StringHolder &result, int component, bool pretty_print=false) const |
void | setValue (const UT_StringArray &reprs) |
Sets values from an array of python dictionary representations. More... | |
void | setValue (const UT_StringHolder &repr, int component) |
Sets a value from a python dictionary string representation. More... | |
void | mergeValue (const UT_OptionsHolder &options, int component) |
void | removeKeys (const PDG_AttributePattern &pattern, int component) |
void | importAttributes (const PDG_AttributePattern &pattern, const PDG_AttributeMap &attributes, int component, PDG_AttributeOverwrite overwrite) |
Imports the specified attributes as key/value pairs in the dictionary. More... | |
void | mergeAttributes (const PDG_AttributePattern &pattern, const PDG_AttributeMap &attributes, int component) |
PDG_AttributeCast | query (fpreal &result, const PDG_AttributeQuery &query, exint &query_index, int component) const |
PDG_AttributeCast | query (fpreal &result, const UT_StringHolder &str, int component) const |
PDG_AttributeCast | query (UT_WorkBuffer &result, const PDG_AttributeQuery &query, exint &query_index, int component) const |
PDG_AttributeCast | query (UT_WorkBuffer &result, const UT_StringHolder &str, int component) const |
![]() | |
PDG_AttributeArray () | |
PDG_AttributeArray (const UT_Array< UT_OptionsHolder > &data) | |
~PDG_AttributeArray () override | |
bool | hasData () const |
int | size () const |
bool | valid (int component) const |
bool | value (UT_OptionsHolder &data, int component) const |
const UT_OptionsHolder & | value (int component) const |
UT_OptionsHolder & | value (int component) |
void | setValue (const UT_Array< UT_OptionsHolder > &data) |
void | setValue (const UT_Array< UT_OptionsHolder > &&data) |
void | setValue (const UT_OptionsHolder &value, int component) |
void | setValues (const UT_Array< UT_OptionsHolder > &data) |
const UT_OptionsHolder & | appendValue (const UT_OptionsHolder &value) |
const UT_Array < UT_OptionsHolder > & | values () const |
UT_Array< UT_OptionsHolder > & | values () |
void | clear () |
void | truncate (int length) |
bool | concat (const Self *other) |
bool | adjustSize (int offset) |
bool | setSize (int size) |
bool | hash (SYS_HashType &hash_value, UT_WorkBuffer &errors) const override |
Return a hash value derived from the attribute data. More... | |
void | swap (Self *other) |
void | copy (const Self *other) |
bool | compare (const PDG_AttributeData *other) const override |
Compares this data object with another data object. More... | |
PDG_AttributeMergeError | merge (PDG_AttributeMergeOp merge_op, int stride) override |
Applies a merge op to the data in this attribute. More... | |
![]() | |
PDG_AttributeData () | |
virtual | ~PDG_AttributeData () |
Dictionary attribute type
Definition at line 31 of file PDG_AttributeDictionary.h.
using PDG_AttributeDictionary::Base = PDG_AttributeArray< PDG_AttributeType::eDictArray, UT_OptionsHolder, UT_Array<UT_OptionsHolder>> |
Definition at line 40 of file PDG_AttributeDictionary.h.
|
override |
|
overridevirtual |
Constructs a new dictionary attribute that copies the data from this attribute
Implements PDG_AttributeData.
bool PDG_AttributeDictionary::desc | ( | UT_WorkBuffer & | result, |
bool | pretty_print = false |
||
) | const |
Writes a string representation of the dictionaries to the buffer.
bool PDG_AttributeDictionary::desc | ( | UT_StringHolder & | result, |
bool | pretty_print = false |
||
) | const |
bool PDG_AttributeDictionary::desc | ( | UT_WorkBuffer & | result, |
int | component, | ||
bool | pretty_print = false |
||
) | const |
Writes a string representation of the dictionary at the specified index to the buffer
bool PDG_AttributeDictionary::desc | ( | UT_StringHolder & | result, |
int | component, | ||
bool | pretty_print = false |
||
) | const |
|
overridevirtual |
Returns the total memory usage of all data on this attribute.
Implements PDG_AttributeData.
void PDG_AttributeDictionary::importAttributes | ( | const PDG_AttributePattern & | pattern, |
const PDG_AttributeMap & | attributes, | ||
int | component, | ||
PDG_AttributeOverwrite | overwrite | ||
) |
Imports the specified attributes as key/value pairs in the dictionary.
|
overridevirtual |
Reads the dictionary data from the json value.
Implements PDG_AttributeData.
|
overridevirtual |
Reads the dictionary data from the dict.
Implements PDG_AttributeData.
void PDG_AttributeDictionary::mergeAttributes | ( | const PDG_AttributePattern & | pattern, |
const PDG_AttributeMap & | attributes, | ||
int | component | ||
) |
Imports the specified dictionary attribute key/value pairs into this dictionary.
void PDG_AttributeDictionary::mergeValue | ( | const UT_OptionsHolder & | options, |
int | component | ||
) |
Merges the dictionary into a dictionary in this attribute at the specified index
PDG_AttributeCast PDG_AttributeDictionary::query | ( | fpreal & | result, |
const PDG_AttributeQuery & | query, | ||
exint & | query_index, | ||
int | component | ||
) | const |
Queries a floating point value from the dictionary, using the specified query string and index
PDG_AttributeCast PDG_AttributeDictionary::query | ( | fpreal & | result, |
const UT_StringHolder & | str, | ||
int | component | ||
) | const |
PDG_AttributeCast PDG_AttributeDictionary::query | ( | UT_WorkBuffer & | result, |
const PDG_AttributeQuery & | query, | ||
exint & | query_index, | ||
int | component | ||
) | const |
Queries a string value from the dictionary, using the specified query string and index
PDG_AttributeCast PDG_AttributeDictionary::query | ( | UT_WorkBuffer & | result, |
const UT_StringHolder & | str, | ||
int | component | ||
) | const |
void PDG_AttributeDictionary::removeKeys | ( | const PDG_AttributePattern & | pattern, |
int | component | ||
) |
Removes any dictionary entries at the specified index that match the attribute pattern
|
overridevirtual |
Writes the dictionary data to the json writer.
Implements PDG_AttributeData.
|
overridevirtual |
Writes the dictionary data to the json writer.
Implements PDG_AttributeData.
void PDG_AttributeDictionary::setValue | ( | const UT_StringArray & | reprs | ) |
Sets values from an array of python dictionary representations.
void PDG_AttributeDictionary::setValue | ( | const UT_StringHolder & | repr, |
int | component | ||
) |
Sets a value from a python dictionary string representation.