16 #ifndef INCLUDED_utility_options_Option_hh
17 #define INCLUDED_utility_options_Option_hh
108 if (
this != &option ) {
147 cl_value( std::string
const & value_str ) = 0;
304 is_value( std::string
const & value_str )
const = 0;
310 is_cl_value( std::string
const & value_str )
const = 0;
412 "Attempting to access option '" +
code() +
"' that has restricted access. Please use 'basic::resource_manager::ResourceManager::get_instance()->get_option( " +
code() +
" );' instead.");
427 return ( a.
key() < b.
key() );
460 #endif // INCLUDED_utility_options_Option_HH
void been_accessed() const
Set access property to true.
Option & operator=(Option const &option)
Copy assignment.
virtual bool is_value(std::string const &value_str) const =0
Is a string readable as this option's value type?
virtual Option & cl_value(std::string const &value_str)=0
Value assignment from a command line string.
virtual bool specified_report() const =0
Required specified option check: Report and return error state.
bool is_group_
Is this a synonymous option for an option group (e.g. -in:file:file)
virtual bool legal_limits_report() const =0
Legal value limits check: Report and return error state.
virtual Option * clone() const =0
Clone this.
virtual std::string const & identifier() const =0
Identifier.
virtual ~Option()
Destructor.
virtual Size size() const =0
Size (number of values)
Option & restrict_access(bool setting)
Restrict direct access to option for general use.
virtual std::string const & id() const =0
ID.
virtual bool legal_specs_report() const =0
Legal specifications check: Report and return error state.
Option & is_group(bool value)
friend bool operator<(Option const &a, Option const &b)
Option < Option.
bool been_accessed_
flag, will be true if application was trying to anyhow access/check option value. Used to create opti...
virtual bool default_active() const =0
Default active?
virtual bool active() const =0
Active? That is, the option has some value, either the default one or specified on the command line...
virtual Size default_size() const =0
Default size (number of default values)
bool operator<(Option const &a, Option const &b)
Option < Option.
virtual std::string equals_string() const =0
=Value string representation
virtual std::string size_constraint_string() const =0
Size constraint string representation.
virtual void legal_check() const =0
Legal value check.
Abstract automatic hidden index key for options.
virtual Option & activate()=0
Activate.
Abstract automatic hidden index key for options.
common derived classes for thrown exceptions
virtual Option & to_default()=0
Set to default value, if any.
Option(Option const &option)
Copy constructor.
virtual std::string legal_string() const =0
Legal value string representation.
virtual std::string const & code() const =0
Code.
Option()
Default constructor.
virtual Size n_value() const =0
Number of values (size)
State
Option state enumeration.
utility::options::Option forward declarations
virtual std::string type_string() const =0
Option type code string representation.
virtual bool legal() const =0
Legal value?
virtual bool user() const =0
User-specified? That is, the option value was specified on the command line. You should probably use ...
virtual bool legal_size_report() const =0
Legal size limits check: Report and return error state.
virtual bool can_hold_another() const =0
Can another value be added and stay within any size constraints?
rule< Scanner, options_closure::context_t > options
virtual void legal_default_check() const =0
Legal default value check.
virtual void specified_check() const =0
Required specified option check.
virtual Key const & key() const =0
Key.
virtual bool legal_report() const =0
Legal value check: Report and return error state.
void set_accessed(bool setting) const
bool is_been_accessed() const
Return true if option value was anyhow accessed.
Program option interface class.
virtual Option & deactivate()=0
Deactivate.
virtual bool default_inactive() const =0
Default inactive?
virtual std::string const & short_description() const =0
short_Description
bool is_group() const
Is this the synonymous option for an option group (e.g. -in:file:file)
virtual bool legal_default() const =0
Legal or inactive default value?
void check_restricted_access(bool do_check) const
bool restricted_access_
Is directly accessing this option deprecated in favor of accessing it through the resource manager...
virtual std::string default_string() const =0
Default value string representation.
virtual std::string value_string() const =0
Value string representation.
virtual std::string const & name() const =0
Name.
virtual bool is_cl_value(std::string const &value_str) const =0
Is a string readable as this option's value type and a legal command line value?
virtual Size n_default_value() const =0
Number of default values (default size)
virtual bool has_default() const =0
Has a default?
virtual Option & clear()=0
Clear.
virtual std::string const & description() const =0
Description.
virtual bool legal_default_report() const =0
Legal default value check: Report and return error state.
rule< Scanner, option_closure::context_t > option