|
Flow123d
|
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) | |
| 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 |
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 40 of file type_record.cc.
|
private |
Forbids default constructor.
Definition at line 36 of file type_record.cc.

|
private |
Constructor for other types then 'declaration'.
Definition at line 48 of file type_record.cc.
|
inline |
Returns true if the default value is or will be available when someone tries to read the value.
Definition at line 112 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 106 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 119 of file type_record.hh.

|
inline |
Returns true if the key is optional.
Definition at line 125 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 87 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 100 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 75 of file type_record.hh.

|
inline |
Returns stored value. Possibly empty string.
Definition at line 131 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 136 of file type_record.hh.
|
private |
Stored value.
Definition at line 135 of file type_record.hh.
1.8.4