#include <eckit/option/SimpleOption.h>
template<class T>
SimpleOption class
Base classes
-
template<class T>class eckit::option::BaseOption<T>
Public types
- using base_t = BaseOption<T>
-
using args_t = Option::
args_t
Public static functions
-
template<typename T>static void copy(const std::
string & name, const Configuration& from, Configured& to)
Constructors, destructors, conversion operators
-
SimpleOption(const std::
string & name, const std::string & description) -
SimpleOption(const std::
string & name, const std::string & description, const T& default_value) - ~SimpleOption() defaulted override
Public functions
- auto set(Configured&, size_t values, args_t::const_iterator begin, args_t::const_iterator end) const -> size_t override
-
auto defaultValue(const std::
string & value) -> Option* - void setDefault(Configured& parametrisation) const final
-
auto name() const -> const std::
string & -
auto description() const -> const std::
string & - auto active() const -> bool virtual
- auto set(Configured& param, size_t values, args_t::const_iterator begin, args_t::const_iterator end) const -> size_t pure virtual
- void copy(const Configuration& from, Configured& to) const pure virtual
Private functions
-
void print(std::
ostream &) const override -
auto translate(const std::
string & value) const -> T override
Function documentation
#include <eckit/option/Option.h>
template<class T>
template<typename T>
static void SimpleOption<T>:: copy(const std::string & name,
const Configuration& from,
Configured& to)
#include <eckit/option/Option.h>
template<class T>
Option* SimpleOption<T>:: defaultValue(const std::string & value)
#include <eckit/option/Option.h>
template<class T>
void SimpleOption<T>:: setDefault(Configured& parametrisation) const final
#include <eckit/option/Option.h>
template<class T>
const std::string & SimpleOption<T>:: name() const
#include <eckit/option/Option.h>
template<class T>
const std::string & SimpleOption<T>:: description() const
#include <eckit/option/Option.h>
template<class T>
bool SimpleOption<T>:: active() const virtual
#include <eckit/option/Option.h>
template<class T>
size_t SimpleOption<T>:: set(Configured& param,
size_t values,
args_t::const_iterator begin,
args_t::const_iterator end) const pure virtual
Set the value of the option into parameter
, taking as many values as necessary from the range [begin, end)
.
values
indicates the number of items in[begin, end)
that were provided as an option value. This parameter is expected to be either 0 (for –flag options) or 1 (for traditional –option=
)
Return: number of items consumed from the range [begin, end)
.
#include <eckit/option/Option.h>
template<class T>
void SimpleOption<T>:: copy(const Configuration& from,
Configured& to) const pure virtual