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

#include <PDG_TypeRegistry.h>

+ Inheritance diagram for PDG_TypeRegistry:

Public Member Functions

 ~PDG_TypeRegistry () override
 Destructor. More...
 
template<typename ClassType , typename... Args>
PDG_WorkItemDataTyperegisterCustomWorkItemData (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 Registers a function-based work item type. More...
 
template<typename ClassType , typename... Args>
PDG_NodeCallbackTyperegisterCustomNodeCallback (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 Registers a function-based node type. More...
 
template<typename ClassType , typename... Args>
PDG_SchedulerTyperegisterCustomScheduler (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 Registers a function-based scheduler type. More...
 
template<typename ClassType , typename... Args>
PDG_DependencyTyperegisterCustomDependency (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 Registers a function-based dependency type. More...
 
template<typename ClassType , typename... Args>
PDG_ServiceTyperegisterCustomService (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 Registers a function-based service type. More...
 
template<typename ClassType >
PDG_DependencyTyperegisterDependency (const UT_StringHolder &name, const UT_StringHolder &label)
 Utility method to register a custom C++-based external dependency. More...
 
template<typename ClassType >
PDG_WorkItemDataTyperegisterWorkItemData (const UT_StringHolder &name, const UT_StringHolder &label, bool compatible=true, bool make_default=false)
 Utility method to regiser a custom C++-based work item data. More...
 
template<typename ClassType >
PDG_SchedulerTyperegisterScheduler (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringHolder &parm_category, const UT_StringHolder &node_category)
 Utility method to registers a C++-based scheduler node. More...
 
template<typename ClassType >
PDG_SchedulerTyperegisterScheduler (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringHolder &parm_category, const UT_StringHolder &node_category, const PDG_NodeInterface &interface)
 
PDG_ServiceTyperegisterService (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringHolder &commandline, bool internal)
 
template<typename ClassType >
PDG_NodeCallbackTyperegisterProcessor (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringHolder &category, const PDG_NodeInterface &interface, PDG_NodeSubtype sub=PDG_NodeSubtype::eRegular)
 
template<typename ClassType >
PDG_NodeCallbackTyperegisterPartitioner (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringHolder &category, const PDG_NodeInterface &interface, PDG_NodeSubtype sub=PDG_NodeSubtype::eRegular)
 
template<typename ClassType >
PDG_NodeCallbackTyperegisterMapper (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringHolder &category, const PDG_NodeInterface &interface)
 
PDG_DependencyTypedependencyType (const UT_StringHolder &name) const
 Returns an external dependency type object for a given name. More...
 
PDG_NodeCallbackTypenodeCallbackType (const UT_StringHolder &name) const
 Retruns a node callback type object for a given name. More...
 
PDG_SchedulerTypeschedulerType (const UT_StringHolder &name) const
 Returns a scheduler type object for a give name. More...
 
PDG_ServiceTypeserviceType (const UT_StringHolder &name) const
 Returns a service type object for a given name. More...
 
PDG_WorkItemDataTypeworkItemDataType (const UT_StringHolder &name) const
 Returns a work item data type object for a given name. More...
 
PDG_WorkItemDataTypedefaultWorkItemDataType () const
 Gets/sets the default work item data type. More...
 
void setDefaultWorkItemDataType (PDG_WorkItemDataType *type)
 
PDG_SchedulerTypeserviceSchedulerType () const
 Gets/sets the service scheduler type. More...
 
void setServiceSchedulerType (PDG_SchedulerType *type)
 
PDG_SchedulerTypeinProcessSchedulerType () const
 Gets/sets the in process scheduler type. More...
 
void setInProcessSchedulerType (PDG_SchedulerType *type)
 
const UT_StringHolderlocalSchedulerTypeName () const
 Returns the name of the local scheduler type. More...
 
PDG_CustomHandlerscustomHandlers ()
 Returns the custom handlers table. More...
 
PDG_FileUtilsfileUtils ()
 Returns the shared file utilities object. More...
 
UT_StringHolder pySerializationModule () const
 
void setPySerializationModule (const UT_StringHolder &mod)
 Sets the custom serialization module name. More...
 
- Public Member Functions inherited from PDGT_TypeRegistry< PDG_RegistrationType,(int) PDG_RegistrationType::eCount >
virtual ~PDGT_TypeRegistry ()
 
bool standardInit (UT_WorkBuffer &errors, PDGT_ApplicationType app_type, 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...
 
RegType * registerType (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 
RegType * registerFuncType (UT_WorkBuffer &errors, const UT_StringHolder &name, typename RegType::Function func, Args &&...args)
 
RegType * registerSimpleType (UT_WorkBuffer &errors, const UT_StringHolder &name, Args &&...args)
 
bool registerTypeAlias (PDG_RegistrationTypetype, 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...
 
BaseTyperegisteredType (PDG_RegistrationTypetype, const UT_StringHolder &name) const
 Returns a generic type object for a given registered type and typename. More...
 
void deprecateType (PDG_RegistrationTypetype, const UT_StringHolder &name)
 Deprecated a type name, so that accessing it will issue an warning. More...
 
UT_StringArray typeNames (PDG_RegistrationTypetype, bool include_aliases=false) const
 Returns the set of all existing type names for registered type. More...
 
PDGT_ApplicationType applicationType () const
 

Static Public Member Functions

static PDG_TypeRegistrytypes ()
 Returns the static type registry instance. More...
 
static bool isSchedulerLocal (const UT_StringHolder &type_name)
 

Protected Member Functions

 PDG_TypeRegistry ()
 
- Protected Member Functions inherited from PDGT_TypeRegistry< PDG_RegistrationType,(int) PDG_RegistrationType::eCount >
 PDGT_TypeRegistry (const UT_StringHolder &dso_function, const UT_StringHolder &module_name)
 

Additional Inherited Members

- Public Types inherited from PDGT_TypeRegistry< PDG_RegistrationType,(int) PDG_RegistrationType::eCount >
using Self = PDGT_TypeRegistry< PDG_RegistrationType, EnumSize >
 Self type def. More...
 
- Protected Types inherited from PDGT_TypeRegistry< PDG_RegistrationType,(int) PDG_RegistrationType::eCount >
using BaseType = PDGT_BaseType< PDG_RegistrationType >
 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...
 

Detailed Description

Constructor & Destructor Documentation

PDG_TypeRegistry::PDG_TypeRegistry ( )
protected
PDG_TypeRegistry::~PDG_TypeRegistry ( )
override

Destructor.

Member Function Documentation

PDG_CustomHandlers* PDG_TypeRegistry::customHandlers ( )
inline

Returns the custom handlers table.

Definition at line 276 of file PDG_TypeRegistry.h.

PDG_WorkItemDataType* PDG_TypeRegistry::defaultWorkItemDataType ( ) const
inline

Gets/sets the default work item data type.

Definition at line 250 of file PDG_TypeRegistry.h.

PDG_DependencyType* PDG_TypeRegistry::dependencyType ( const UT_StringHolder name) const

Returns an external dependency type object for a given name.

PDG_FileUtils* PDG_TypeRegistry::fileUtils ( )
inline

Returns the shared file utilities object.

Definition at line 280 of file PDG_TypeRegistry.h.

PDG_SchedulerType* PDG_TypeRegistry::inProcessSchedulerType ( ) const
inline

Gets/sets the in process scheduler type.

Definition at line 262 of file PDG_TypeRegistry.h.

static bool PDG_TypeRegistry::isSchedulerLocal ( const UT_StringHolder type_name)
static

Returns true if the scheduler name is a "local" scheduler, e.g. it does not use the farm.

const UT_StringHolder& PDG_TypeRegistry::localSchedulerTypeName ( ) const
inline

Returns the name of the local scheduler type.

Definition at line 268 of file PDG_TypeRegistry.h.

PDG_NodeCallbackType* PDG_TypeRegistry::nodeCallbackType ( const UT_StringHolder name) const

Retruns a node callback type object for a given name.

UT_StringHolder PDG_TypeRegistry::pySerializationModule ( ) const

Returns the name of the module used to serialize and deserialize PyObject attributes

template<typename ClassType , typename... Args>
PDG_DependencyType* PDG_TypeRegistry::registerCustomDependency ( UT_WorkBuffer errors,
const UT_StringHolder name,
Args &&...  args 
)
inline

Registers a function-based dependency type.

Definition at line 80 of file PDG_TypeRegistry.h.

template<typename ClassType , typename... Args>
PDG_NodeCallbackType* PDG_TypeRegistry::registerCustomNodeCallback ( UT_WorkBuffer errors,
const UT_StringHolder name,
Args &&...  args 
)
inline

Registers a function-based node type.

Definition at line 58 of file PDG_TypeRegistry.h.

template<typename ClassType , typename... Args>
PDG_SchedulerType* PDG_TypeRegistry::registerCustomScheduler ( UT_WorkBuffer errors,
const UT_StringHolder name,
Args &&...  args 
)
inline

Registers a function-based scheduler type.

Definition at line 69 of file PDG_TypeRegistry.h.

template<typename ClassType , typename... Args>
PDG_ServiceType* PDG_TypeRegistry::registerCustomService ( UT_WorkBuffer errors,
const UT_StringHolder name,
Args &&...  args 
)
inline

Registers a function-based service type.

Definition at line 91 of file PDG_TypeRegistry.h.

template<typename ClassType , typename... Args>
PDG_WorkItemDataType* PDG_TypeRegistry::registerCustomWorkItemData ( UT_WorkBuffer errors,
const UT_StringHolder name,
Args &&...  args 
)
inline

Registers a function-based work item type.

Definition at line 47 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_DependencyType* PDG_TypeRegistry::registerDependency ( const UT_StringHolder name,
const UT_StringHolder label 
)
inline

Utility method to register a custom C++-based external dependency.

Definition at line 102 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_NodeCallbackType* PDG_TypeRegistry::registerMapper ( const UT_StringHolder name,
const UT_StringHolder label,
const UT_StringHolder category,
const PDG_NodeInterface interface 
)
inline

Utility method to register a C++-based mapper node using defaults for various standard node callback fields

Definition at line 219 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_NodeCallbackType* PDG_TypeRegistry::registerPartitioner ( const UT_StringHolder name,
const UT_StringHolder label,
const UT_StringHolder category,
const PDG_NodeInterface interface,
PDG_NodeSubtype  sub = PDG_NodeSubtype::eRegular 
)
inline

Utility method to register a C++-based partitioner node using defaults for various standard node callback fields

Examples:
PDG/PDG_PartitionByParity.C.

Definition at line 200 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_NodeCallbackType* PDG_TypeRegistry::registerProcessor ( const UT_StringHolder name,
const UT_StringHolder label,
const UT_StringHolder category,
const PDG_NodeInterface interface,
PDG_NodeSubtype  sub = PDG_NodeSubtype::eRegular 
)
inline

Utility method to register a C++-based processor node using defaults for various standard node callback fields

Examples:
PDG/PDG_ProcessorRandom.C.

Definition at line 181 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_SchedulerType* PDG_TypeRegistry::registerScheduler ( const UT_StringHolder name,
const UT_StringHolder label,
const UT_StringHolder parm_category,
const UT_StringHolder node_category 
)
inline

Utility method to registers a C++-based scheduler node.

Definition at line 136 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_SchedulerType* PDG_TypeRegistry::registerScheduler ( const UT_StringHolder name,
const UT_StringHolder label,
const UT_StringHolder parm_category,
const UT_StringHolder node_category,
const PDG_NodeInterface interface 
)
inline

Utility method to registers a C++-based scheduler node with a parm interface

Definition at line 151 of file PDG_TypeRegistry.h.

PDG_ServiceType* PDG_TypeRegistry::registerService ( const UT_StringHolder name,
const UT_StringHolder label,
const UT_StringHolder commandline,
bool  internal 
)
inline

Utility method to register a C++-based service using the default service class

Definition at line 166 of file PDG_TypeRegistry.h.

template<typename ClassType >
PDG_WorkItemDataType* PDG_TypeRegistry::registerWorkItemData ( const UT_StringHolder name,
const UT_StringHolder label,
bool  compatible = true,
bool  make_default = false 
)
inline

Utility method to regiser a custom C++-based work item data.

Definition at line 113 of file PDG_TypeRegistry.h.

PDG_SchedulerType* PDG_TypeRegistry::schedulerType ( const UT_StringHolder name) const

Returns a scheduler type object for a give name.

PDG_SchedulerType* PDG_TypeRegistry::serviceSchedulerType ( ) const
inline

Gets/sets the service scheduler type.

Definition at line 256 of file PDG_TypeRegistry.h.

PDG_ServiceType* PDG_TypeRegistry::serviceType ( const UT_StringHolder name) const

Returns a service type object for a given name.

void PDG_TypeRegistry::setDefaultWorkItemDataType ( PDG_WorkItemDataType type)
inline

Definition at line 252 of file PDG_TypeRegistry.h.

void PDG_TypeRegistry::setInProcessSchedulerType ( PDG_SchedulerType type)
inline

Definition at line 264 of file PDG_TypeRegistry.h.

void PDG_TypeRegistry::setPySerializationModule ( const UT_StringHolder mod)

Sets the custom serialization module name.

void PDG_TypeRegistry::setServiceSchedulerType ( PDG_SchedulerType type)
inline

Definition at line 258 of file PDG_TypeRegistry.h.

static PDG_TypeRegistry* PDG_TypeRegistry::types ( )
static

Returns the static type registry instance.

PDG_WorkItemDataType* PDG_TypeRegistry::workItemDataType ( const UT_StringHolder name) const

Returns a work item data type object for a given name.


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