libcrn
3.9.5
A document image processing library
|
A element of configuration. More...
#include <CRNConfigElement.h>
Public Member Functions | |
ConfigElement () | |
Default constructor for serialization. More... | |
ConfigElement (const String &nam, int val, const String &desc=U"") | |
Creates a configuration element for an int value. More... | |
ConfigElement (const String &nam, double val, const String &desc=U"") | |
Creates a configuration element for a double value. More... | |
ConfigElement (const String &nam, bool val, const String &desc=U"") | |
Creates a configuration element for a boolean value. More... | |
ConfigElement (const String &nam, const Prop3 &val, const String &desc=U"") | |
Creates a configuration element for a Prop3 value. More... | |
ConfigElement (const String &nam, const String &val, const String &desc=U"") | |
Creates a configuration element for a String. More... | |
ConfigElement (const String &nam, const StringUTF8 &val, const String &desc=U"") | |
Creates a configuration element for a StringUTF8. More... | |
ConfigElement (const String &nam, const Path &val, const String &desc=U"") | |
Creates a configuration element for a Path. More... | |
ConfigElement (const ConfigElement &)=delete | |
ConfigElement (ConfigElement &&)=default | |
ConfigElement & | operator= (const ConfigElement &)=delete |
ConfigElement & | operator= (ConfigElement &&)=default |
~ConfigElement ()=default | |
String | GetType () const |
Gets the inner type of data in the element. More... | |
const String & | GetName () const noexcept |
Gets the translated name of the element. More... | |
const String & | GetDescription () const noexcept |
Gets the description of the element. More... | |
const SObject & | GetValue () noexcept |
Gets the inner representation of the element's value. More... | |
SCObject | GetValue () const |
Gets the inner representation of the element's value. More... | |
template<typename T > | |
T | GetValue () const |
Gets the element's value. More... | |
template<typename T > | |
void | SetValue (T val) |
Sets the element's value. More... | |
bool | HasMinValue () const noexcept |
Tells if the element has min value. More... | |
const SObject & | GetMinValue () noexcept |
Gets the inner representation of the element's min value. More... | |
SCObject | GetMinValue () const |
Gets the inner representation of the element's min value. More... | |
template<typename T > | |
T | GetMinValue () const |
Gets the element's minimal value. More... | |
template<typename T > | |
void | SetMinValue (T val) |
Sets the element's min value. More... | |
bool | HasMaxValue () const noexcept |
Tells if the element has max value. More... | |
const SObject & | GetMaxValue () noexcept |
Gets the inner representation of the element's max value. More... | |
SCObject | GetMaxValue () const |
Gets the inner representation of the element's max value. More... | |
template<typename T > | |
T | GetMaxValue () const |
Gets the element's minimal value. More... | |
template<typename T > | |
void | SetMaxValue (T val) |
Sets the element's max value. More... | |
const crn::Vector & | GetAllowedValues () const |
Returns the list of allowed values. More... | |
template<typename T > | |
const std::vector< T > | GetAllowedValues () const |
Returns the list of allowed values. More... | |
template<typename Iter > | |
void | SetAllowedValues (Iter b, Iter e) |
Sets the list of allowed values. More... | |
template<typename T > | |
void | AddAllowedValue (T val) |
Adds a value to the list of allowed values. More... | |
A element of configuration.
Helper class to store configuration values with their description
Definition at line 39 of file CRNConfigElement.h.
ConfigElement::ConfigElement | ( | ) |
Default constructor for serialization.
Default constructor for serialization.
Definition at line 30 of file CRNConfigElement.cpp.
Creates a configuration element for an int value.
Creates a configuration element for an int value
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 41 of file CRNConfigElement.cpp.
Creates a configuration element for a double value.
Creates a configuration element for a double value
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 54 of file CRNConfigElement.cpp.
Creates a configuration element for a boolean value.
Creates a configuration element for a boolean value
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 67 of file CRNConfigElement.cpp.
Creates a configuration element for a Prop3 value.
Creates a configuration element for a Prop3 value
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 80 of file CRNConfigElement.cpp.
Creates a configuration element for a String.
Creates a configuration element for a String
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 93 of file CRNConfigElement.cpp.
ConfigElement::ConfigElement | ( | const String & | nam, |
const StringUTF8 & | val, | ||
const String & | desc = U"" |
||
) |
Creates a configuration element for a StringUTF8.
Creates a configuration element for a StringUTF8
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 106 of file CRNConfigElement.cpp.
Creates a configuration element for a Path.
Creates a configuration element for a Path
[in] | nam | the translated name of the element |
[in] | val | the initial value |
[in] | desc | the description of the element |
Definition at line 119 of file CRNConfigElement.cpp.
|
delete |
|
default |
|
default |
|
inline |
Adds a value to the list of allowed values.
[in] | val | the value to add |
Definition at line 173 of file CRNConfigElement.h.
|
inline |
Returns the list of allowed values.
Definition at line 146 of file CRNConfigElement.h.
|
inline |
Returns the list of allowed values.
ExceptionInvalidArgument | impossible to convert |
Definition at line 151 of file CRNConfigElement.h.
|
inlinenoexcept |
Gets the description of the element.
Definition at line 69 of file CRNConfigElement.h.
|
inlinenoexcept |
Gets the inner representation of the element's max value.
Definition at line 120 of file CRNConfigElement.h.
|
inline |
Gets the inner representation of the element's max value.
Definition at line 122 of file CRNConfigElement.h.
|
inline |
Gets the element's minimal value.
ExceptionUninitialized | no max value |
ExceptionInvalidArgument | impossible to convert |
Definition at line 127 of file CRNConfigElement.h.
|
inlinenoexcept |
Gets the inner representation of the element's min value.
Definition at line 93 of file CRNConfigElement.h.
|
inline |
Gets the inner representation of the element's min value.
Definition at line 95 of file CRNConfigElement.h.
|
inline |
Gets the element's minimal value.
ExceptionUninitialized | no min value |
ExceptionInvalidArgument | impossible to convert |
Definition at line 100 of file CRNConfigElement.h.
|
inlinenoexcept |
Gets the translated name of the element.
Definition at line 67 of file CRNConfigElement.h.
String ConfigElement::GetType | ( | ) | const |
Gets the inner type of data in the element.
Gets the inner type of data in the element
ExceptionUninitialized | the element was not initialized |
ExceptionInvalidArgument | the element is of unknown type |
Definition at line 132 of file CRNConfigElement.cpp.
|
inlinenoexcept |
Gets the inner representation of the element's value.
Definition at line 71 of file CRNConfigElement.h.
|
inline |
Gets the inner representation of the element's value.
Definition at line 73 of file CRNConfigElement.h.
|
inline |
Gets the element's value.
ExceptionInvalidArgument | impossible to convert |
Definition at line 78 of file CRNConfigElement.h.
|
inlinenoexcept |
Tells if the element has max value.
Definition at line 118 of file CRNConfigElement.h.
|
inlinenoexcept |
Tells if the element has min value.
Definition at line 91 of file CRNConfigElement.h.
|
delete |
|
default |
|
inline |
Sets the list of allowed values.
[in] | b | the beginning iterator |
[in] | e | the end iterator |
Definition at line 164 of file CRNConfigElement.h.
|
inline |
Sets the element's max value.
ExceptionUninitialized | the element was not initialized |
[in] | val | the value to assign |
Definition at line 137 of file CRNConfigElement.h.
|
inline |
Sets the element's min value.
ExceptionUninitialized | the element was not initialized |
[in] | val | the value to assign |
Definition at line 110 of file CRNConfigElement.h.
|
inline |
Sets the element's value.
ExceptionUninitialized | the element was not initialized |
[in] | val | the value to assign |
Definition at line 86 of file CRNConfigElement.h.