Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ModuleFactory Class Reference

Module factory. More...

#include <arcane/core/ModuleFactory.h>

Inheritance diagram for Arcane::ModuleFactory:
Collaboration diagram for Arcane::ModuleFactory:

Public Member Functions

 ModuleFactory (Ref< IModuleFactory2 > factory, bool is_autoload)
 Constructs a factory for a module.
void addReference () override
void removeReference () override
Ref< IModulecreateModule (ISubDomain *parent, const MeshHandle &mesh_handle) override
 Creates a module.
bool isAutoload () const override
 Indicates if the module should be loaded automatically.
void initializeModuleFactory (ISubDomain *sub_domain) override
 If the factory is a one-to-one module, initializes it on the sub-domain sub_domain.
String moduleName () const override
 Name of the module created by this factory.
const IServiceInfoserviceInfo () const override
 Information about the module that can be created by this factory.

Private Attributes

Ref< IModuleFactory2m_factory
bool m_is_autoload
String m_name
std::atomic< Int32m_nb_ref

Additional Inherited Members

Protected Member Functions inherited from Arcane::IModuleFactoryInfo
virtual ~IModuleFactoryInfo ()
 Releases resources.

Detailed Description

Module factory.

Definition at line 40 of file ModuleFactory.h.

Constructor & Destructor Documentation

◆ ModuleFactory()

Arcane::ModuleFactory::ModuleFactory ( Ref< IModuleFactory2 > factory,
bool is_autoload )

Constructs a factory for a module.

This constructor is used by the ARCANE_REGISTER_MODULE and ARCANE_REGISTER_AXL_MODULE macros.

This instance becomes the owner of factory and will destroy it in the destructor.

Definition at line 38 of file ModuleFactory.cc.

References moduleName().

Here is the call graph for this function:

◆ ~ModuleFactory()

Arcane::ModuleFactory::~ModuleFactory ( )
override

Definition at line 53 of file ModuleFactory.cc.

Member Function Documentation

◆ addReference()

void Arcane::ModuleFactory::addReference ( )
overridevirtual

Implements Arcane::IModuleFactoryInfo.

Definition at line 99 of file ModuleFactory.cc.

◆ createModule()

Ref< IModule > Arcane::ModuleFactory::createModule ( ISubDomain * parent,
const MeshHandle & mesh_handle )
overridevirtual

Creates a module.

The implementation must call parent->moduleMng()->addModule() for the created module.

Parameters
parentParent of this module.
meshmesh associated with the module.
Returns
the created module

Implements Arcane::IModuleFactoryInfo.

Definition at line 61 of file ModuleFactory.cc.

References Arcane::IModuleMng::addModule(), ARCANE_FATAL, Arcane::ISubDomain::checkId(), Arcane::ISubDomain::moduleMng(), and moduleName().

Here is the call graph for this function:

◆ initializeModuleFactory()

void Arcane::ModuleFactory::initializeModuleFactory ( ISubDomain * sub_domain)
overridevirtual

If the factory is a one-to-one module, initializes it on the sub-domain sub_domain.

This method is called when the sub-domain is created, to perform specific module initializations before it is manufactured. For example, to add time loops specific to the module.

Implements Arcane::IModuleFactoryInfo.

Definition at line 81 of file ModuleFactory.cc.

◆ isAutoload()

bool Arcane::ModuleFactory::isAutoload ( ) const
inlineoverridevirtual

Indicates if the module should be loaded automatically.

If this property is true, the module will always be loaded even if it does not appear in the time loop.

Implements Arcane::IModuleFactoryInfo.

Definition at line 62 of file ModuleFactory.h.

◆ moduleName()

String Arcane::ModuleFactory::moduleName ( ) const
inlineoverridevirtual

Name of the module created by this factory.

Implements Arcane::IModuleFactoryInfo.

Definition at line 64 of file ModuleFactory.h.

Referenced by createModule(), and ModuleFactory().

Here is the caller graph for this function:

◆ removeReference()

void Arcane::ModuleFactory::removeReference ( )
overridevirtual

Implements Arcane::IModuleFactoryInfo.

Definition at line 108 of file ModuleFactory.cc.

◆ serviceInfo()

const IServiceInfo * Arcane::ModuleFactory::serviceInfo ( ) const
overridevirtual

Information about the module that can be created by this factory.

The returned instance remains the property of the application that created it and must neither be modified nor destroyed.

Implements Arcane::IModuleFactoryInfo.

Definition at line 90 of file ModuleFactory.cc.

Member Data Documentation

◆ m_factory

Ref<IModuleFactory2> Arcane::ModuleFactory::m_factory
private

Definition at line 69 of file ModuleFactory.h.

◆ m_is_autoload

bool Arcane::ModuleFactory::m_is_autoload
private

Definition at line 70 of file ModuleFactory.h.

◆ m_name

String Arcane::ModuleFactory::m_name
private

Definition at line 71 of file ModuleFactory.h.

◆ m_nb_ref

std::atomic<Int32> Arcane::ModuleFactory::m_nb_ref
private

Definition at line 72 of file ModuleFactory.h.


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