ONE - On-device Neural Engine
|
this class describes command line option More...
#include <CommandLine.h>
Public Types | |
using | option_checker_t = void(*)(const Option< T > &) |
function type for option verification | |
Public Types inherited from nnc::cli::IOption | |
enum class | Group { none = 0 , caffe2 = 1 , onnx = 2 } |
Public Member Functions | |
Option (const std::vector< std::string > &optnames, const std::string &descr, const T &default_val=T(), bool is_optional=false, const std::vector< std::string > &vals=std::vector< std::string >(), option_checker_t checker=nullptr, const std::vector< char > &seps=std::vector< char >(), bool enabled=true, IOption::Group group=IOption::Group::none) | |
construct an option | |
Option (const Option &)=delete | |
Option & | operator= (const Option &)=delete |
template<typename Tval > | |
T & | operator= (const Tval &val) |
overload assignment operator for type | |
void | setValue (const std::string &val) override |
set option value | |
const std::vector< std::string > & | getNames () const override |
get all names of option | |
const std::string & | getOverview () const override |
get description of option | |
bool | isOptional () const override |
may option be optional? | |
const std::vector< std::string > & | getValidVals () const override |
get valid values for given option | |
void | runCheckerFunc () override |
function for option verification | |
const std::vector< char > & | getSeparators () const override |
get separators for option | |
bool | isDisabled () const override |
is option disabled? | |
bool | canHaveSeveralVals () const override |
can option have several values? | |
bool | isGrouped () const override |
IOption::Group | getGroup () const override |
std::string | getGroupName () const override |
name of option group | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
void | setValue (const std::string &val) |
set option value | |
Public Member Functions inherited from nnc::cli::OptionType< T, std::is_class< T >::value > | |
OptionType ()=default | |
Additional Inherited Members | |
Static Protected Attributes inherited from nnc::cli::IOption | |
static constexpr const char *const | _groupNames [] = {nullptr, "caffe2", "onnx"} |
this class describes command line option
T | - type of option |
Definition at line 214 of file CommandLine.h.
using nnc::cli::Option< T >::option_checker_t = void (*)(const Option<T> &) |
function type for option verification
Definition at line 220 of file CommandLine.h.
|
explicit |
construct an option
T | - type of an option |
optnames | - names of option |
descr | - overview of option |
default_val | - option value accepted by default |
is_optional | - is option optional? |
vals | - valid values for option. Other values are interpreted as invalid |
checker | - function verifies option |
seps | - symbols that separates name option from value (by default is spaces) |
enabled | - if this option is set to false then it won't be shown for users |
group | - all options can be splitted into groups so this param sets group for option |
Definition at line 495 of file CommandLine.h.
References nnc::cli::CommandLine::getParser(), nnc::cli::IOption::none, and nnc::cli::CommandLine::registerOption().
|
delete |
|
inlineoverridevirtual |
can option have several values?
Implements nnc::cli::IOption.
Definition at line 279 of file CommandLine.h.
|
inlineoverridevirtual |
Implements nnc::cli::IOption.
Definition at line 283 of file CommandLine.h.
|
inlineoverridevirtual |
name of option group
Implements nnc::cli::IOption.
Definition at line 285 of file CommandLine.h.
References nnc::cli::IOption::_groupNames.
|
inlineoverridevirtual |
get all names of option
Implements nnc::cli::IOption.
Definition at line 259 of file CommandLine.h.
|
inlineoverridevirtual |
get description of option
Implements nnc::cli::IOption.
Definition at line 261 of file CommandLine.h.
|
inlineoverridevirtual |
get separators for option
Implements nnc::cli::IOption.
Definition at line 275 of file CommandLine.h.
|
inlineoverridevirtual |
get valid values for given option
Implements nnc::cli::IOption.
Definition at line 265 of file CommandLine.h.
|
inlineoverridevirtual |
is option disabled?
Implements nnc::cli::IOption.
Definition at line 277 of file CommandLine.h.
|
inlineoverridevirtual |
Implements nnc::cli::IOption.
Definition at line 281 of file CommandLine.h.
References nnc::cli::IOption::none.
|
inlineoverridevirtual |
may option be optional?
Implements nnc::cli::IOption.
Definition at line 263 of file CommandLine.h.
|
delete |
|
inline |
overload assignment operator for type
Definition at line 250 of file CommandLine.h.
|
inlineoverridevirtual |
function for option verification
this | function throws exception of BadOption type if verification is not passed |
Implements nnc::cli::IOption.
Definition at line 267 of file CommandLine.h.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 561 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 568 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 575 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 582 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 588 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 595 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 602 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 609 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 616 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 623 of file CommandLine.cpp.
|
virtual |
set option value
val | - value of option in string format |
Implements nnc::cli::IOption.
Definition at line 630 of file CommandLine.cpp.
|
overridevirtual |