|
Flow123d
jenkins-Flow123d-linux-release-multijob-282
|
Class Input::Type::Default specifies default value of keys of a Input::Type::Record.
More...
#include <type_record.hh>

Public Member Functions | |
| Default (const std::string &value) | |
| std::size_t | content_hash () const |
| bool | has_value_at_read_time () const |
| bool | has_value_at_declaration () const |
| bool | is_obligatory () const |
| bool | is_optional () const |
| const string & | value () const |
| bool | has_same_type (const Default &other) const |
Static Public Member Functions | |
| static Default | read_time (const std::string &description) |
| static Default | obligatory () |
| static Default | optional () |
Private Types | |
| enum | DefaultType { default_at_declaration, default_at_read_time, no_default_optional_type, no_default_obligatory_type } |
Private Member Functions | |
| Default () | |
| Default (enum DefaultType type, const std::string &value) | |
Private Attributes | |
| string | value_ |
| Stored value. More... | |
| enum DefaultType | type_ |
| Type of the Default. More... | |
Friends | |
| class | OutputBase |
| class | OutputJSONTemplate |
Class Input::Type::Default specifies default value of keys of a Input::Type::Record.
It contains type of default value and possibly the value itself stored as std::string. Currently we distinguish four cases:
Input::Type specification. This should be preferred way to give the default value since it can by documented as part of Record type specification.Definition at line 39 of file type_record.hh.
|
private |
Possible types of default values.
| Enumerator | |
|---|---|
| default_at_declaration |
Default value given at declaration time. |
| default_at_read_time |
Some default value will be given when the key is read. The description of this value should be provided. |
| no_default_optional_type |
No default value, optional key. This is default type of the Default. |
| no_default_obligatory_type |
No default value, obligatory key. |
Definition at line 47 of file type_record.hh.
| Input::Type::Default::Default | ( | const std::string & | value | ) |
Constructor with given default value (at declaration time)
Definition at line 41 of file type_record.cc.
|
private |
Forbids default constructor.
Definition at line 37 of file type_record.cc.

|
private |
Constructor for other types then 'declaration'.
Definition at line 49 of file type_record.cc.
| std::size_t Input::Type::Default::content_hash | ( | ) | const |
|
inline |
Compares values type_ of two Default objects.
Definition at line 139 of file type_record.hh.
|
inline |
Returns true if the default value is or will be available when someone tries to read the value.
Definition at line 114 of file type_record.hh.

|
inline |
Returns true if the default value is or will be available when someone tries to read the value.
Definition at line 108 of file type_record.hh.
|
inline |
Returns true if the key is obligatory and thus must be specified on input. No default value is given.
Definition at line 121 of file type_record.hh.

|
inline |
Returns true if the key is optional.
Definition at line 127 of file type_record.hh.

|
inlinestatic |
Factory function to make an empty default value which is obligatory. This and following factory functions should be used instead of private constructors.
Example of usage:
Definition at line 89 of file type_record.hh.

|
inlinestatic |
Factory function to make an empty default value which is optional. To get the value of such key from the input you have to use non-throwing variant of the method Input::Record::key, which returns the value through reference and allows checking presence of the key on the input.
Example of usage:
Definition at line 102 of file type_record.hh.

|
inlinestatic |
Factory function to make an default value that will be specified at the time when a key will be read. You have to provide a string with description of the default value used at the read time., e.g. the key time_governer of an equation can specify default value as
To get the value of such key from the input you have to use non-throwing variant of the method Input::Record::key, which returns the value through reference and allows checking presence of the key on the input.
Example of usage:
Definition at line 77 of file type_record.hh.

|
inline |
Returns stored value. Possibly empty string.
Definition at line 133 of file type_record.hh.

|
friend |
Definition at line 40 of file type_record.hh.
|
friend |
Definition at line 41 of file type_record.hh.
|
private |
Definition at line 144 of file type_record.hh.
|
private |
Stored value.
Definition at line 143 of file type_record.hh.
1.8.5