Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ServiceRegisterer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ServiceRegisterer.h (C) 2000-2025 */
9/* */
10/* Singleton allowing service registration. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_SERCVICEREGISTERER_H
13#define ARCANE_CORE_SERCVICEREGISTERER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19#include "arcane/core/ModuleProperty.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
48class ARCANE_CORE_EXPORT ServiceRegisterer
49{
50 public:
51
52 typedef IModuleFactoryInfo* (*ModuleFactoryWithPropertyFunc)(const ModuleProperty& properties);
53 typedef IServiceInfo* (*ServiceInfoWithPropertyCreateFunc)(const ServiceProperty& properties);
54
55 public:
56
62 ServiceRegisterer(ServiceInfoWithPropertyCreateFunc func, const ServiceProperty& properties) ARCANE_NOEXCEPT;
63
69 ServiceRegisterer(ModuleFactoryWithPropertyFunc func, const ModuleProperty& properties) ARCANE_NOEXCEPT;
70
71 public:
72
79 ServiceInfoWithPropertyCreateFunc infoCreatorWithPropertyFunction() { return m_info_function_with_property; }
80
88
90 const char* name() { return m_name; }
91
97 ARCANE_DEPRECATED_260 const ServiceProperty& property() const { return m_service_property; }
98
101
104
107
110
111 private:
112
114
116
118
120
121 public:
122
124 static ServiceRegisterer* firstService();
125
127 static Integer nbService();
128
129 private:
130
132 ModuleFactoryWithPropertyFunc m_module_factory_with_property_functor = nullptr;
134 ServiceInfoWithPropertyCreateFunc m_info_function_with_property = nullptr;
136 const char* m_name = nullptr;
145
146 private:
147
148 void _init();
149};
150
151/*---------------------------------------------------------------------------*/
152/*---------------------------------------------------------------------------*/
153
154} // namespace Arcane
155
156/*---------------------------------------------------------------------------*/
157/*---------------------------------------------------------------------------*/
158
159#endif
Declarations of Arcane's general types.
This file contains the various types and classes for specifying service properties.
Information about a module factory.
Interface for service or module information.
Module creation properties.
Service creation properties.
Service and module registrar.
void setPreviousService(ServiceRegisterer *s)
Positions the previous service.
ModuleProperty m_module_property
Module properties.
ServiceRegisterer * m_next
Next service.
ServiceRegisterer * m_previous
Previous service.
ServiceRegisterer * previousService() const
Previous service (0 if the first).
ServiceRegisterer * nextService() const
Next service (0 if the last).
ServiceInfoWithPropertyCreateFunc m_info_function_with_property
Function to create the IServiceInfo.
void setNextService(ServiceRegisterer *s)
Positions the next service.
const ServiceProperty & serviceProperty() const
Properties in the case of a service.
const char * name()
Service name.
ModuleFactoryWithPropertyFunc moduleFactoryWithPropertyFunction()
Creation function for the factory if it is a module.
ServiceInfoWithPropertyCreateFunc infoCreatorWithPropertyFunction()
Creation function for the 'ServiceInfo' instance if it is a service.
ModuleFactoryWithPropertyFunc m_module_factory_with_property_functor
Function to create the IModuleFactory.
const ModuleProperty & moduleProperty() const
Properties in the case of a module.
ARCANE_DEPRECATED_260 const ServiceProperty & property() const
Service properties.
const char * m_name
Service name.
ServiceRegisterer(ServiceInfoWithPropertyCreateFunc func, const ServiceProperty &properties) ARCANE_NOEXCEPT
Creates a registrar for the service name and the function func.
ServiceProperty m_service_property
Service properties.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.