HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributePyObject Class Reference

#include <PDG_AttributePyObject.h>

+ Inheritance diagram for PDG_AttributePyObject:

Public Types

using Data = PY_PyObject *
 
using Map = UT_StringMap< Data >
 

Public Member Functions

 PDG_AttributePyObject ()
 
 PDG_AttributePyObject (PY_PyObject *object)
 
 ~PDG_AttributePyObject () override
 
int64 getMemoryUsage (bool inclusive) const override
 Returns the memory usage of the attribute and its data. More...
 
bool hash (SYS_HashType &hash_value, UT_WorkBuffer &errors) const override
 Return a hash value derived from the attribute data. More...
 
PDG_AttributeDataclone () const override
 Deep copies this attribute. More...
 
bool saveData (UT_JSONWriter &writer) const override
 Serializes the data to a JSON writer. More...
 
void saveData (const UT_StringHolder &key, UT_OptionsHolder &dict) const override
 Serializes the data to a UT options. More...
 
bool loadData (const UT_JSONValue &value) override
 Loads data from a JSON value. More...
 
bool loadData (const UT_StringHolder &key, const UT_OptionsHolder &dict) override
 Loads data from a dict. More...
 
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_AttributeCast query (fpreal &value, const PDG_AttributeQuery &query, int component) const
 
PDG_AttributeCast query (fpreal &value, const UT_StringHolder &str, int component) const
 
PDG_AttributeCast query (UT_WorkBuffer &value, const PDG_AttributeQuery &query, int component) const
 
PDG_AttributeCast query (UT_WorkBuffer &value, const UT_StringHolder &str, int component) const
 
PY_PyObjectquery (const UT_StringHolder &str) const
 
bool setObjectFromString (const UT_StringHolder &repr)
 
PY_PyObjectobject () const
 
void setObject (PY_PyObject *object)
 
bool hasData () const
 
int size () const
 
bool valid (int component) const
 
bool value (PY_PyObject *&object, int component) const
 
void setValue (PY_PyObject *object, int index)
 
bool repr (UT_WorkBuffer &str) const
 
bool repr (UT_StringHolder &str) const
 
bool str (UT_StringHolder &str) const
 
void swap (PDG_AttributePyObject *other)
 
void copy (const PDG_AttributePyObject *other)
 
- Public Member Functions inherited from PDG_AttributeData
 PDG_AttributeData ()
 
virtual ~PDG_AttributeData ()
 

Static Public Attributes

static constexpr PDG_AttributeType TypeEnum = PDG_AttributeType::ePythonObject
 
- 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
 

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

Attribute that contains a single PY_PyObject*, mostly opaque in C++ code but accessible from the Python API.

Definition at line 29 of file PDG_AttributePyObject.h.

Member Typedef Documentation

Definition at line 34 of file PDG_AttributePyObject.h.

Constructor & Destructor Documentation

PDG_AttributePyObject::PDG_AttributePyObject ( )
PDG_AttributePyObject::PDG_AttributePyObject ( PY_PyObject object)
explicit
PDG_AttributePyObject::~PDG_AttributePyObject ( )
override

Member Function Documentation

PDG_AttributeData* PDG_AttributePyObject::clone ( ) const
overridevirtual

Deep copies this attribute.

Implements PDG_AttributeData.

bool PDG_AttributePyObject::compare ( const PDG_AttributeData ) const
overridevirtual

Compares this data object with another data object.

Implements PDG_AttributeData.

void PDG_AttributePyObject::copy ( const PDG_AttributePyObject other)
int64 PDG_AttributePyObject::getMemoryUsage ( bool  inclusive) const
overridevirtual

Returns the memory usage of the attribute and its data.

Implements PDG_AttributeData.

bool PDG_AttributePyObject::hasData ( ) const
inline

Definition at line 90 of file PDG_AttributePyObject.h.

bool PDG_AttributePyObject::hash ( SYS_HashType hash_value,
UT_WorkBuffer errors 
) const
overridevirtual

Return a hash value derived from the attribute data.

Implements PDG_AttributeData.

bool PDG_AttributePyObject::loadData ( const UT_JSONValue )
overridevirtual

Loads data from a JSON value.

Implements PDG_AttributeData.

bool PDG_AttributePyObject::loadData ( const UT_StringHolder ,
const UT_OptionsHolder  
)
overridevirtual

Loads data from a dict.

Implements PDG_AttributeData.

PDG_AttributeMergeError PDG_AttributePyObject::merge ( PDG_AttributeMergeOp  merge_op,
int  stride 
)
overridevirtual

Applies a merge op to the data in this attribute.

Implements PDG_AttributeData.

PY_PyObject* PDG_AttributePyObject::object ( ) const
PDG_AttributeCast PDG_AttributePyObject::query ( fpreal value,
const PDG_AttributeQuery query,
int  component 
) const
PDG_AttributeCast PDG_AttributePyObject::query ( fpreal value,
const UT_StringHolder str,
int  component 
) const
PDG_AttributeCast PDG_AttributePyObject::query ( UT_WorkBuffer value,
const PDG_AttributeQuery query,
int  component 
) const
PDG_AttributeCast PDG_AttributePyObject::query ( UT_WorkBuffer value,
const UT_StringHolder str,
int  component 
) const
PY_PyObject* PDG_AttributePyObject::query ( const UT_StringHolder str) const
bool PDG_AttributePyObject::repr ( UT_WorkBuffer str) const
bool PDG_AttributePyObject::repr ( UT_StringHolder str) const
bool PDG_AttributePyObject::saveData ( UT_JSONWriter ) const
overridevirtual

Serializes the data to a JSON writer.

Implements PDG_AttributeData.

void PDG_AttributePyObject::saveData ( const UT_StringHolder ,
UT_OptionsHolder  
) const
overridevirtual

Serializes the data to a UT options.

Implements PDG_AttributeData.

void PDG_AttributePyObject::setObject ( PY_PyObject object)
bool PDG_AttributePyObject::setObjectFromString ( const UT_StringHolder repr)
void PDG_AttributePyObject::setValue ( PY_PyObject object,
int  index 
)
inline

Definition at line 114 of file PDG_AttributePyObject.h.

int PDG_AttributePyObject::size ( void  ) const
inline

Definition at line 95 of file PDG_AttributePyObject.h.

bool PDG_AttributePyObject::str ( UT_StringHolder str) const
void PDG_AttributePyObject::swap ( PDG_AttributePyObject other)
inline

Definition at line 123 of file PDG_AttributePyObject.h.

bool PDG_AttributePyObject::valid ( int  component) const
inline

Definition at line 100 of file PDG_AttributePyObject.h.

bool PDG_AttributePyObject::value ( PY_PyObject *&  object,
int  component 
) const
inline

Definition at line 105 of file PDG_AttributePyObject.h.

Member Data Documentation

constexpr PDG_AttributeType PDG_AttributePyObject::TypeEnum = PDG_AttributeType::ePythonObject
static

Definition at line 32 of file PDG_AttributePyObject.h.


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