|
TUV-x
|
Model configuration data. More...
Public Member Functions | |
| procedure | empty (this) |
| Empties the configuration. | |
| procedure | from_file (this, file_name) |
| Loads a configuration with data from a file. | |
| procedure | to_file (this, file_name) |
| Writes a configuration to a file. | |
| procedure | number_of_children (this) |
| Returns the number of child objects. | |
| procedure | get_iterator (this) |
| Gets an iterator for the configuration data. | |
| procedure | key (this, iterator) |
| Gets the key name for a key-value pair. | |
| procedure | merge_in (this, other, caller) |
| Merges another config_t object into the config_t object. | |
| procedure | validate (this, required_keys, optional_keys) |
| Validates the format of the configuration file. | |
| procedure | print (this) |
| Print the raw contents of the configuration. | |
| procedure | pack_size (this, comm) |
| Returns the number of bytes required to pack the object onto a buffer. | |
| procedure | mpi_pack (this, buffer, position, comm) |
| Packs the object onto a character buffer. | |
| procedure | mpi_unpack (this, buffer, position, comm) |
| Unpacks an object from a character buffer. | |
| final | finalize (this) |
| Cleans up memory. | |
| finalize_1d_array (this) | |
| Cleans up memory. | |
Private Member Functions | |
| procedure, private | find_by_prefix (this, prefix, full_key, found) |
| Find a JSON key by prefix. | |
Private Attributes | |
| type(c_ptr) | node_ = c_null_ptr |
| Pointer to YAML node. | |
Gets some configuration data | |
Each function includes optional If a If the | |
| generic | get (this, key, value, caller, default, found) |
| Gets a subset of the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets a string from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets a string from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets an integer from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets a single-precision real number from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets a double-precision real number from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets a boolean value from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets an array of strings from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets an array of doubles from the configuration data. | |
| generic | get (this, key, value, caller, default, found) |
| Gets an array of config_t objects. | |
| generic | get (this, iterator, value, caller) |
| Gets a value using an iterator. | |
| generic | get (this, iterator, value, caller) |
| Gets an array value using an iterator. | |
| procedure, private | get_config (this, key, value, caller, default, found) |
| Gets a subset of the configuration data. | |
| procedure, private | get_string_string_default (this, key, value, caller, default, found) |
| Gets a string from the configuration data. | |
| procedure, private | get_string (this, key, value, caller, default, found) |
| Gets a string from the configuration data. | |
| procedure, private | get_int (this, key, value, caller, default, found) |
| Gets an integer from the configuration data. | |
| procedure, private | get_float (this, key, value, caller, default, found) |
| Gets a single-precision real number from the configuration data. | |
| procedure, private | get_double (this, key, value, caller, default, found) |
| Gets a double-precision real number from the configuration data. | |
| procedure, private | get_logical (this, key, value, caller, default, found) |
| Gets a boolean value from the configuration data. | |
| procedure, private | get_string_array (this, key, value, caller, default, found) |
| Gets an array of strings from the configuration data. | |
| procedure, private | get_double_array (this, key, value, caller, default, found) |
| Gets an array of doubles from the configuration data. | |
| procedure, private | get_config_array (this, key, value, caller, default, found) |
| Gets an array of config_t objects. | |
| procedure, private | get_from_iterator (this, iterator, value, caller) |
| Gets a value using an iterator. | |
| procedure, private | get_array_from_iterator (this, iterator, value, caller) |
| Gets an array value using an iterator. | |
Adds a named piece of configuration data | |
| generic | add (this, key, value, caller) |
| Adds a subset of configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a string to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a string to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds an integer to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a single-precision real number to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a double-precision real number to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a boolean to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a string array to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a double array to the configuration data. | |
| generic | add (this, key, value, caller) |
| Adds a config_t array to the configuration data. | |
| procedure, private | add_config (this, key, value, caller) |
| Adds a subset of configuration data. | |
| procedure, private | add_char_array (this, key, value, caller) |
| Adds a string to the configuration data. | |
| procedure, private | add_string (this, key, value, caller) |
| Adds a string to the configuration data. | |
| procedure, private | add_int (this, key, value, caller) |
| Adds an integer to the configuration data. | |
| procedure, private | add_float (this, key, value, caller) |
| Adds a single-precision real number to the configuration data. | |
| procedure, private | add_double (this, key, value, caller) |
| Adds a double-precision real number to the configuration data. | |
| procedure, private | add_logical (this, key, value, caller) |
| Adds a boolean to the configuration data. | |
| procedure, private | add_string_array (this, key, value, caller) |
| Adds a string array to the configuration data. | |
| procedure, private | add_double_array (this, key, value, caller) |
| Adds a double array to the configuration data. | |
| procedure, private | add_config_array (this, key, value, caller) |
| Adds a config_t array to the configuration data. | |
Assignment | |
| generic | assignment (a, b) |
| Assigns a config_t from a config_t. | |
| generic | assignment (config, string) |
| Assigns a config_t from a string. | |
| generic | assignment (config, string) |
| Assigns a config_t from a character array. | |
| generic | assignment (string, config) |
| Assigns a string from a configuration. | |
| procedure, private | config_assign_config (a, b) |
| Assigns a config_t from a config_t. | |
| procedure, private | config_assign_string (config, string) |
| Assigns a config_t from a string. | |
| procedure, private | config_assign_char (config, string) |
| Assigns a config_t from a character array. | |
| procedure, pass(config), private | string_assign_config (string, config) |
| Assigns a string from a configuration. | |
Model configuration data.
Instances of type config_t can be used to access model configuration data in json format. If there is a need to use model configuration in another format (e.g., XML) in the future, an abstract config_t type could be set up, that this type and an XML-based type could extend. The rest of the model code would be unaffected.
It is assumed that most configuration datasets will be small enough that returned subsets of configuration data can just be a copy of the original data (instead of using a pointer to the start of the subset in the original dataset, or something like this). This avoids ownership problems with cleaning up the memory after a config_t object goes out of scope.
Only use config_t objects during initialization. They are not designed for efficiency.
IMPORTANT: The order of elements is arbitrary. No user of a config_t object can assume anything by the order of key-value pairs in the data. This dataset:
... is the same as:
There is no guarantee that an iterator over the elements of a config_t object will return them in the same order they exist in the original file or string.
Example of a config_t object generated from a file:
data/config_example.json:
Output:
|
final |
Cleans up memory.
| [in,out] | this | Configuration |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| type(config_t), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a subset of configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| character(len=*), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a string to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| type(string_t), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a string to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| integer, intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds an integer to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| real(kind=musica_rk), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a single-precision real number to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| real(kind=musica_dk), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a double-precision real number to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| logical, intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a boolean to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| type(string_t), dimension(:), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a string array to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| real(kind=musica_dk), dimension(:), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a double array to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key to insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::add | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| type(config_t), dimension(:), intent(in) | value, | ||
| character(len=*), intent(in) | caller ) |
Adds a config_t array to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a string to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a subset of configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a config_t array to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a double-precision real number to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a double array to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key to insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a single-precision real number to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds an integer to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a boolean to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a string to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Adds a string array to the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key in insert |
| [in] | value | Value to set |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::assignment | ( | class(config_t), intent(out) | config, |
| class(string_t), intent(in) | string ) |
Assigns a config_t from a string.
| [out] | config | Configuration to assign to |
| [in] | string | String to assign from |
| generic musica_config::config_t::assignment | ( | class(config_t), intent(out) | config, |
| character(len=*), intent(in) | string ) |
Assigns a config_t from a character array.
| [out] | config | Configuration to assign to |
| [in] | string | String to assign from |
| generic musica_config::config_t::assignment | ( | type(string_t), intent(out) | string, |
| class(config_t), intent(in) | config ) |
Assigns a string from a configuration.
| [out] | string | String to assign to |
| [in] | config | Configuration to assign from |
|
private |
Assigns a config_t from a character array.
| [out] | config | Configuration to assign to |
| [in] | string | String to assign from |
|
private |
Assigns a config_t from a string.
| [out] | config | Configuration to assign to |
| [in] | string | String to assign from |
| procedure musica_config::config_t::empty | ( | class(config_t), intent(out) | this | ) |
Empties the configuration.
| [out] | this | Configuration |
| musica_config::config_t::finalize_1d_array | ( | type(config_t), dimension(:), intent(inout) | this | ) |
Cleans up memory.
| [in,out] | this | Configuration |
|
private |
Find a JSON key by prefix.
Returns the first instance of the prefix if found
| [in,out] | this | Configuration |
| [in] | prefix | Prefix to search for (first instance is returned) |
| [out] | full_key | Full key found |
| [out] | found | Flag indicating whether the key was found |
| procedure musica_config::config_t::from_file | ( | class(config_t), intent(out) | this, |
| character(len=*), intent(in) | file_name ) |
Loads a configuration with data from a file.
| [out] | this | New configuration |
| [in] | file_name | File name containing configuration data |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| class(iterator_t), intent(in) | iterator, | ||
| class(*), intent(out) | value, | ||
| character(len=*), intent(in) | caller ) |
Gets a value using an iterator.
| [in,out] | this | Configuration |
| [in] | iterator | Iterator to use to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| class(iterator_t), intent(in) | iterator, | ||
| type(string_t), dimension(:), intent(out), allocatable | value, | ||
| character(len=*), intent(in) | caller ) |
Gets an array value using an iterator.
| [in,out] | this | Configuration |
| [in] | iterator | Iterator to use to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| class(config_t), intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| class(config_t), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets a subset of the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| class(string_t), intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| character(len=*), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets a string from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| class(string_t), intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| class(string_t), intent(in) | default, | ||
| logical, intent(out), optional | found ) |
Gets a string from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| integer(kind=musica_ik), intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| integer(kind=musica_ik), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets an integer from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| real(kind=musica_rk), intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| real(kind=musica_rk), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets a single-precision real number from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| real(kind=musica_dk), intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| real(kind=musica_dk), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets a double-precision real number from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| logical, intent(out) | value, | ||
| character(len=*), intent(in) | caller, | ||
| logical, intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets a boolean value from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| type(string_t), dimension(:), intent(out), allocatable | value, | ||
| character(len=*), intent(in) | caller, | ||
| type(string_t), dimension(:), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets an array of strings from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| real(musica_dk), dimension(:), intent(out), allocatable | value, | ||
| character(len=*), intent(in) | caller, | ||
| real(musica_dk), dimension(:), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets an array of doubles from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| generic musica_config::config_t::get | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | key, | ||
| type(config_t), dimension(:), intent(out), allocatable | value, | ||
| character(len=*), intent(in) | caller, | ||
| type(config_t), dimension(:), intent(in), optional | default, | ||
| logical, intent(out), optional | found ) |
Gets an array of config_t objects.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets an array value using an iterator.
| [in,out] | this | Configuration |
| [in] | iterator | Iterator to use to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Gets a subset of the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets an array of config_t objects.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets a double-precision real number from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets an array of doubles from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets a single-precision real number from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets a value using an iterator.
| [in,out] | this | Configuration |
| [in] | iterator | Iterator to use to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
|
private |
Gets an integer from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| procedure musica_config::config_t::get_iterator | ( | class(config_t), intent(in), target | this | ) |
Gets an iterator for the configuration data.
| [in] | this | Configuration |
|
private |
Gets a boolean value from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets a string from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets an array of strings from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
|
private |
Gets a string from the configuration data.
| [in,out] | this | Configuration |
| [in] | key | Key used to find value |
| [out] | value | Returned value |
| [in] | caller | Name of the calling function (only for use in error messages) |
| [in] | default | Default value if not found |
| [out] | found | Flag indicating whether key was found |
| procedure musica_config::config_t::key | ( | class(config_t), intent(inout) | this, |
| class(iterator_t), intent(in) | iterator ) |
Gets the key name for a key-value pair.
| [in,out] | this | Configuration |
| [in] | iterator | Configuration iterator |
| procedure musica_config::config_t::mpi_pack | ( | class(config_t), intent(inout) | this, |
| character, dimension(:), intent(inout) | buffer, | ||
| integer, intent(inout) | position, | ||
| integer, intent(in), optional | comm ) |
Packs the object onto a character buffer.
| [in,out] | this | Configuration to pack |
| [in,out] | buffer | Memory buffer |
| [in,out] | position | Current buffer position |
| [in] | comm | MPI communicator |
| procedure musica_config::config_t::mpi_unpack | ( | class(config_t), intent(out) | this, |
| character, dimension(:), intent(inout) | buffer, | ||
| integer, intent(inout) | position, | ||
| integer, intent(in), optional | comm ) |
Unpacks an object from a character buffer.
| [out] | this | Configuration to unpack |
| [in,out] | buffer | Memory buffer |
| [in,out] | position | Current buffer position |
| [in] | comm | MPI communicator |
| procedure musica_config::config_t::number_of_children | ( | class(config_t), intent(inout) | this | ) |
Returns the number of child objects.
| [in,out] | this | Configuration |
| procedure musica_config::config_t::print | ( | class(config_t), intent(inout) | this | ) |
Print the raw contents of the configuration.
| [in,out] | this | Configuration |
|
private |
Assigns a string from a configuration.
| [out] | string | String to assign to |
| [in] | config | Configuration to assign from |
| procedure musica_config::config_t::to_file | ( | class(config_t), intent(inout) | this, |
| character(len=*), intent(in) | file_name ) |
Writes a configuration to a file.
| [in,out] | this | Configuration |
| [in] | file_name | File name to save configuration with |
| procedure musica_config::config_t::validate | ( | class(config_t), intent(inout) | this, |
| type(string_t), dimension(:), intent(in) | required_keys, | ||
| type(string_t), dimension(:), intent(in) | optional_keys ) |
Validates the format of the configuration file.
Ensures that the required keys are present, and that user-defined keys start with a "`__`" prefix.
| [in,out] | this | Configuration |
| [in] | required_keys | Required keys |
| [in] | optional_keys | Optional keys |