Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Service

Collection of types used in service management. More...

Classes

class  Arcane::AbstractService
 Base class of a service. More...
class  Arcane::BasicService
 Base class of a service linked to a subdomain. More...
class  Arcane::IServiceInfo
 Interface for service or module information. More...
class  Arcane::ServiceBuilder< InterfaceType >
 Utility class for instantiating a service of a given interface. More...
class  Arcane::ServiceBuildInfo
 Structure containing the information to create a service. More...

Macros

#define ARCANE_REGISTER_MODULE(class_name, a_module_properties)
 Macro for registering a module.
#define ARCANE_REGISTER_SERVICE(aclass, a_service_property, ...)
 Macro for registering a service.

Detailed Description

Collection of types used in service management.

Most user services are subdomain services and derive indirectly from the BasicService class. Generally, a service is defined in an AXL file, and the tool axl2cc allows generating the base class of a service from this AXL file. For more information, refer to section Service.

Nevertheless, it is possible to have services without an AXL file. In this case, registering a service so that it is recognized by Arcane is done via the ARCANE_REGISTER_SERVICE() macro.

Macro Definition Documentation

◆ ARCANE_REGISTER_MODULE

#define ARCANE_REGISTER_MODULE ( class_name,
a_module_properties )
Value:
extern "C++" ARCANE_EXPORT Arcane::IModuleFactoryInfo* \
ARCANE_JOIN_WITH_LINE(arcaneCreateModuleFactory##class_name)(const Arcane::ModuleProperty& properties) \
{ \
const char* module_name = properties.name(); \
Arcane::ServiceProperty sp(module_name, 0); \
auto* si = Arcane::Internal::ServiceInfo::create(sp, __FILE__, __LINE__); \
return new Arcane::ModuleFactory(Arcane::makeRef(mf), properties.isAutoload()); \
} \
Arcane::ServiceRegisterer ARCANE_EXPORT ARCANE_JOIN_WITH_LINE(globalModuleRegisterer##class_name)(&ARCANE_JOIN_WITH_LINE(arcaneCreateModuleFactory##class_name), a_module_properties)
Information about a module factory.
Module creation properties.
Service creation properties.
Service and module registrar.
auto makeRef(InstanceType *t) -> Ref< InstanceType >
Creates a reference on a pointer.

Macro for registering a module.

The call is as follows:

Arcane::ModuleProperty("ModuleName"));
#define ARCANE_REGISTER_MODULE(class_name, a_module_properties)
Macro for registering a module.

With the following parameters:

  • ClassName is the name of the module class,
  • "ModuleName" is the name of the module.

For example, usage can be as follows:

ARCANE_REGISTER_MODULE(ModuleSimpleHydro,
ModuleProperty("SimpleHydro"));
Note
This macro is used to register modules that do not have associated files axl files. If that is not the case, you must use the macro defined in the '.h' file generated from the axl file.

Definition at line 171 of file ModuleFactory.h.

◆ ARCANE_REGISTER_SERVICE

#define ARCANE_REGISTER_SERVICE ( aclass,
a_service_property,
... )
Value:
namespace \
{ \
ARCANE_JOIN_WITH_LINE(arcaneCreateServiceInfo##aclass)(const Arcane::ServiceProperty& property) \
{ \
auto* si = Arcane::Internal::ServiceInfo::create(property, __FILE__, __LINE__); \
Arcane::Internal::ServiceAllInterfaceRegisterer<aclass>::registerToServiceInfo(si, __VA_ARGS__); \
return si; \
} \
} \
Arcane::ServiceRegisterer ARCANE_EXPORT ARCANE_JOIN_WITH_LINE(globalServiceRegisterer##aclass)(&ARCANE_JOIN_WITH_LINE(arcaneCreateServiceInfo##aclass), a_service_property)
Interface for service or module information.

Macro for registering a service.

The call is as follows:

ServiceProperty("ServiceName",where),
ARCANE_SERVICE_INTERFACE(InterfaceName1),);
ARCANE_SERVICE_INTERFACE(InterfaceName2),...);
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro to declare an interface when registering a service.
#define ARCANE_REGISTER_SERVICE(aclass, a_service_property,...)
Macro for registering a service.

With the following parameters:

  • ClassName is the name of the service class,
  • "ServiceName" is the name of the service.
  • where is of type eServiceType and indicates where the service can be created.
  • InterfaceName is the name of the interface implemented by the service. It is possible to specify multiple interfaces for the same service.

For example, usage can be as follows:

ARCANE_REGISTER_SERVICE(ThreadParallelSuperMng,
ServiceProperty("ThreadParallelSuperMng",ST_Application),
ARCANE_SERVICE_INTERFACE(IParallelSuperMng));
Note
This macro uses a global object to register the service and should therefore not be used in a file that may belong to multiple compilation units (for example, it should not be in a header file).

Definition at line 578 of file ServiceFactory.h.