Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICaseDocument.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/* ICaseDocument.h (C) 2000-2025 */
9/* */
10/* Interface of a class managing an XML document of the dataset. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICASEDOCUMENT_H
13#define ARCANE_CORE_ICASEDOCUMENT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/XmlNodeList.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28class CaseNodeNames;
29class XmlNode;
31class CaseOptionError;
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36/*!
37 * \internal
38 * \brief Interface of a part of a dataset.
39 */
41{
42 public:
43
44 virtual ~ICaseDocumentFragment() = default;
45
46 public:
47
48 /*!
49 * \brief Returns the XML document of the dataset.
50 * This pointer remains the property of this class and is destroyed when this
51 * instance is destroyed.
52 */
54
55 //! Returns the document node
56 virtual XmlNode documentNode() = 0;
57
58 //! Returns the root element.
59 virtual XmlNode rootElement() = 0;
60
61 //! Language used in the dataset
62 virtual String language() const = 0;
63
64 //! Category used for default values.
65 virtual String defaultCategory() const = 0;
66
67 //! Returns the instance containing the names of XML nodes by language.
69
70 public:
71
72 //! Adds an error to the dataset
73 virtual void addError(const CaseOptionError& case_error) = 0;
74
75 //! Adds a warning to the dataset
76 virtual void addWarning(const CaseOptionError& case_error) = 0;
77
78 // Indicates if the dataset contains errors.
79 virtual bool hasError() const = 0;
80
81 // Indicates if the dataset contains warnings.
82 virtual bool hasWarnings() const = 0;
83
84 //! Writes the errors to the stream o
85 virtual void printErrors(std::ostream& o) = 0;
86
87 //! Writes the warnings to the stream o
88 virtual void printWarnings(std::ostream& o) = 0;
89
90 //! Clears the recorded error and warning messages
91 virtual void clearErrorsAndWarnings() = 0;
92};
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97/*!
98 * \internal
99 * \brief Interface of a class managing an XML document of the dataset.
100 * \todo Stop inheriting from ICaseDocumentFragment (use the fragment() method instead)
101 */
104{
105 public:
106
107 //! Constructs the instance
108 virtual void build() = 0;
109
110 //! Clones the document
111 virtual ICaseDocument* clone() = 0;
112
113 public:
114
115 //! Returns the instance containing the names of XML nodes by language.
117
118 //! Returns the information element for Arcane
119 virtual XmlNode arcaneElement() = 0;
120
121 //! Returns the configuration information element
123
124 //! Returns the element containing the time loop choice
126 //! Returns the element containing the case title
127 virtual XmlNode titleElement() = 0;
128 //! Returns the element containing the case description
130 //! Returns the element containing the module descriptions
131 virtual XmlNode modulesElement() = 0;
132 //! Returns the element containing the service descriptions
134
135 //! Returns the root element of the functions
137
138 //! Returns the root element of the mesh information
139 virtual const XmlNodeList& meshElements() = 0;
140
141 //! Element containing the list of meshes (new mechanism) (can be null)
142 virtual XmlNode meshesElement() = 0;
143
144 //! Name of the case usage class
145 virtual String userClass() const = 0;
146 //! Sets the name of the case usage class
147 virtual void setUserClass(const String& value) = 0;
148
149 //! Name of the case code
150 virtual String codeName() const = 0;
151 //! Sets the name of the case code
152 virtual void setCodeName(const String& value) = 0;
153
154 //! Version number of the code corresponding to the case
155 virtual String codeVersion() const = 0;
156 //! Sets the version number of the code
157 virtual void setCodeVersion(const String& value) = 0;
158
159 //! Name of the document's unit system.
160 virtual String codeUnitSystem() const = 0;
161 //! Sets the name of the document's unit system.
162 virtual void setCodeUnitSystem(const String& value) = 0;
163
164 //! Sets the category used for default values.
165 virtual void setDefaultCategory(const String& v) = 0;
166
167 //! Fragment corresponding to this document
169};
170
171/*---------------------------------------------------------------------------*/
172/*---------------------------------------------------------------------------*/
173
174} // End namespace Arcane
175
176/*---------------------------------------------------------------------------*/
177/*---------------------------------------------------------------------------*/
178
179#endif
Error in the dataset.
virtual IXmlDocumentHolder * documentHolder()=0
Returns the XML document of the dataset. This pointer remains the property of this class and is destr...
virtual String defaultCategory() const =0
Category used for default values.
virtual CaseNodeNames * caseNodeNames()=0
Returns the instance containing the names of XML nodes by language.
virtual XmlNode rootElement()=0
Returns the root element.
virtual XmlNode documentNode()=0
Returns the document node.
virtual String language() const =0
Language used in the dataset.
virtual void printWarnings(std::ostream &o)=0
Writes the warnings to the stream o.
virtual void addError(const CaseOptionError &case_error)=0
Adds an error to the dataset.
virtual void clearErrorsAndWarnings()=0
Clears the recorded error and warning messages.
virtual void addWarning(const CaseOptionError &case_error)=0
Adds a warning to the dataset.
virtual void printErrors(std::ostream &o)=0
Writes the errors to the stream o.
virtual XmlNode configurationElement()=0
Returns the configuration information element.
virtual ICaseDocument * clone()=0
Clones the document.
virtual XmlNode timeloopElement()=0
Returns the element containing the time loop choice.
virtual XmlNode meshesElement()=0
Element containing the list of meshes (new mechanism) (can be null).
virtual String codeUnitSystem() const =0
Name of the document's unit system.
virtual void setCodeVersion(const String &value)=0
Sets the version number of the code.
virtual XmlNode functionsElement()=0
Returns the root element of the functions.
virtual XmlNode titleElement()=0
Returns the element containing the case title.
virtual String codeName() const =0
Name of the case code.
virtual String codeVersion() const =0
Version number of the code corresponding to the case.
virtual XmlNode servicesElement()=0
Returns the element containing the service descriptions.
virtual const XmlNodeList & meshElements()=0
Returns the root element of the mesh information.
virtual void setUserClass(const String &value)=0
Sets the name of the case usage class.
virtual void setCodeName(const String &value)=0
Sets the name of the case code.
virtual String userClass() const =0
Name of the case usage class.
virtual XmlNode descriptionElement()=0
Returns the element containing the case description.
virtual void setDefaultCategory(const String &v)=0
Sets the category used for default values.
virtual XmlNode arcaneElement()=0
Returns the information element for Arcane.
virtual void setCodeUnitSystem(const String &value)=0
Sets the name of the document's unit system.
virtual ICaseDocumentFragment * fragment()=0
Fragment corresponding to this document.
virtual void build()=0
Constructs the instance.
virtual XmlNode modulesElement()=0
Returns the element containing the module descriptions.
virtual CaseNodeNames * caseNodeNames()=0
Returns the instance containing the names of XML nodes by language.
Manager of a DOM document.
List of nodes of a DOM tree.
Definition XmlNodeList.h:36
Node of a DOM tree.
Definition XmlNode.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --