HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDGT_TypeInstance< EnumType > Class Template Reference

#include <PDGT_TypeInstance.h>

+ Inheritance diagram for PDGT_TypeInstance< EnumType >:

Public Types

using BaseType = PDGT_BaseType< EnumType >
 

Public Member Functions

 PDGT_TypeInstance ()
 
 PDGT_TypeInstance (const PDGT_BaseType< EnumType > *base_type, const PDGT_ValueArgs &extra_args)
 
virtual ~PDGT_TypeInstance ()
 
virtual int64 getMemoryUsage (bool inclusive) const
 
virtual bool reloadInstance (UT_WorkBuffer &errors)
 
const BaseTypetype () const
 
const UT_StringHoldertypeName () const
 
const PDGT_ValueArgsextraArgs () const
 
bool compareType (const BaseType *other_type, bool deep=true) const
 
void setReloading (bool is_reloading)
 
bool isReloading () const
 

Protected Attributes

const BaseTypemyBaseType
 
PDGT_ValueArgs myExtraArgs
 
bool myReloading
 

Detailed Description

template<typename EnumType>
class PDGT_TypeInstance< EnumType >

The base class for all instances created using a PDGT_RegisteredType. The Class argument to the registered type should derive from this class.

This class provides basic functionality common to all instances, such as:

 Providing the ability to look up a back reference to the type object
 Tracking whether or not the instance is currently being reloaded.

This class also defines the reloadInstance virtual method, which is called when the instance should reload itself. Typically, the instance will need to implement a custom method that calls type()->reloadInstance(...) with itself as an argument, and the various other construction arguments needed in order to properly re-initialize the underyling object.

For example, nodes based on Python classes needed to reconstruct their underyling Python instance, which requires passing in the PDG_Node as a construction argument. PDG_NodeCallback, which is a subclass of this class, defines a custom reloadInstance method that makes the correct call into its PDG_NodeCallbackType::reloadInstance method with the PDG_Node as an argument.

Definition at line 42 of file PDGT_TypeInstance.h.

Member Typedef Documentation

template<typename EnumType >
using PDGT_TypeInstance< EnumType >::BaseType = PDGT_BaseType<EnumType>

Definition at line 45 of file PDGT_TypeInstance.h.

Constructor & Destructor Documentation

template<typename EnumType >
PDGT_TypeInstance< EnumType >::PDGT_TypeInstance ( )
inline

Definition at line 48 of file PDGT_TypeInstance.h.

template<typename EnumType >
PDGT_TypeInstance< EnumType >::PDGT_TypeInstance ( const PDGT_BaseType< EnumType > *  base_type,
const PDGT_ValueArgs extra_args 
)
inline

Definition at line 52 of file PDGT_TypeInstance.h.

template<typename EnumType >
virtual PDGT_TypeInstance< EnumType >::~PDGT_TypeInstance ( )
inlinevirtual

Definition at line 62 of file PDGT_TypeInstance.h.

Member Function Documentation

template<typename EnumType >
bool PDGT_TypeInstance< EnumType >::compareType ( const BaseType other_type,
bool  deep = true 
) const
inline

Definition at line 85 of file PDGT_TypeInstance.h.

template<typename EnumType >
const PDGT_ValueArgs& PDGT_TypeInstance< EnumType >::extraArgs ( ) const
inline

Definition at line 82 of file PDGT_TypeInstance.h.

template<typename EnumType >
virtual int64 PDGT_TypeInstance< EnumType >::getMemoryUsage ( bool  inclusive) const
inlinevirtual
template<typename EnumType >
bool PDGT_TypeInstance< EnumType >::isReloading ( ) const
inline

Definition at line 94 of file PDGT_TypeInstance.h.

template<typename EnumType >
virtual bool PDGT_TypeInstance< EnumType >::reloadInstance ( UT_WorkBuffer errors)
inlinevirtual

Reimplemented in PDG_Scheduler, and PDG_NodeCallback.

Definition at line 75 of file PDGT_TypeInstance.h.

template<typename EnumType >
void PDGT_TypeInstance< EnumType >::setReloading ( bool  is_reloading)
inline

Definition at line 92 of file PDGT_TypeInstance.h.

template<typename EnumType >
const BaseType* PDGT_TypeInstance< EnumType >::type ( ) const
inline

Definition at line 78 of file PDGT_TypeInstance.h.

template<typename EnumType >
const UT_StringHolder& PDGT_TypeInstance< EnumType >::typeName ( ) const
inline

Definition at line 80 of file PDGT_TypeInstance.h.

Member Data Documentation

template<typename EnumType >
const BaseType* PDGT_TypeInstance< EnumType >::myBaseType
protected

Definition at line 98 of file PDGT_TypeInstance.h.

template<typename EnumType >
PDGT_ValueArgs PDGT_TypeInstance< EnumType >::myExtraArgs
protected

Definition at line 99 of file PDGT_TypeInstance.h.

template<typename EnumType >
bool PDGT_TypeInstance< EnumType >::myReloading
protected

Definition at line 100 of file PDGT_TypeInstance.h.


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