Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IProperty.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/* IProperty.h (C) 2000-2025 */
9/* */
10/* Property interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IPROPERTY_H
13#define ARCANE_CORE_IPROPERTY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28class IPropertyValue;
29class IPropertyType;
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
40{
41 public:
42
43 virtual ~Property() = default;
44
45 public:
46
55
57 {
58 StString,
59 StReal,
60 StInteger,
61 StBool
62 };
63};
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
73: public Property
74{
75 public:
76
78 virtual void valueToString(String& str) const = 0;
80 virtual void nameToString(String& str) const = 0;
82 virtual void setValueFromString(const String& str) = 0;
84 virtual bool isDefaultValue() const = 0;
86 virtual bool isOriginalValue() const = 0;
88 virtual void originalValueToString(String& str) const = 0;
90 virtual bool canBeEdited() const = 0;
92 virtual IPropertyType* type() = 0;
95};
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
105: public Property
106{
107 public:
108
110 virtual void typeNameToString(String& str) const = 0;
111
113 virtual ePropertyKind kind() const = 0;
114
120 virtual Integer nbEnumeratedValue() const = 0;
121
127 virtual String enumeratedValue(Integer i) const = 0;
128
134 virtual eSimpleType simpleType() const = 0;
135};
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
145: public Property
146{
147 public:
148
150 virtual void nameToString(String& str) const = 0;
152 virtual IPropertyType* type() = 0;
153};
154
155/*---------------------------------------------------------------------------*/
156/*---------------------------------------------------------------------------*/
157
158} // namespace Arcane
159
160/*---------------------------------------------------------------------------*/
161/*---------------------------------------------------------------------------*/
162
163#endif
Arcane configuration file.
Interface of a property type instance.
Definition IProperty.h:146
virtual IPropertyType * type()=0
Returns the type of the instance.
virtual void nameToString(String &str) const =0
Stores the instance name in str.
Interface of a property type.
Definition IProperty.h:106
virtual ePropertyKind kind() const =0
Returns the kind of the property type.
virtual eSimpleType simpleType() const =0
Returns the simple type of the property storage. This method is only valid for PkSimple kind types....
virtual Integer nbEnumeratedValue() const =0
Returns the number of possible enumerated values for the type. This method is only useful for PkEnum ...
virtual void typeNameToString(String &str) const =0
Returns the name of the type in str.
virtual String enumeratedValue(Integer i) const =0
Returns the i-th enumerated value of the type. This method is only useful for PkEnum kind types....
Interface of a property value.
Definition IProperty.h:74
virtual void originalValueToString(String &str) const =0
Stores the original property value in str.
virtual bool isOriginalValue() const =0
Returns whether the current value is the original value.
virtual void nameToString(String &str) const =0
Stores the property name in str.
virtual IPropertyType * type()=0
Returns the type of this property.
virtual void valueToString(String &str) const =0
Stores the property value in str.
virtual bool canBeEdited() const =0
Returns whether the value can be edited.
virtual IPropertyTypeInstance * typeInstance()=0
Returns the instance associated with this value.
virtual void setValueFromString(const String &str)=0
Positions the new property value at str.
virtual bool isDefaultValue() const =0
Returns whether the current value is the default value.
Definition of types for properties.
Definition IProperty.h:40
eSimpleType
Simple type in the case of a PkSimple kind.
Definition IProperty.h:57
ePropertyKind
Kind of a property.
Definition IProperty.h:49
@ PkSimple
Simple kind (Real, integer, string, ...).
Definition IProperty.h:50
@ PkComplex
Complex kind containing sub-types.
Definition IProperty.h:53
@ PkEnum
Enumerated kind.
Definition IProperty.h:51
@ PkExtended
Extended kind.
Definition IProperty.h:52
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.