233 typedef typename SettingsTraits::InputType InputType;
234 typedef typename SettingsTraits::OutputType OutputType;
239 SetterArg(T& ax,InputType av) : x(ax), v(av){}
250 typedef std::function<void(
SetterArg a)> SetterType;
251 typedef std::function<OutputType(
GetterArg a)> GetterType;
254 : m_name(
name), m_getter(getter), m_setter(setter) {}
256 : m_name(
name), m_getter(nullptr), m_setter(nullptr) {}
258 IPropertySetting* setting() final
262 const IPropertySetting* setting() const final
272 return m_command_line_argument;
276 return m_description;
280 return SettingsTraits::typeName();
282 ThatClass& addSetter(
const SetterType& setter)
287 ThatClass& addGetter(
const GetterType& getter)
292 ThatClass& addCommandLineArgument(
const String& arg)
294 m_command_line_argument = arg;
297 ThatClass& addDescription(
const String& arg)
302 void setInstanceValue(T& instance,InputType value)
const
304 m_setter(SetterArg(instance,value));
306 void setFromJSON(
const JSONValue& v,T& instance)
const override
308 InputType x1 = SettingsTraits::fromJSON(v);
309 setInstanceValue(instance,x1);
311 void setFromString(
const String& v,T& instance)
const override
313 InputType x1 = SettingsTraits::fromString(v);
314 setInstanceValue(instance,x1);
316 void print(std::ostream& o,
const T& instance)
const override
318 o <<
"PROP: name=" << m_name <<
" V=";
320 SettingsTraits::print(o,m_getter(GetterArg(instance)));
325 friend PropertyVisitor<T>& operator<<(PropertyVisitor<T>& o,
const ThatClass& me)
334 String m_command_line_argument;
335 String m_description;
395 const char* name) ARCANE_NOEXCEPT;
403 static Integer nbRegisterer();
414 const char*
name()
const {
return m_name; }
416 Ref<IPropertySettingsInfo> createSettingsInfoRef()
const;
424 void _setNextRegisterer(PropertySettingsRegisterer* s) { m_next = s; }
429 PropertySettingsRegisterer* m_previous =
nullptr;
431 PropertySettingsRegisterer* m_next =
nullptr;
438 CreateFunc m_create_func;