dca_interface
6.3.4
|
#include <base_options.h>
Generic option class, used to set up optional options for several classes, modules etc.
Options are treated as key-value pairs. Each key has an associated value. Each value has also a type that can be examined or changed.
Usually classes and functions uses explicit structures and not the Options class. The Options class may be used however to facilitate future enhancements.
Definition at line 79 of file base_options.h.
Public Member Functions | |
bool | find (const std::string &key, OptionValue &value) const |
Perform a lookup for a given key, and return its value and whether or not it was found. More... | |
void | erase (const std::string &key) |
Erases an option from the current Options instance if present. This function does nothing if the option is not present. More... | |
void | set (const std::string &key, const OptionValue &value) |
Add or updates an option in the current Options. More... | |
Static Public Member Functions | |
static Options | create (const DcaInstance &aDcaInstance) |
Creates an empty option object. More... | |
|
static |
Creates an empty option object.
[in] | aDcaInstance | A previously initialized DcaInstance object |
ExDca | - One of the following error codes (available by using ExDca::getReturnCode() in your catch-handler) |
bool dca::Options::find | ( | const std::string & | key, |
OptionValue & | value | ||
) | const |
Perform a lookup for a given key, and return its value and whether or not it was found.
[in] | key | The key to search for |
[out] | value | If the key was found in the current Options instance this is the associated value |
void dca::Options::erase | ( | const std::string & | key | ) |
Erases an option from the current Options instance if present. This function does nothing if the option is not present.
[in] | key | The key to search for |
void dca::Options::set | ( | const std::string & | key, |
const OptionValue & | value | ||
) |
Add or updates an option in the current Options.
If the current Options does not contain the given key it will be inserted. If the key is present the value will simply be updated.
[in] | key | The key to which the value should be associated |
[in] | value | The value of the key |