14#include "arcane/utils/Property.h"
16#include "arcane/utils/Ref.h"
17#include "arcane/utils/JSONReader.h"
18#include "arcane/utils/List.h"
19#include "arcane/utils/FatalErrorException.h"
20#include "arcane/utils/ValueConvert.h"
21#include "arcane/utils/CheckedConvert.h"
28namespace Arcane::properties
35fromJSON(
const JSONValue& jv) -> InputType
47print(std::ostream& o,InputType v)
56fromJSON(
const JSONValue& jv) -> InputType
59 for(JSONValue jv2 : jv.valueAsArray())
60 string_list.add(jv2.value());
75 bool is_not_first =
false;
88fromJSON(
const JSONValue& jv) -> InputType
90 return jv.valueAsInt64()!=0;
96 if (v==
"0" || v==
"false")
98 if (v==
"1" || v==
"true")
101 "(valid values are '0', '1', 'true', 'false')",v);
105print(std::ostream& o,InputType v)
114fromJSON(
const JSONValue& jv) -> InputType
116 return jv.valueAsInt64();
122 Int64 read_value = 0;
123 bool is_bad = builtInGetValue(read_value,v);
125 ARCANE_FATAL(
"Can not convert '{0}' to type 'Int64' ",v);
130print(std::ostream& o,InputType v)
139fromJSON(
const JSONValue& jv) -> InputType
147 Int32 read_value = 0;
148 bool is_bad = builtInGetValue(read_value,v);
150 ARCANE_FATAL(
"Can not convert '{0}' to type 'Int32' ",v);
155print(std::ostream& o,InputType v)
169Integer global_arcane_nb_registerer = 0;
172PropertySettingsRegisterer::
173PropertySettingsRegisterer(CreateFunc func,CreateBuildInfoFunc,
const char* name) ARCANE_NOEXCEPT
183void PropertySettingsRegisterer::
186 if (global_arcane_first_registerer==
nullptr){
187 global_arcane_first_registerer =
this;
188 _setPreviousRegisterer(
nullptr);
189 _setNextRegisterer(
nullptr);
192 auto* next = global_arcane_first_registerer->nextRegisterer();
193 _setNextRegisterer(global_arcane_first_registerer);
194 global_arcane_first_registerer =
this;
196 next->_setPreviousRegisterer(
this);
198 ++global_arcane_nb_registerer;
201 auto* p = global_arcane_first_registerer;
202 Integer count = global_arcane_nb_registerer;
203 while (p && count > 0) {
204 p = p->nextRegisterer();
208 std::cerr <<
"Arcane Fatal Error: Registerer '" << m_name
209 <<
"' conflict in registerer registration\n";
212 else if (count > 0) {
213 cout <<
"Arcane Fatal Error: Registerer '" << m_name
214 <<
"' breaks registerer registration (inconsistent shortcut)\n";
226 return global_arcane_first_registerer;
235 return global_arcane_nb_registerer;
242createSettingsInfoRef()
const
247 s = (m_create_func)(sbi);
259visitAllRegisteredProperties(IPropertyVisitor* visitor)
263 Ref<IPropertySettingsInfo> si = rs->createSettingsInfoRef();
264 si->applyVisitor(visitor);
265 rs = rs->nextRegisterer();
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Référence à une instance.
Enregistreur de paramètres de propriétés.
static PropertySettingsRegisterer * firstRegisterer()
Accès au premier élément de la chaine d'enregistreur.
static Integer nbRegisterer()
Nombre d'enregisteur dans la chaîne.
Int32 toInt32(Int64 v)
Converti un Int64 en un Int32.
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
Collection< String > StringCollection
Collection de chaînes de caractères.
List< String > StringList
Tableau de chaînes de caractères unicode.
auto makeRef(InstanceType *t) -> Ref< InstanceType >
Créé une référence sur un pointeur.
std::int32_t Int32
Type entier signé sur 32 bits.