ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnc::cli::IOption Class Referenceabstract

interface for Option class More...

#include <CommandLine.h>

Public Types

enum class  Group { none = 0 , caffe2 = 1 , onnx = 2 }
 

Public Member Functions

virtual void setValue (const std::string &val)=0
 set option value
 
virtual const std::vector< std::string > & getNames () const =0
 get all names of option
 
virtual const std::string & getOverview () const =0
 get description of option
 
virtual bool isOptional () const =0
 may option be optional?
 
virtual const std::vector< std::string > & getValidVals () const =0
 get valid values for given option
 
virtual const std::vector< char > & getSeparators () const =0
 get separators for option
 
virtual void runCheckerFunc ()=0
 function for option verification
 
virtual bool isDisabled () const =0
 is option disabled?
 
virtual bool canHaveSeveralVals () const =0
 can option have several values?
 
virtual bool isGrouped () const =0
 
virtual IOption::Group getGroup () const =0
 
virtual std::string getGroupName () const =0
 name of option group
 

Static Protected Attributes

static constexpr const char *const _groupNames [] = {nullptr, "caffe2", "onnx"}
 

Detailed Description

interface for Option class

Definition at line 129 of file CommandLine.h.

Member Enumeration Documentation

◆ Group

enum class nnc::cli::IOption::Group
strong
Enumerator
none 
caffe2 
onnx 

Definition at line 187 of file CommandLine.h.

188 {
189 none = 0,
190 caffe2 = 1,
191 onnx = 2 // 'onnx' is currently unused
192 };

Member Function Documentation

◆ canHaveSeveralVals()

virtual bool nnc::cli::IOption::canHaveSeveralVals ( ) const
pure virtual

can option have several values?

Implemented in nnc::cli::Option< T >.

Referenced by nnc::cli::CommandLine::parseCommandLine().

◆ getGroup()

virtual IOption::Group nnc::cli::IOption::getGroup ( ) const
pure virtual
Returns
group in which option is put

Implemented in nnc::cli::Option< T >.

Referenced by nnc::cli::CommandLine::registerOption().

◆ getGroupName()

virtual std::string nnc::cli::IOption::getGroupName ( ) const
pure virtual

name of option group

Implemented in nnc::cli::Option< T >.

◆ getNames()

virtual const std::vector< std::string > & nnc::cli::IOption::getNames ( ) const
pure virtual

◆ getOverview()

virtual const std::string & nnc::cli::IOption::getOverview ( ) const
pure virtual

get description of option

Implemented in nnc::cli::Option< T >.

◆ getSeparators()

virtual const std::vector< char > & nnc::cli::IOption::getSeparators ( ) const
pure virtual

get separators for option

Implemented in nnc::cli::Option< T >.

◆ getValidVals()

virtual const std::vector< std::string > & nnc::cli::IOption::getValidVals ( ) const
pure virtual

get valid values for given option

Implemented in nnc::cli::Option< T >.

◆ isDisabled()

virtual bool nnc::cli::IOption::isDisabled ( ) const
pure virtual

is option disabled?

Implemented in nnc::cli::Option< T >.

◆ isGrouped()

virtual bool nnc::cli::IOption::isGrouped ( ) const
pure virtual
Returns
true if option is in group

Implemented in nnc::cli::Option< T >.

Referenced by nnc::cli::CommandLine::registerOption().

◆ isOptional()

virtual bool nnc::cli::IOption::isOptional ( ) const
pure virtual

may option be optional?

Implemented in nnc::cli::Option< T >.

◆ runCheckerFunc()

virtual void nnc::cli::IOption::runCheckerFunc ( )
pure virtual

function for option verification

Exceptions
thisfunction throws exception of BadOption type if verification is not passed

Implemented in nnc::cli::Option< T >.

◆ setValue()

virtual void nnc::cli::IOption::setValue ( const std::string &  val)
pure virtual

Field Documentation

◆ _groupNames

constexpr const char *const nnc::cli::IOption::_groupNames = {nullptr, "caffe2", "onnx"}
staticconstexprprotected

Definition at line 206 of file CommandLine.h.

206{nullptr, "caffe2", "onnx"};

Referenced by nnc::cli::Option< T >::getGroupName().


The documentation for this class was generated from the following files: