Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICaseOptionList.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/* ICaseOptionList.h (C) 2000-2025 */
9/* */
10/* Data set options. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICASEOPTIONLIST_H
13#define ARCANE_CORE_ICASEOPTIONLIST_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26class XmlNode;
27class ICaseMng;
28class XmlNodeList;
29class ICaseOptionListInternal;
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34/*!
35 * \internal
36 * \brief Interface for a data set options list.
37 */
38class ARCANE_CORE_EXPORT ICaseOptionList
39{
41
42 protected:
43
44 virtual ~ICaseOptionList() = default;
45
46 public:
47
48 /*!
49 * \brief Returns the element associated with this options list.
50 *
51 * If there are none, returns a null XmlNode. If there are multiple, returns the
52 * first one.
53 */
54 virtual XmlNode rootElement() const = 0;
55 //! Returns the parent element.
56 virtual XmlNode parentElement() const = 0;
57 //! Adds the list \a co to the list of children.
58 virtual void addChild(ICaseOptions* co) = 0;
59 //! Removes \a co from the list of children.
60 virtual void removeChild(ICaseOptions* co) = 0;
61 //! Returns the case manager
62 virtual ICaseMng* caseMng() const = 0;
63
64 //! Reads the option values from the DOM elements.
65 virtual void readChildren(bool is_phase1) = 0;
66 //! Displays the list of child options in language \a lang and their value
67 virtual void printChildren(const String& lang, int indent) = 0;
68 //! Returns the name of the element of this list
69 virtual String rootTagName() const = 0;
70 //! Adds all child options to the list \a col.
72 //! Indicates if the option is present in the data set.
73 virtual bool isPresent() const = 0;
74 //! Indicates if the option is optional
75 virtual bool isOptional() const = 0;
76 //! Minimum number of occurrences
77 virtual Integer minOccurs() const = 0;
78 //! Maximum number of occurrences
79 virtual Integer maxOccurs() const = 0;
80 //! Applies the visitor \a visitor
81 virtual void visit(ICaseDocumentVisitor* visitor) = 0;
82 //! Full name in XPath format corresponding to rootElement()
83 virtual String xpathFullName() const = 0;
84 //! Handle of the associated mesh
85 virtual MeshHandle meshHandle() const = 0;
86
87 //! Associated document.
89
90 /*!
91 * \brief Disables the option as if it were absent.
92 *
93 * This is used, for example, if the option is associated with a mesh
94 * that is not defined.
95 */
96 virtual void disable() = 0;
97
98 public:
99
100 //! Adds option \a o with parent \a parent
101 ARCANE_DEPRECATED_REASON("Y2023: This method is internal to Arcane")
102 virtual void addConfig(CaseOptionBase* o, XmlNode parent) = 0;
103
104 //! Positions the root element of the list, with \a parent_element as parent. If already positioned, does nothing
105 ARCANE_DEPRECATED_REASON("Y2023: This method is internal to Arcane")
106 virtual void setRootElementWithParent(XmlNode parent_element) = 0;
107
108 //! Positions the root element of the list. If already positioned, throws an exception
109 ARCANE_DEPRECATED_REASON("Y2023: This method is internal to Arcane")
110 virtual void setRootElement(XmlNode root_element) = 0;
111
112 //! Adds child elements that do not correspond to options in \a nlist
113 ARCANE_DEPRECATED_REASON("Y2023: This method is internal to Arcane")
114 virtual void addInvalidChildren(XmlNodeList& nlist) = 0;
115
116 public:
117
118 //! Internal Arcane API
119 virtual ICaseOptionListInternal* _internalApi() = 0;
120};
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125} // End namespace Arcane
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
130#endif
Declarations of Arcane's general types.
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 Integer minOccurs() const =0
Minimum number of occurrences.
virtual void visit(ICaseDocumentVisitor *visitor)=0
Applies the visitor visitor.
virtual XmlNode rootElement() const =0
Returns the element associated with this options list.
virtual String xpathFullName() const =0
Full name in XPath format corresponding to rootElement().
virtual void addInvalidChildren(XmlNodeList &nlist)=0
Adds child elements that do not correspond to options in nlist.
virtual void setRootElement(XmlNode root_element)=0
Positions the root element of the list. If already positioned, throws an exception.
virtual void setRootElementWithParent(XmlNode parent_element)=0
Positions the root element of the list, with parent_element as parent. If already positioned,...
virtual String rootTagName() const =0
Returns the name of the element of this list.
virtual ICaseDocumentFragment * caseDocumentFragment() const =0
Associated document.
virtual void disable()=0
Disables the option as if it were absent.
virtual bool isOptional() const =0
Indicates if the option is optional.
virtual void deepGetChildren(Array< CaseOptionBase * > &col)=0
Adds all child options to the list col.
virtual void readChildren(bool is_phase1)=0
Reads the option values from the DOM elements.
virtual void addChild(ICaseOptions *co)=0
Adds the list co to the list of children.
virtual XmlNode parentElement() const =0
Returns the parent element.
virtual Integer maxOccurs() const =0
Maximum number of occurrences.
virtual bool isPresent() const =0
Indicates if the option is present in the data set.
virtual void printChildren(const String &lang, int indent)=0
Displays the list of child options in language lang and their value.
virtual ICaseMng * caseMng() const =0
Returns the case manager.
virtual MeshHandle meshHandle() const =0
Handle of the associated mesh.
virtual ICaseOptionListInternal * _internalApi()=0
Internal Arcane API.
virtual void removeChild(ICaseOptions *co)=0
Removes co from the list of children.
virtual void addConfig(CaseOptionBase *o, XmlNode parent)=0
Adds option o with parent parent.
Handle on a mesh.
Definition MeshHandle.h:48
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 --
Int32 Integer
Type representing an integer.