Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ServiceBuildInfo.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/* ServiceBuildInfo.h (C) 2000-2025 */
9/* */
10/* Structure containing the information to create a service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_SERVICEBUILDINFO_H
13#define ARCANE_CORE_SERVICEBUILDINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/VersionInfo.h"
18
21#include "arcane/core/MeshHandle.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32/*!
33 * \brief Information for creating a service.
34 *
35 * Instances of this class are internal to Arcane. Generally, you must
36 * use the ServiceBuildInfo class.
37 *
38 * The different fields of this class are not all valid. Their validity
39 * depends on the constructor used. Only application() is always valid. It
40 * is possible to know the valid fields via the value of creationType().
41 */
42class ARCANE_CORE_EXPORT ServiceBuildInfoBase
43{
44 public:
45
46 /*!@{
47 * \name Constructors.
48 *
49 * The different constructors allow defining the service type
50 * (eServiceType).
51 */
52
53 /*!
54 * \brief Service associated with an application \a IApplication.
55 *
56 * The service will be of type #ST_Application.
57 */
59
60 /*!
61 * \brief Service associated with a session \a ISession.
62 *
63 * The service will be of type #ST_Session.
64 */
66
67 /*!
68 * \brief Service associated with a subdomain \a ISubDomain.
69 *
70 * The service will be of type #ST_SubDomain.
71 * Also provides access to the mesh property (\a mesh())
72 */
73 explicit ServiceBuildInfoBase(ISubDomain* sd);
74
75 /*!
76 * \brief Service associated with a mesh \a mesh.
77 *
78 * The service will be of type #ST_SubDomain.
79 */
81
82 /*!
83 * \brief Service associated with a mesh \a mesh_handle.
84 *
85 * The service will be of type #ST_SubDomain.
86 */
87 explicit ServiceBuildInfoBase(const MeshHandle& mesh_handle);
88
89 /*!
90 * \brief Service associated with a mesh \a mesh_handle.
91 *
92 * The service will be of type #ST_SubDomain.
93 */
94 ServiceBuildInfoBase(ISubDomain* sd, const MeshHandle& mesh_handle);
95
96 /*!
97 * \brief Service associated with a dataset option \a co.
98 *
99 * The service will be of type #ST_CaseOption.
100 * Also provides access to the mesh (mesh()) and
101 * subdomain (subDomain()) properties.
102 */
104
105 /*!
106 * \brief Service associated with a dataset option \a co.
107 *
108 * The service will be of type #ST_CaseOption.
109 * Also provides access to the mesh (mesh()) and
110 * subdomain (subDomain()) properties.
111 */
113
114 /*!
115 * \brief Service associated with a mesh \a mesh.
116 *
117 * The service will be of type #ST_SubDomain.
118 *
119 * \deprecated Use ServiceBuildInfoBase(const MeshHandle&) instead.
120 */
121 ARCCORE_DEPRECATED_2020("Use ServiceBuildInfoBase(const MeshHandle&) instead")
123
124 //!@}
125
126 public:
127
128 /*!
129 * \brief Access to the associated \a IApplication.
130 *
131 * The instance is never null regardless of the service.
132 */
133 IApplication* application() const { return m_application; }
134
135 /*!
136 * \brief Access to the associated \a ISession.
137 *
138 * \pre creationType() & (#ST_CaseOption|#ST_SubDomain|#ST_Session)
139 */
140 ISession* session() const { return m_session; }
141
142 /*!
143 * \brief Access to the associated \a ISubDomain.
144 *
145 * \pre creationType() & (#ST_CaseOption|#ST_SubDomain)
146 */
147 ISubDomain* subDomain() const { return m_sub_domain; }
148
149 /*!
150 * \brief Access to the associated \a IMesh.
151 *
152 * \pre creationType() & (#ST_CaseOption|#ST_SubDomain)
153 */
154 IMesh* mesh() const;
155
156 /*!
157 * \brief Access to the associated mesh handle \a MeshHandle.
158 *
159 * \pre creationType() & (#ST_CaseOption|#ST_SubDomain)
160 */
161 const MeshHandle& meshHandle() const { return m_mesh_handle; }
162
163 /*!
164 * \brief Access to the associated \a ICaseOptions.
165 *
166 * \pre creationType() & #ST_CaseOption
167 */
168 ICaseOptions* caseOptions() const { return m_case_options; }
169
170 /*!
171 * \brief Access to the parent instance that created this instance.
172 */
173 IBase* serviceParent() const { return m_service_parent; }
174
175 //! Type of service that can be created by this instance
176 eServiceType creationType() const { return m_creation_type; }
177
178 protected:
179 private:
180
181 IApplication* m_application = nullptr;
182 ISession* m_session = nullptr;
183 ISubDomain* m_sub_domain = nullptr;
184 MeshHandle m_mesh_handle;
185 ICaseOptions* m_case_options = nullptr;
186 IBase* m_service_parent = nullptr;
187 eServiceType m_creation_type = ST_None;
188};
189
190/*---------------------------------------------------------------------------*/
191/*---------------------------------------------------------------------------*/
192
193/*!
194 * \ingroup Service
195 * \brief Structure containing the information to create a service.
196 */
197class ARCANE_CORE_EXPORT ServiceBuildInfo
199{
200 public:
201
202 ServiceBuildInfo(IServiceInfo* service_info, const ServiceBuildInfoBase& base);
203
204 public:
205
206 //! Access to the associated \a IServiceInfo
207 IServiceInfo* serviceInfo() const { return m_service_info; }
208
209 private:
210
211 IServiceInfo* m_service_info;
212};
213
214/*---------------------------------------------------------------------------*/
215/*---------------------------------------------------------------------------*/
216
217} // End namespace Arcane
218
219/*---------------------------------------------------------------------------*/
220/*---------------------------------------------------------------------------*/
221
222#endif
Declarations of Arcane's general types.
This file contains the various types and classes for specifying service properties.
Application interface.
Interface of the base class for main arcane objects.
Definition IBase.h:32
Interface for service or module information.
Interface for a case execution session.
Definition ISession.h:38
Interface of the subdomain manager.
Definition ISubDomain.h:75
Handle on a mesh.
Definition MeshHandle.h:48
IMesh * mesh() const
Access to the associated IMesh.
IBase * serviceParent() const
Access to the parent instance that created this instance.
ServiceBuildInfoBase(IApplication *app)
Service associated with an application IApplication.
const MeshHandle & meshHandle() const
Access to the associated mesh handle MeshHandle.
ISession * session() const
Access to the associated ISession.
IApplication * application() const
Access to the associated IApplication.
ISubDomain * subDomain() const
Access to the associated ISubDomain.
ICaseOptions * caseOptions() const
Access to the associated ICaseOptions.
eServiceType creationType() const
Type of service that can be created by this instance.
IServiceInfo * serviceInfo() const
Access to the associated IServiceInfo.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eServiceType
Service type.