HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType > Class Template Reference

#include <PDG_AttributePrimitive.h>

+ Inheritance diagram for PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >:

Public Types

using Base = PDG_AttributeArray< AttribType, DataType, ArrayType >
 
using Self = PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >
 
- Public Types inherited from PDG_AttributeArray< AttribType, DataType, ArrayType >
using Self = PDG_AttributeArray< AttribType, DataType, ArrayType >
 
using Data = DataType
 
using Array = ArrayType
 
using Map = UT_StringMap< ArrayType >
 

Public Member Functions

 ~PDG_AttributePrimitive () override
 
int64 getMemoryUsage (bool inclusive) const override
 Returns the total memory usage of the underlying array data. More...
 
PDG_AttributeDataclone () const override
 Constructs a new attribue that's copied from this one. More...
 
bool saveData (UT_JSONWriter &writer) const override
 Saves the array data to the specified json writer. More...
 
void saveData (const UT_StringHolder &key, UT_OptionsHolder &dict) const override
 Saves the array data to the specified options. More...
 
bool loadData (const UT_JSONValue &value) override
 Reads array data from the json value. More...
 
bool loadData (const UT_StringHolder &key, const UT_OptionsHolder &dict) override
 Reads array data from a dict. More...
 
- Public Member Functions inherited from PDG_AttributeArray< AttribType, DataType, ArrayType >
 PDG_AttributeArray ()
 
 PDG_AttributeArray (const ArrayType &data)
 
 ~PDG_AttributeArray () override
 
bool hasData () const
 
int size () const
 
bool valid (int component) const
 
bool value (DataType &data, int component) const
 
const DataType & value (int component) const
 
DataType & value (int component)
 
void setValue (const ArrayType &data)
 
void setValue (const ArrayType &&data)
 
void setValue (const DataType &value, int component)
 
void setValues (const ArrayType &data)
 
const DataType & appendValue (const DataType &value)
 
const ArrayType & values () const
 
ArrayType & 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...
 
- Public Member Functions inherited from PDG_AttributeData
 PDG_AttributeData ()
 
virtual ~PDG_AttributeData ()
 

Additional Inherited Members

- Static Public Member Functions inherited from PDG_AttributeData
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 inherited from PDG_AttributeArray< AttribType, DataType, ArrayType >
static constexpr PDG_AttributeType TypeEnum = AttribType
 
- Static Public Attributes inherited from PDG_AttributeData
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
 
- Protected Member Functions inherited from PDG_AttributeArray< AttribType, DataType, ArrayType >
void expand (const DataType &value, int component)
 
void expandIfNeeded (const DataType &default_value, int component)
 
- Static Protected Member Functions inherited from PDG_AttributeData
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...
 
- Protected Attributes inherited from PDG_AttributeArray< AttribType, DataType, ArrayType >
ArrayType myData
 

Detailed Description

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
class PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >

Template for primitive value array attributes that can serialize themselves directly to JSON, without the need for custom value handling.

Examples:
PDG/PDG_ProcessorRandom.C.

Definition at line 34 of file PDG_AttributePrimitive.h.

Member Typedef Documentation

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
using PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::Base = PDG_AttributeArray<AttribType, DataType, ArrayType>

Definition at line 40 of file PDG_AttributePrimitive.h.

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
using PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::Self = PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType>

Definition at line 42 of file PDG_AttributePrimitive.h.

Constructor & Destructor Documentation

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::~PDG_AttributePrimitive ( )
inlineoverride

Definition at line 45 of file PDG_AttributePrimitive.h.

Member Function Documentation

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
PDG_AttributeData* PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::clone ( ) const
inlineoverridevirtual

Constructs a new attribue that's copied from this one.

Implements PDG_AttributeData.

Definition at line 56 of file PDG_AttributePrimitive.h.

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
int64 PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::getMemoryUsage ( bool  inclusive) const
inlineoverridevirtual

Returns the total memory usage of the underlying array data.

Implements PDG_AttributeData.

Definition at line 48 of file PDG_AttributePrimitive.h.

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
bool PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::loadData ( const UT_JSONValue value)
inlineoverridevirtual

Reads array data from the json value.

Implements PDG_AttributeData.

Definition at line 79 of file PDG_AttributePrimitive.h.

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
bool PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::loadData ( const UT_StringHolder key,
const UT_OptionsHolder dict 
)
inlineoverridevirtual

Reads array data from a dict.

Implements PDG_AttributeData.

Definition at line 90 of file PDG_AttributePrimitive.h.

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
bool PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::saveData ( UT_JSONWriter writer) const
inlineoverridevirtual

Saves the array data to the specified json writer.

Implements PDG_AttributeData.

Definition at line 62 of file PDG_AttributePrimitive.h.

template<PDG_AttributeType AttribType, typename DataType , typename ArrayType = UT_ValArray<DataType>, typename JSONType = ArrayType>
void PDG_AttributePrimitive< AttribType, DataType, ArrayType, JSONType >::saveData ( const UT_StringHolder key,
UT_OptionsHolder dict 
) const
inlineoverridevirtual

Saves the array data to the specified options.

Implements PDG_AttributeData.

Definition at line 68 of file PDG_AttributePrimitive.h.


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