Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CaseOptions.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/* CaseOptions.h (C) 2000-2025 */
9/* */
10/* Data set options. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CASEOPTIONS_H
13#define ARCANE_CASEOPTIONS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include "arcane/utils/Array.h"
20#include "arcane/utils/String.h"
21#include "arcane/utils/Ref.h"
22
23#include "arcane/core/XmlNode.h"
24#include "arcane/core/ICaseOptions.h"
25#include "arcane/core/ICaseOptionList.h"
26
27// These files are not necessary for this '.h' but are included
28// because axlstar only includes 'CaseOptions.h'
29#include "arcane/core/CaseOptionSimple.h"
30#include "arcane/core/CaseOptionEnum.h"
31#include "arcane/core/CaseOptionExtended.h"
32#include "arcane/core/CaseOptionComplexValue.h"
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37namespace Arcane
38{
39namespace AxlOptionsBuilder
40{
41 class Document;
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
55class ARCANE_CORE_EXPORT CaseOptions
57, public ICaseOptions
58{
60
61 private:
62
64 {
65 String m_xml_content;
66 IXmlDocumentHolder* m_document = nullptr;
67 };
68
69 public:
70
72 CaseOptions(ICaseMng* cm, const String& name);
76 CaseOptions(ICaseMng* cm, const String& name, const XmlNode& parent);
78 CaseOptions(ICaseOptionList*, const String& name, const XmlNode& parent, bool is_optional = false, bool is_multi = false);
80
81 protected:
82
86
87 private:
88
89 friend class ServiceBuilderWithOptionsBase;
90
91 // Only for ServiceBuilderWithOptionsBase
92 static ReferenceCounter<ICaseOptions> createDynamic(ICaseMng* cm, const AxlOptionsBuilder::Document& options_doc);
93
95 CaseOptions(ICaseMng*, const XmlContent& xm_content);
96
97 public:
98
100 ~CaseOptions() override;
101
102 private:
103
104 CaseOptions(const CaseOptions& rhs) = delete;
105 CaseOptions& operator=(const CaseOptions& rhs) = delete;
106
107 public:
108
110 String rootTagTrueName() const override;
111
113 String rootTagName() const override;
114
116 String translatedName(const String& lang) const override;
117
119 virtual String trueName() const { return rootTagTrueName(); }
120
122 virtual String name() const { return rootTagName(); }
123
124 void read(bool is_phase1) override
125 {
126 auto p = (is_phase1) ? eCaseOptionReadPhase::Phase1 : eCaseOptionReadPhase::Phase2;
127 read(p);
128 }
129
130 void read(eCaseOptionReadPhase phase) override;
131
132 void addInvalidChildren(XmlNodeList&) override;
133
134 void printChildren(const String& lang, int indent) override;
135
137 IServiceInfo* caseServiceInfo() const override;
138
140 IModule* caseModule() const override;
141
143 void setCaseServiceInfo(IServiceInfo* m) override;
144
146 void setCaseModule(IModule* m) override;
147
149 void deepGetChildren(Array<CaseOptionBase*>& col) override;
150
151 ICaseOptionList* configList() override;
152
153 const ICaseOptionList* configList() const override;
154
156 ICaseFunction* activateFunction() override;
157
162 bool isPresent() const override;
163
170 void addAlternativeNodeName(const String& lang, const String& name) override;
171
172 ICaseMng* caseMng() const override;
173 ITraceMng* traceMng() const override;
174 ISubDomain* subDomain() const override;
175 IMesh* mesh() const override;
176 MeshHandle meshHandle() const override;
177 ICaseDocument* caseDocument() const override;
178 ICaseDocumentFragment* caseDocumentFragment() const override;
179
180 void detach() override;
181
182 void visit(ICaseDocumentVisitor* visitor) const override;
183
184 String xpathFullName() const override;
185
186 Ref<ICaseOptions> toReference() override;
187
188 protected:
189
190 friend class CaseOptionMultiServiceImpl;
191
192 void _setTranslatedName();
193 bool _setMeshHandleAndCheckDisabled(const String& mesh_name);
194
195 protected:
196
198
199 private:
200
201 void _setMeshHandle(const MeshHandle& handle);
202 void _setParent(ICaseOptionList* parent);
203};
204
205/*---------------------------------------------------------------------------*/
206/*---------------------------------------------------------------------------*/
207
208} // End namespace Arcane
209
210/*---------------------------------------------------------------------------*/
211/*---------------------------------------------------------------------------*/
212
213#endif
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to define methods managing counters of references.
Data set 'ServiceInstance' option.
String rootTagName() const override
Returns the name of the element in the data set language.
String rootTagTrueName() const override
Returns the true name (non-translated) of the element.
virtual String trueName() const
Returns the true name (non-translated) of the element.
String translatedName(const String &lang) const override
Name in language lang of the option. Returns rootTagTrueName() if no translation exists.
virtual String name() const
Returns the name of the element in the data set language.
CaseOptionsPrivate * m_p
Implementation.
CaseOptions(ICaseMng *cm, const String &name)
Constructs an options set.
Case manager interface.
Definition ICaseMng.h:57
Interface for a data set options list.
Interface for a list of data set options.
Manager of a DOM document.
Handle on a mesh.
Definition MeshHandle.h:48
Thread-safe implementation of a reference counter.
Encapsulation of a pointer with a reference counter.
Node of a DOM tree.
Definition XmlNode.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eCaseOptionReadPhase
Reading phases.