206 virtual bool enabled() const override final;
216 virtual
bool isValid(const
Value& value) const override final;
221 virtual
bool set(const
Value& value) override final;
245 template <
typename TValue>
246 EntryControl& connect(
const std::string& name,
const std::string& key, TValue& value);
249 template <
typename TValue,
typename TEnum>
277 template <typename TEnum, typename = std::enable_if_t<std::is_enum<TEnum>::value>>
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
#define NAMESPACE_SPH_END
const NothingType NOTHING
Object representing a path on a filesystem, similar to std::filesystem::path in c++17.
Key-value associative container.
Array< IVirtualEntry::FileFormat > getInputFormats()
Convenience function, returning the list of input file formats defined by IoEnum.
Array< IVirtualEntry::FileFormat > getOutputFormats()
Convenience function, returning the list of output file formats defined by IoEnum.
Generic dynamically allocated resizable storage.
INLINE RawPtr< T > get() const
Helper object, allowing to add units, tooltips and additional properties into the entry created with ...
EntryControl & setEnabler(const Enabler &newEnabler)
Adds or replaces the enabler functor of the entry.
EntryControl & setPathType(const PathType &newType)
Sets the type of the path.
Array< FileFormat > fileFormats
virtual bool hasSideEffect() const override final
Returns true if the entry can modify multiple values simultaneously.
virtual Optional< PathType > getPathType() const override final
Returns the type of the path.
CallbackSet< Accessor > accessors
EntryControl & setValidator(const Validator &newValidator)
Adds or replaces the functor called to validate the new value.
Optional< PathType > pathType
EntryControl & setUnits(const Float newMult)
Sets units in which the entry is stored.
virtual Array< FileFormat > getFileFormats() const override final
Returns the allowed file format for this file entry.
EntryControl & setFileFormats(Array< FileFormat > &&formats)
Sets the allowed file formats.
EntryControl & setTooltip(const std::string &newTooltip)
Adds or replaces the previous tooltip associanted with the entry.
virtual bool enabled() const override final
Returns if this entry is currently enabled.
virtual bool isValid(const Value &value) const override final
Checks if the given value is a valid input for this entry.
virtual void setImpl(const Value &value)=0
EntryControl & addAccessor(const SharedToken &owner, const Accessor &accessor)
Adds a functor called when the entry changes, i.e. when set function is called.
virtual std::string getTooltip() const override final
Returns an optional description of the entry.
EntryControl & setSideEffect()
Specifies that the entry has a side effect, i.e. in changes values of other entries.
Represents a virtual entry in the settings.
virtual bool set(const Value &value)=0
Modifies the current value of the entry.
virtual Array< FileFormat > getFileFormats() const
Returns the allowed file format for this file entry.
virtual bool isValid(const Value &value) const =0
Checks if the given value is a valid input for this entry.
virtual std::string getTooltip() const
Returns an optional description of the entry.
virtual Optional< PathType > getPathType() const
Returns the type of the path.
virtual std::string getName() const =0
Returns a descriptive name of the entry.
virtual bool hasSideEffect() const
Returns true if the entry can modify multiple values simultaneously.
virtual Value get() const =0
Returns the currently stored value.
virtual Type getType() const =0
Returns the type of this entry.
virtual bool enabled() const =0
Returns if this entry is currently enabled.
Non-owning wrapper of pointer.
Generic object containing various settings and parameters of the run.
Variant, an implementation of type-safe union, similar to std::variant or boost::variant.
Interface allowing to enumerate all entries in the settings.
virtual void onEntry(const std::string &key, IVirtualEntry &entry) const =0
Called for every entry in the current category.
virtual void onCategory(const std::string &name) const =0
Called for every category in the settings.
Holds a map of virtual entries, associated with a unique name.
void set(const std::string &key, const IVirtualEntry::Value &value)
Modifies an existing entry in the settings.
Category & addCategory(const std::string &name)
Creates a new category of entries.
Generic storage and input/output routines of settings.
Overload of std::swap for Sph::Array.
Base class for all polymorphic objects.