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

#include <PDG_AttributeArray.h>

+ Inheritance diagram for PDG_AttributeArray< AttribType, DataType, ArrayType >:

Public Types

using Self = PDG_AttributeArray< AttribType, DataType, ArrayType >
 
using Data = DataType
 
using Array = ArrayType
 
using Map = UT_StringMap< ArrayType >
 

Public Member Functions

 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 ()
 
virtual int64 getMemoryUsage (bool inclusive) const =0
 Returns the memory usage of the attribute and its 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 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...
 

Static Public Attributes

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

void expand (const DataType &value, int component)
 
void expandIfNeeded (const DataType &default_value, int component)
 

Protected Attributes

ArrayType myData
 

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 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...
 

Detailed Description

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

Base template for array attribute types

Definition at line 26 of file PDG_AttributeArray.h.

Member Typedef Documentation

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
using PDG_AttributeArray< AttribType, DataType, ArrayType >::Array = ArrayType

Definition at line 33 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
using PDG_AttributeArray< AttribType, DataType, ArrayType >::Data = DataType

Definition at line 32 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
using PDG_AttributeArray< AttribType, DataType, ArrayType >::Map = UT_StringMap<ArrayType>

Definition at line 34 of file PDG_AttributeArray.h.

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

Definition at line 31 of file PDG_AttributeArray.h.

Constructor & Destructor Documentation

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
PDG_AttributeArray< AttribType, DataType, ArrayType >::PDG_AttributeArray ( )
inline

Definition at line 37 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
PDG_AttributeArray< AttribType, DataType, ArrayType >::PDG_AttributeArray ( const ArrayType &  data)
inlineexplicit

Definition at line 42 of file PDG_AttributeArray.h.

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

Definition at line 48 of file PDG_AttributeArray.h.

Member Function Documentation

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::adjustSize ( int  offset)
inline

Definition at line 143 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
const DataType& PDG_AttributeArray< AttribType, DataType, ArrayType >::appendValue ( const DataType &  value)
inline

Definition at line 111 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::clear ( void  )
inline

Definition at line 127 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::compare ( const PDG_AttributeData ) const
inlineoverridevirtual

Compares this data object with another data object.

Implements PDG_AttributeData.

Definition at line 172 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::concat ( const Self other)
inline

Definition at line 137 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::copy ( const Self other)
inline

Definition at line 167 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::expand ( const DataType &  value,
int  component 
)
inlineprotected

Definition at line 185 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::expandIfNeeded ( const DataType &  default_value,
int  component 
)
inlineprotected

Definition at line 198 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::hasData ( ) const
inline

Definition at line 50 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::hash ( SYS_HashType hash_value,
UT_WorkBuffer errors 
) const
inlineoverridevirtual

Return a hash value derived from the attribute data.

Implements PDG_AttributeData.

Definition at line 155 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
PDG_AttributeMergeError PDG_AttributeArray< AttribType, DataType, ArrayType >::merge ( PDG_AttributeMergeOp  merge_op,
int  stride 
)
inlineoverridevirtual

Applies a merge op to the data in this attribute.

Implements PDG_AttributeData.

Definition at line 178 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::setSize ( int  size)
inline

Definition at line 149 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::setValue ( const ArrayType &  data)
inline

Definition at line 89 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::setValue ( const ArrayType &&  data)
inline

Definition at line 94 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::setValue ( const DataType &  value,
int  component 
)
inline

Definition at line 99 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::setValues ( const ArrayType &  data)
inline

Definition at line 104 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
int PDG_AttributeArray< AttribType, DataType, ArrayType >::size ( void  ) const
inline

Definition at line 55 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::swap ( Self other)
inline

Definition at line 162 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
void PDG_AttributeArray< AttribType, DataType, ArrayType >::truncate ( int  length)
inline

Definition at line 132 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::valid ( int  component) const
inline

Definition at line 60 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
bool PDG_AttributeArray< AttribType, DataType, ArrayType >::value ( DataType &  data,
int  component 
) const
inline

Definition at line 65 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
const DataType& PDG_AttributeArray< AttribType, DataType, ArrayType >::value ( int  component) const
inline

Definition at line 79 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
DataType& PDG_AttributeArray< AttribType, DataType, ArrayType >::value ( int  component)
inline

Definition at line 84 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
const ArrayType& PDG_AttributeArray< AttribType, DataType, ArrayType >::values ( ) const
inline

Definition at line 117 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
ArrayType& PDG_AttributeArray< AttribType, DataType, ArrayType >::values ( )
inline

Definition at line 122 of file PDG_AttributeArray.h.

Member Data Documentation

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
ArrayType PDG_AttributeArray< AttribType, DataType, ArrayType >::myData
protected

Definition at line 214 of file PDG_AttributeArray.h.

template<PDG_AttributeType AttribType, typename DataType, typename ArrayType = UT_ValArray<DataType>>
constexpr PDG_AttributeType PDG_AttributeArray< AttribType, DataType, ArrayType >::TypeEnum = AttribType
static

Definition at line 29 of file PDG_AttributeArray.h.


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