Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICaseOptions.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/* ICaseOptions.h (C) 2000-2025 */
9/* */
10/* Data set options. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICASEOPTIONS_H
13#define ARCANE_CORE_ICASEOPTIONS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \internal
30 * \brief Interface for a list of data set options.
31 *
32 * This interface is managed by a reference counter and should not be
33 * explicitly destroyed.
34 */
35class ARCANE_CORE_EXPORT ICaseOptions
36{
38
39 protected:
40
41 virtual ~ICaseOptions() = default;
42
43 public:
44
45 //! True name (untranslated) of the element.
46 virtual String rootTagTrueName() const = 0;
47
48 //! Name of the element in the data set language.
49 virtual String rootTagName() const = 0;
50
51 //! Name in the language \a lang of the option. Returns \a rootTagTrueName() if no translation exists.
52 virtual String translatedName(const String& lang) const = 0;
53
54 ARCCORE_DEPRECATED_2019("Use read(eCaseOptionReadPhase) instead")
55 virtual void read(bool is_phase1) = 0;
56
57 /*!
58 * \brief Performs the reading of the \a read_phase phase of the options.
59 */
60 virtual void read(eCaseOptionReadPhase read_phase) = 0;
61
62 virtual void addInvalidChildren(XmlNodeList&) = 0;
63
64 virtual void printChildren(const String& lang, int indent) = 0;
65
66 //! Returns the associated service or `nullptr` if none exists.
67 virtual IServiceInfo* caseServiceInfo() const = 0;
68
69 //! Returns the associated module or `nullptr` if none exists.
70 virtual IModule* caseModule() const = 0;
71
72 /*!
73 * \internal
74 * \brief Associates the service \a m with this data set.
75 */
76 virtual void setCaseServiceInfo(IServiceInfo* m) = 0;
77
78 /*!
79 * \internal
80 * \brief Associates the module \a m with this data set.
81 */
82 virtual void setCaseModule(IModule* m) = 0;
83
84 /*!
85 * \internal
86 * \brief Adds all child options to the list \a col.
87 */
88 virtual void deepGetChildren(Array<CaseOptionBase*>& col) = 0;
89
90 virtual ICaseOptionList* configList() = 0;
91
92 virtual const ICaseOptionList* configList() const = 0;
93
94 //! Function indicating the activation status of the option
96
97 /*!
98 * \brief Indicates whether the option is present in the data set.
99 *
100 * An option may not appear if it only contains options with a default value.
101 */
102 virtual bool isPresent() const = 0;
103
104 /*!
105 * \internal
106 * \brief Adds a translation for the option name.
107 *
108 * Adds the option name \a name corresponding to the language \a lang.
109 * If a translation already exists for this language, it is replaced by
110 * this one.
111 */
112 virtual void addAlternativeNodeName(const String& lang, const String& name) = 0;
113
114 virtual ICaseMng* caseMng() const = 0;
115 virtual ITraceMng* traceMng() const = 0;
116 /*!
117 * \brief Associated sub-domain.
118 *
119 * \deprecated Do not use this method because eventually an option
120 * may exist without a sub-domain.
121 */
122 ARCCORE_DEPRECATED_2019("Do not use subDomain(). Try to get subDomain from an other way.")
123 virtual ISubDomain* subDomain() const = 0;
124 ARCCORE_DEPRECATED_2019("Use meshHandle().mesh() instead")
125 virtual IMesh* mesh() const = 0;
126 virtual MeshHandle meshHandle() const = 0;
127 ARCANE_DEPRECATED_REASON("Y2023: use caseMng()->caseDocument() instead.")
128 virtual ICaseDocument* caseDocument() const = 0;
129 virtual ICaseDocumentFragment* caseDocumentFragment() const = 0;
130
131 /*!
132 * \internal
133 * Detaches the option from its parent.
134 */
135 virtual void detach() = 0;
136
137 //! Applies the visitor to this option
138 virtual void visit(ICaseDocumentVisitor* visitor) const = 0;
139
140 //! Full name in XPath format corresponding to rootElement()
141 virtual String xpathFullName() const = 0;
142
143 public:
144
145 virtual Ref<ICaseOptions> toReference() = 0;
146};
147
148/*---------------------------------------------------------------------------*/
149/*---------------------------------------------------------------------------*/
150/*!
151 * \internal
152 * \brief Interface for a list of options that appears multiple times.
153 */
154class ARCANE_CORE_EXPORT ICaseOptionsMulti
155{
156 public:
157
158 virtual ~ICaseOptionsMulti() {}
159
160 public:
161
162 virtual void multiAllocate(const XmlNodeList&) = 0;
163 virtual ICaseOptions* toCaseOptions() = 0;
164 virtual void addChild(ICaseOptionList* v) = 0;
165 virtual Integer nbChildren() const = 0;
166 virtual ICaseOptionList* child(Integer index) const = 0;
167};
168
169/*---------------------------------------------------------------------------*/
170/*---------------------------------------------------------------------------*/
171
172extern "C++" ARCANE_CORE_EXPORT ISubDomain*
173_arcaneDeprecatedGetSubDomain(ICaseOptions* opt);
174
175/*---------------------------------------------------------------------------*/
176/*---------------------------------------------------------------------------*/
177
178} // End namespace Arcane
179
180/*---------------------------------------------------------------------------*/
181/*---------------------------------------------------------------------------*/
182
183#endif
Declarations of types related to dataset options.
#define ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to declare the virtual methods managing reference counters.
Base class for 1D data vectors.
Base class for a data set option.
Visitor interface for a dataset option.
Case manager interface.
Definition ICaseMng.h:57
virtual void visit(ICaseDocumentVisitor *visitor) const =0
Applies the visitor to this option.
virtual IServiceInfo * caseServiceInfo() const =0
Returns the associated service or nullptr if none exists.
virtual bool isPresent() const =0
Indicates whether the option is present in the data set.
virtual ISubDomain * subDomain() const =0
Associated sub-domain.
virtual ICaseFunction * activateFunction()=0
Function indicating the activation status of the option.
virtual IModule * caseModule() const =0
Returns the associated module or nullptr if none exists.
virtual String rootTagTrueName() const =0
True name (untranslated) of the element.
virtual String rootTagName() const =0
Name of the element in the data set language.
virtual String xpathFullName() const =0
Full name in XPath format corresponding to rootElement().
virtual String translatedName(const String &lang) const =0
Name in the language lang of the option. Returns rootTagTrueName() if no translation exists.
Interface of a module.
Definition IModule.h:40
Interface for service or module information.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Handle on a mesh.
Definition MeshHandle.h:48
Reference to an instance.
List of nodes of a DOM tree.
Definition XmlNodeList.h:36
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eCaseOptionReadPhase
Reading phases.
Int32 Integer
Type representing an integer.