Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ServiceInfo.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/* ServiceInfo.h (C) 2000-2025 */
9/* */
10/* Information about a service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_SERVICEINFO_H
13#define ARCANE_CORE_SERVICEINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18#include "arcane/utils/FileContent.h"
19#include "arcane/core/IServiceInfo.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26//TODO: to be removed. This is kept for compatibility with the axl generator.
29} // namespace Arcane
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34namespace Arcane::Internal
35{
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45/*!
46 * \internal
47 * \brief Information about a service.
48 */
49class ARCANE_CORE_EXPORT ServiceInfo
50: public IServiceInfo
51{
52 public:
53
54 //! Constructor
55 ServiceInfo(const String& local_name, const VersionInfo& version,
56 Integer valid_dimension);
57
58 //! Destructor
59 ~ServiceInfo() override;
60
61 public:
62
63 //!@{ @name Methods inherited from IServiceInfo
64 String localName() const override;
65 String namespaceURI() const override;
66 VersionInfo version() const override;
67 Real axlVersion() const override;
68 bool allowDimension(Integer n) const override;
69 void addImplementedInterface(const String& name) override;
71 const String& caseOptionsFileName() const override;
72 ServiceFactory2Collection factories() const override;
74 String tagName(const String& lang) const override;
75 const FileContent& axlContent() const override;
76 //!@}
77
78 //!@{ @name Specific construction methods
79 virtual void setAxlVersion(Real v) const;
80 virtual void setCaseOptionsFileName(const String& fn);
81 virtual void addFactory(IServiceFactory2* factory);
82 virtual void setDefaultTagName(const String& value);
83 virtual void setTagName(const String& value, const String& lang);
84 virtual void setSingletonFactory(Internal::ISingletonServiceFactory* f);
85 //!@}
86
87 //! Info on the factories available for this service
88 IServiceFactoryInfo* factoryInfo() const override;
89 void setFactoryInfo(IServiceFactoryInfo* sfi);
90
91 void setAxlContent(const FileContent& file_content);
92
93 int usageType() const override;
94
95 public:
96
97 // Creation function used by C++ macros.
98 static ServiceInfo* create(const ServiceProperty& sp, const char* filename, int lineno);
99
100 // Creation function used by C#.
101 // (C# cannot use the C++ method because of ServiceProperty
102 // which contains a const char* that will be collected by the garbage collector)
103 static ServiceInfo* create(const String& name, int service_type);
104
105 private:
106
108};
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
112
113} // namespace Arcane::Internal
114
115/*---------------------------------------------------------------------------*/
116/*---------------------------------------------------------------------------*/
117
118#endif
Description and content of a file.
Definition FileContent.h:33
Information about a service factory.
Interface for service or module information.
ServiceInfo(const String &local_name, const VersionInfo &version, Integer valid_dimension)
Constructor.
const FileContent & axlContent() const override
Content of the AXL file associated with this service or module.
String localName() const override
Local part of the service name.
String namespaceURI() const override
Service name namespace.
bool allowDimension(Integer n) const override
Indicates if the service is usable in dimension n.
VersionInfo version() const override
Service version.
StringCollection implementedInterfaces() const override
List of names of classes implemented by this service.
ServiceFactory2Collection factories() const override
List of service factories.
void addImplementedInterface(const String &name) override
Adds the name interface name to the interfaces implemented by this service.
ISingletonServiceFactory * singletonFactory() const override
Factory for singleton services (nullptr if not supported).
int usageType() const override
Indicates where the service can be used.
const String & caseOptionsFileName() const override
Name of the file containing the dataset (null if none).
IServiceFactoryInfo * factoryInfo() const override
Info on the factories available for this service.
Real axlVersion() const override
Version of the axl file describing this service.
String tagName(const String &lang) const override
Name of the service XML element for the language lang. If lang is null, returns the default name.
Service creation properties.
Information about a version.
Definition VersionInfo.h:47
Internal types of Arcane.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
Collection< String > StringCollection
Collection of strings.
Definition UtilsTypes.h:506
Collection< Internal::IServiceFactory2 * > ServiceFactory2Collection
Collection of service factories.
double Real
Type representing a real number.