Belle II Software light-2406-ragdoll
ModuleProxyBase Class Referenceabstract

The base module proxy class is used to create new instances of a module. More...

#include <Module.h>

Collaboration diagram for ModuleProxyBase:

Public Member Functions

 ModuleProxyBase (std::string moduleType, std::string package)
 The constructor of the ModuleProxyBase class.
 
virtual ~ModuleProxyBase ()
 The destructor of the ModuleProxyBase class.
 
ModulePtr createModule () const
 Abstract method which creates a new module and returns a shared pointer to it.
 
const std::string & getModuleName () const
 Returns the module name of the module associated to this proxy.
 

Protected Member Functions

virtual ModulecreateInstance () const =0
 create a new instance of the module in question
 

Protected Attributes

std::string m_moduleType
 The type name of the module.
 
std::string m_package
 Package this module is found in (may be empty).
 

Detailed Description

The base module proxy class is used to create new instances of a module.

By loading a shared library, which contains modules, the proxy class of each module is automatically registered to the global ModuleManager. If an instance of a module is required, its proxy class is responsible to create an instance of the module.

Definition at line 597 of file Module.h.

Constructor & Destructor Documentation

◆ ModuleProxyBase()

ModuleProxyBase ( std::string  moduleType,
std::string  package 
)

The constructor of the ModuleProxyBase class.

The constructor registers the proxy to the ModuleManager.

Parameters
moduleTypeThe type name of the module.
packagethe package which contains the module

Definition at line 497 of file Module.cc.

497 :\n log_level (LogLevel): Minimum level for messages to be displayed")
498 .def("set_debug_level", &Module::setDebugLevel, bp::arg("debug_level"),
499 "Set the debug level for this module. Debug messages with a higher level will "
500 "be suppressed. This function has no visible effect if the log level is "
501 "not set to `DEBUG <LogLevel.DEBUG>`\n\n"

◆ ~ModuleProxyBase()

virtual ~ModuleProxyBase ( )
inlinevirtual

The destructor of the ModuleProxyBase class.

Definition at line 611 of file Module.h.

611{};

Member Function Documentation

◆ createModule()

ModulePtr createModule ( ) const
inline

Abstract method which creates a new module and returns a shared pointer to it.

Instances of modules can only be created by this method.

Returns
A shared pointer to the created module instance.

Definition at line 618 of file Module.h.

619 {
621 nm->setType(m_moduleType);
622 nm->setName(m_moduleType);
623 nm->m_package = m_package;
624 return nm;
625 }
virtual Module * createInstance() const =0
create a new instance of the module in question
std::string m_moduleType
The type name of the module.
Definition: Module.h:637
std::string m_package
Package this module is found in (may be empty).
Definition: Module.h:638
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition: Module.h:43

◆ getModuleName()

const std::string & getModuleName ( ) const
inline

Returns the module name of the module associated to this proxy.

Definition at line 630 of file Module.h.

630{return m_moduleType; }

Member Data Documentation

◆ m_moduleType

std::string m_moduleType
protected

The type name of the module.

(without trailing "Module")

Definition at line 637 of file Module.h.

◆ m_package

std::string m_package
protected

Package this module is found in (may be empty).

Definition at line 638 of file Module.h.


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