12#ifndef ARCANE_MODULEFACTORY_H
13#define ARCANE_MODULEFACTORY_H
17#include "arcane/IServiceFactory.h"
18#include "arcane/IModuleFactory.h"
19#include "arcane/ServiceRegisterer.h"
20#include "arcane/ModuleBuildInfo.h"
21#include "arcane/IServiceInfo.h"
22#include "arcane/ModuleProperty.h"
23#include "arcane/ServiceProperty.h"
58 void addReference()
override;
59 void removeReference()
override;
61 bool isAutoload()
const override {
return m_is_autoload; }
62 void initializeModuleFactory(
ISubDomain* sub_domain)
override;
68 Ref<IModuleFactory2> m_factory;
71 std::atomic<Int32> m_nb_ref;
86 : m_service_info(service_info), m_name(name)
98 return m_service_info;
115template<
class ModuleType>
129 return makeRef<IModule>(x);
134 ModuleType::staticInitialize(sd);
166#define ARCANE_REGISTER_MODULE(class_name,a_module_properties) \
167extern "C++" ARCANE_EXPORT Arcane::IModuleFactoryInfo*\
168ARCANE_JOIN_WITH_LINE(arcaneCreateModuleFactory##class_name) (const Arcane::ModuleProperty& properties) \
170 const char* module_name = properties.name();\
171 Arcane::ServiceProperty sp(module_name,0);\
172 auto* si = Arcane::Internal::ServiceInfo::create(sp,__FILE__,__LINE__); \
173 Arcane::IModuleFactory2* mf = new Arcane::ModuleFactory2T< class_name >(si,module_name); \
174 return new Arcane::ModuleFactory(Arcane::makeRef(mf), properties.isAutoload()); \
176Arcane::ServiceRegisterer ARCANE_EXPORT ARCANE_JOIN_WITH_LINE(globalModuleRegisterer##class_name) \
177 (& ARCANE_JOIN_WITH_LINE(arcaneCreateModuleFactory##class_name),a_module_properties)
187#define ARCANE_REGISTER_AXL_MODULE(class_name,a_module_properties) \
188extern "C++" ARCANE_EXPORT Arcane::IModuleFactoryInfo*\
189ARCANE_JOIN_WITH_LINE(arcaneCreateModuleFactory##class_name) (const Arcane::ModuleProperty& properties) \
191 const char* module_name = properties.name();\
192 Arcane::ServiceProperty sp(module_name,0);\
193 auto* si = Arcane::Internal::ServiceInfo::create(sp,__FILE__,__LINE__); \
194 class_name :: fillServiceInfo(si); \
195 Arcane::IModuleFactory2* mf = new Arcane::ModuleFactory2T< class_name >(si,module_name); \
196 return new Arcane::ModuleFactory(Arcane::makeRef(mf),properties.isAutoload()); \
198Arcane::ServiceRegisterer ARCANE_EXPORT ARCANE_JOIN_WITH_LINE(globalModuleRegisterer##class_name) \
199 (& ARCANE_JOIN_WITH_LINE(arcaneCreateModuleFactory##class_name),a_module_properties)
211#define ARCANE_DEFINE_STANDARD_MODULE(class_name,module_name) \
212 ARCANE_REGISTER_MODULE(class_name,Arcane::ModuleProperty(#module_name))
Informations sur la fabrique d'un module.
Interface des informations d'un service ou d'un module.
Interface du gestionnaire d'un sous-domaine.
Informations pour construire un module.
Ref< IModule > createModuleInstance(ISubDomain *sd, const MeshHandle &mesh_handle) override
Créé un module.
void initializeModuleFactory(ISubDomain *sd) override
Initialisation statique du module.
String moduleName() const override
Nom du module créé par cette fabrique.
const IServiceInfo * serviceInfo() const override
Informations sur le module pouvant être créé par cette fabrique.
String moduleName() const override
Nom du module créé par cette fabrique.
bool isAutoload() const override
Indique si le module et doit être chargé automatiquement.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-