HDK
|
#include <PDGT_TypeRegistry.h>
Public Types | |
using | Self = PDGT_TypeRegistry< EnumType, EnumSize > |
Self type def. More... | |
Public Member Functions | |
virtual | ~PDGT_TypeRegistry () |
bool | standardInit (UT_WorkBuffer &errors, bool skip_python=false) |
void | clear () |
Clears and deletes everything in the type registry. More... | |
void | setRegistrationEnabled (bool enabled) |
Enables or disables custom type registration. More... | |
template<typename RegType , typename... Args> | |
RegType * | registerType (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args) |
template<typename RegType , typename... Args> | |
RegType * | registerFuncType (UT_WorkBuffer &errors, const UT_StringHolder &name, typename RegType::Function func, Args &&...args) |
template<typename RegType , typename ClassType , typename... Args> | |
RegType * | registerSimpleType (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args) |
bool | registerTypeAlias (EnumType type, const UT_StringHolder &name, const UT_StringHolder &alias, bool deprecated=false) |
Registers an alias for an existing type. More... | |
bool | addParentTypes (BaseType *type, const UT_StringArray &parent_names, UT_WorkBuffer &errors) |
Adds parent types to the type object. More... | |
bool | addParentType (BaseType *type, BaseType *parent, UT_WorkBuffer &errors) |
Directly adds a parent type, if it's valid. More... | |
bool | registerDSOTypes (const UT_StringHolder &dso_path) |
Loads and registers types compiled as a shared library. More... | |
bool | registerDSOTypes () |
bool | registerPythonModules (UT_WorkBuffer &errors) |
Registers all Python types on the PDG/types search path. More... | |
bool | registerPythonPath (const UT_StringHolder &path, UT_WorkBuffer &errors) |
Registers a Python module by absolute path. More... | |
bool | reloadPythonModule (const UT_StringHolder &path, bool reregister, UT_WorkBuffer &errors) |
Reloads a Python module by name. More... | |
BaseType * | registeredType (EnumType type, const UT_StringHolder &name) const |
Returns a generic type object for a given registered type and typename. More... | |
void | deprecateType (EnumType type, const UT_StringHolder &name) |
Deprecated a type name, so that accessing it will issue an warning. More... | |
UT_StringArray | typeNames (EnumType type, bool include_aliases=false) const |
Returns the set of all existing type names for registered type. More... | |
Protected Types | |
using | BaseType = PDGT_BaseType< EnumType > |
PDGT_BaseType spiicalization for this type registry. More... | |
using | pdg_BaseTypePtr = UT_SharedPtr< BaseType > |
Shared ptr to a registered PDG type. More... | |
using | TypeMap = UT_StringMap< pdg_BaseTypePtr > |
Map of type name to shared ptr. More... | |
Protected Member Functions | |
PDGT_TypeRegistry (const UT_StringHolder &dso_function, const UT_StringHolder &module_name) | |
Base class for a PDGT type system, which consists of a table of EnumType -> PDGT_Registered type. The number of entries in the table is defined by the number of distinct entries in the EnumType enumeration.
The type registry is the central place that holds the registered type objects, as well as logic needed to load them from shared libraries or Python definitions.
Definition at line 37 of file PDGT_TypeRegistry.h.
|
protected |
PDGT_BaseType spiicalization for this type registry.
Definition at line 45 of file PDGT_TypeRegistry.h.
|
protected |
Shared ptr to a registered PDG type.
Definition at line 48 of file PDGT_TypeRegistry.h.
using PDGT_TypeRegistry< EnumType, EnumSize >::Self = PDGT_TypeRegistry<EnumType, EnumSize> |
Self type def.
Definition at line 41 of file PDGT_TypeRegistry.h.
|
protected |
Map of type name to shared ptr.
Definition at line 51 of file PDGT_TypeRegistry.h.
|
inlineprotected |
Construct is protected since only this class and subclasses can create instances of itself.
Definition at line 57 of file PDGT_TypeRegistry.h.
|
inlinevirtual |
Definition at line 67 of file PDGT_TypeRegistry.h.
|
inline |
Directly adds a parent type, if it's valid.
Definition at line 241 of file PDGT_TypeRegistry.h.
|
inline |
Adds parent types to the type object.
Definition at line 217 of file PDGT_TypeRegistry.h.
|
inline |
Clears and deletes everything in the type registry.
Definition at line 91 of file PDGT_TypeRegistry.h.
|
inline |
Deprecated a type name, so that accessing it will issue an warning.
Definition at line 325 of file PDGT_TypeRegistry.h.
|
inline |
Loads and registers types compiled as a shared library.
Definition at line 267 of file PDGT_TypeRegistry.h.
|
inline |
Loads and registers types that are in DSOs on the PDG shared library path, e.g. <dso_path>/pdg
Definition at line 275 of file PDGT_TypeRegistry.h.
|
inline |
Returns a generic type object for a given registered type and typename.
Definition at line 306 of file PDGT_TypeRegistry.h.
|
inline |
Registers a type that implements it's construction logic in a function, rather than a custom class
Definition at line 155 of file PDGT_TypeRegistry.h.
|
inline |
Registers all Python types on the PDG/types search path.
Definition at line 282 of file PDGT_TypeRegistry.h.
|
inline |
Registers a Python module by absolute path.
Definition at line 289 of file PDGT_TypeRegistry.h.
|
inline |
Registers a type that uses the simple built-in function, which creates and instance of the type using it's constructor and does no additional logic
Definition at line 174 of file PDGT_TypeRegistry.h.
|
inline |
Registers a type using a pointer to the type object. Errors are returned in the error buffer parameter
Definition at line 106 of file PDGT_TypeRegistry.h.
|
inline |
Registers an alias for an existing type.
Definition at line 186 of file PDGT_TypeRegistry.h.
|
inline |
Reloads a Python module by name.
Definition at line 297 of file PDGT_TypeRegistry.h.
|
inline |
Enables or disables custom type registration.
Definition at line 98 of file PDGT_TypeRegistry.h.
|
inline |
Standard initialization of the types, which loads built in Python modules first, then user defined Python types, then C++ types. The reason for this being a method and not part of construction is there certain use cases that want to have an empty type table, for example unit testing or users with entirely custom nodes.
Definition at line 74 of file PDGT_TypeRegistry.h.
|
inline |
Returns the set of all existing type names for registered type.
Definition at line 331 of file PDGT_TypeRegistry.h.