bmv2
Designing your own switch target with bmv2
|
Go to the documentation of this file.
30 #ifndef BM_BM_SIM_TARGET_PARSER_H_
31 #define BM_BM_SIM_TARGET_PARSER_H_
48 virtual int parse(
const std::vector<std::string> &more_options,
49 std::ostream *errstream) = 0;
53 virtual void help_msg(std::ostream *outstream)
const = 0;
56 class TargetParserBasicStore;
83 int parse(
const std::vector<std::string> &more_options,
84 std::ostream *errstream)
override;
87 void help_msg(std::ostream *outstream)
const override;
93 const std::string &help_str);
98 const std::string &help_str);
103 const std::string &help_str);
108 const std::string &help_str);
124 std::unique_ptr<TargetParserBasicStore> var_store;
141 int parse(
const std::vector<std::string> &more_options,
142 std::ostream *errstream)
override;
148 int load_modules(std::ostream *errstream);
153 #endif // BM_BM_SIM_TARGET_PARSER_H_
ReturnCode get_int_option(const std::string &name, int *v) const
virtual void help_msg(std::ostream *outstream) const =0
ReturnCode
Return codes for this class.
Definition: target_parser.h:63
TargetParserBasic()
Constructor.
Interface for target-specific command-line options parsers.
Definition: target_parser.h:41
Definition: target_parser.h:60
void help_msg(std::ostream *outstream) const override
See bm::TargetParserIface::help_msg.
ReturnCode get_uint_option(const std::string &name, unsigned int *v) const
int parse(const std::vector< std::string > &more_options, std::ostream *errstream) override
@ OPTION_NOT_PROVIDED
the option was not provided by the user
@ INVALID_OPTION_NAME
option name not recognized (did not call add)
@ DUPLICATE_OPTION
option was already added to the parser
Definition: target_parser.h:133
ReturnCode get_flag_option(const std::string &name, bool *v) const
ReturnCode get_string_option(const std::string &name, std::string *v) const
@ INVALID_OPTION_TYPE
type mismatch, you used the wrong get method
virtual int parse(const std::vector< std::string > &more_options, std::ostream *errstream)=0
ReturnCode add_string_option(const std::string &name, const std::string &help_str)
ReturnCode add_int_option(const std::string &name, const std::string &help_str)
ReturnCode add_uint_option(const std::string &name, const std::string &help_str)
static constexpr char load_modules_option[]
Name of the option.
Definition: target_parser.h:146
@ SUCCESS
successful operation
ReturnCode add_flag_option(const std::string &name, const std::string &help_str)
int parse(const std::vector< std::string > &more_options, std::ostream *errstream) override