Rosetta 3.3
Public Types | Public Member Functions | Protected Member Functions
utility::options::ScalarOption_T_< K, T > Class Template Reference

Program scalar-valued option abstract base class. More...

#include <ScalarOption_T_.hh>

Inheritance diagram for utility::options::ScalarOption_T_< K, T >:
Inheritance graph
[legend]
Collaboration diagram for utility::options::ScalarOption_T_< K, T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedefkey_type
typedefvalue_type
typedefKey
typedefValue

Public Member Functions

virtual ScalarOption_T_clone () const =0
 Clone this.
virtual ~ScalarOption_T_ ()
 Destructor.
 operator Value const & () const
 Value conversion.
ScalarOption_T_activate ()
 Activate.
ScalarOption_T_deactivate ()
 Deactivate.
ScalarOption_T_to_default ()
 Set to default value, if any.
ScalarOption_T_clear ()
 Clear.
ScalarOption_T_legal (Value const &value_a)
 Add a legal value.
ScalarOption_T_shortd (std::string const &s)
 Set a short description.
ScalarOption_T_lower (Value const &value_a)
 Set a lower bound.
ScalarOption_T_strict_lower (Value const &value_a)
 Set a strict lower bound.
ScalarOption_T_upper (Value const &value_a)
 Set an upper bound.
ScalarOption_T_strict_upper (Value const &value_a)
 Set a strict upper bound.
virtual ScalarOption_T_default_value (Value const &value_a)
 Default value assignment.
virtual ScalarOption_T_def (Value const &value_a)
 Default value assignment.
ScalarOption_T_cl_value (std::string const &value_str)
 Value assignment from a command line string.
virtual ScalarOption_T_value (Value const &value_a)
 Value assignment.
virtual ScalarOption_T_operator() (Value const &value_a)
 Value assignment.
ScalarOption_T_default_to (ScalarOption_T_ const &option)
 Default to another option's value.
bool legal_specs_report () const
 Legal specifications check: Report and return error state.
bool legal_limits_report () const
 Legal value limits check: Report and return error state.
bool legal_size_report () const
 Legal size limits check: Report and return error state.
bool legal_default_report () const
 Legal default value check: Report and return error state.
void legal_default_check () const
 Legal default value check.
void legal_default_check (Value const &value_a) const
 Legal default value check.
bool legal_report () const
 Legal value check: Report and return error state.
void legal_check () const
 Legal value check.
void legal_check (Value const &value_a) const
 Legal value check.
bool specified_report () const
 Required specified option check: Report and return error state.
void specified_check () const
 Required specified option check.
Key const & key () const
 Key.
std::string const & id () const
 ID.
std::string const & identifier () const
 Identifier.
std::string const & code () const
 Code.
std::string const & name () const
 Name.
std::string const & description () const
 Description.
std::string const & short_description () const
 Short Description.
void short_description (std::string const &sd)
bool legal_default () const
 Legal or inactive default value?
bool legal () const
 Legal value?
bool legal_value (Value const &value_a) const
 Is the given value legal?
bool has_default () const
 Has a default?
bool default_active () const
 Default active?
bool default_inactive () const
 Default inactive?
bool active () const
 Active? That is, the option has some value, either the default one or specified on the command line.
bool user () const
 User-specified? That is, the option value was specified on the command line. You should probably use active() instead in almost all cases!
bool can_hold_another () const
 Can another value be added and stay within any size constraints?
Size default_size () const
 Default size (number of default values)
Size n_default_value () const
 Number of default values (default size)
Size size () const
 Size (number of values)
Size n_value () const
 Number of values (size)
bool has_any_of_characters (std::string const str_, std::string const s) const
 Has Any Character of a std::string? non ambiguous vesrion for Python binding.
std::string legal_string () const
 Legal value string representation.
std::string size_constraint_string () const
 Size constraint string representation.
std::string default_string () const
 Default value string representation.
std::string value_string () const
 Value string representation.
std::string equals_string () const
 =Value string representation
LegalBound const & lower () const
 Lower bound.
LegalBound const & upper ()
 Upper bound.
Value const & default_value () const
 Default value.
Value const & value () const
 Value.
Value const & operator() () const
 Value.
Value value_or (Value const &value_a) const
 Value or passed default if inactive.
Value user_or (Value const &value_a) const
 Value or passed default if not user-specified.

Protected Member Functions

 ScalarOption_T_ ()
 Default constructor.
 ScalarOption_T_ (ScalarOption_T_ const &option)
 Copy constructor.
 ScalarOption_T_ (Key const &key_a, std::string const &description_a)
 Key + description constructor.
ScalarOption_T_operator= (ScalarOption_T_ const &option)
 Copy assignment.
virtual Value value_of (std::string const &value_str) const =0
 Value of a string.
virtual std::string value_string_of (Value const &v) const
 String representation of a given value.
void default_inactive_error () const
 Error handler for using inactive option value.
void inactive_error () const
 Error handler for using inactive option value.
virtual void stream_setup (std::ostream &) const
 Setup stream state for the Option value type.
bool unconstrained () const
 Value is unconstrained?
bool default_is_legal () const
 Default value is a specified legal value?
bool value_is_legal () const
 Value is a specified legal value?
bool value_is_legal (Value const &value_a) const
 Value is legal?
bool default_obeys_bounds () const
 Default value obeys specified bounds?
bool value_obeys_bounds () const
 Value obeys specified bounds?
bool value_obeys_bounds (Value const &value_a) const
 Given value obeys specified bounds?

Detailed Description

template<typename K, typename T>
class utility::options::ScalarOption_T_< K, T >

Program scalar-valued option abstract base class.


Member Typedef Documentation

template<typename K, typename T>
typedef K utility::options::ScalarOption_T_< K, T >::Key

Reimplemented from utility::options::Option.

Reimplemented in utility::options::AnyOption< T >.

template<typename K, typename T>
typedef K utility::options::ScalarOption_T_< K, T >::key_type

Reimplemented from utility::options::Option.

Reimplemented in utility::options::AnyOption< T >.

template<typename K, typename T>
typedef T utility::options::ScalarOption_T_< K, T >::Value
template<typename K, typename T>
typedef T utility::options::ScalarOption_T_< K, T >::value_type

Constructor & Destructor Documentation

template<typename K, typename T>
utility::options::ScalarOption_T_< K, T >::ScalarOption_T_ ( ) [inline, protected]

Default constructor.

template<typename K, typename T>
utility::options::ScalarOption_T_< K, T >::ScalarOption_T_ ( ScalarOption_T_< K, T > const &  option) [inline, protected]

Copy constructor.

template<typename K, typename T>
utility::options::ScalarOption_T_< K, T >::ScalarOption_T_ ( Key const &  key_a,
std::string const &  description_a 
) [inline, protected]

Key + description constructor.

template<typename K, typename T>
virtual utility::options::ScalarOption_T_< K, T >::~ScalarOption_T_ ( ) [inline, virtual]

Destructor.


Member Function Documentation

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::activate ( ) [inline, virtual]

Activate.

Implements utility::options::ScalarOption.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::active ( ) const [inline, virtual]

Active? That is, the option has some value, either the default one or specified on the command line.

Implements utility::options::Option.

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::default_to(), and utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::legal().

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::can_hold_another ( ) const [inline, virtual]

Can another value be added and stay within any size constraints?

Implements utility::options::Option.

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::cl_value ( std::string const &  value_str) [inline, virtual]

Value assignment from a command line string.

Implements utility::options::ScalarOption.

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::clear ( ) [inline, virtual]

Clear.

Implements utility::options::ScalarOption.

template<typename K, typename T>
virtual ScalarOption_T_* utility::options::ScalarOption_T_< K, T >::clone ( ) const [pure virtual]
template<typename K, typename T>
std::string const& utility::options::ScalarOption_T_< K, T >::code ( ) const [inline, virtual]

Code.

Implements utility::options::Option.

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::deactivate ( ) [inline, virtual]

Deactivate.

Implements utility::options::ScalarOption.

template<typename K, typename T>
virtual ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::def ( Value const &  value_a) [inline, virtual]

Default value assignment.

Referenced by utility::options::OptionCollection::add_built_in_options(), and main().

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::default_active ( ) const [inline, virtual]

Default active?

Implements utility::options::Option.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::default_inactive ( ) const [inline, virtual]
template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::default_inactive_error ( ) const [inline, protected]

Error handler for using inactive option value.

Note:
Not handled with assert because unspecified option can be a user error
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::default_is_legal ( ) const [inline, protected]

Default value is a specified legal value?

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::legal_default().

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::default_obeys_bounds ( ) const [inline, protected]
template<typename K, typename T>
Size utility::options::ScalarOption_T_< K, T >::default_size ( ) const [inline, virtual]

Default size (number of default values)

Implements utility::options::Option.

template<typename K, typename T>
std::string utility::options::ScalarOption_T_< K, T >::default_string ( ) const [inline, virtual]
template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::default_to ( ScalarOption_T_< K, T > const &  option) [inline]

Default to another option's value.

template<typename K, typename T>
virtual ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::default_value ( Value const &  value_a) [inline, virtual]

Default value assignment.

template<typename K, typename T>
Value const& utility::options::ScalarOption_T_< K, T >::default_value ( ) const [inline]
template<typename K, typename T>
std::string const& utility::options::ScalarOption_T_< K, T >::description ( ) const [inline, virtual]

Description.

Implements utility::options::Option.

template<typename K, typename T>
std::string utility::options::ScalarOption_T_< K, T >::equals_string ( ) const [inline, virtual]

=Value string representation

Implements utility::options::Option.

Reimplemented in utility::options::BooleanOption.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::has_any_of_characters ( std::string const  str_,
std::string const  s 
) const [inline]

Has Any Character of a std::string? non ambiguous vesrion for Python binding.

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::legal_string().

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::has_default ( ) const [inline, virtual]

Has a default?

Implements utility::options::Option.

template<typename K, typename T>
std::string const& utility::options::ScalarOption_T_< K, T >::id ( ) const [inline, virtual]
template<typename K, typename T>
std::string const& utility::options::ScalarOption_T_< K, T >::identifier ( ) const [inline, virtual]

Identifier.

Implements utility::options::Option.

template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::inactive_error ( ) const [inline, protected]

Error handler for using inactive option value.

Note:
Not handled with assert because unspecified option can be a user error

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::operator Value const &().

template<typename K, typename T>
Key const& utility::options::ScalarOption_T_< K, T >::key ( ) const [inline, virtual]
template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::legal ( Value const &  value_a) [inline]
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal ( ) const [inline, virtual]
template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::legal_check ( ) const [inline, virtual]
template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::legal_check ( Value const &  value_a) const [inline]

Legal value check.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_default ( ) const [inline, virtual]
template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::legal_default_check ( Value const &  value_a) const [inline]

Legal default value check.

template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::legal_default_check ( ) const [inline, virtual]
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_default_report ( ) const [inline, virtual]

Legal default value check: Report and return error state.

Implements utility::options::Option.

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::legal_specs_report().

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_limits_report ( ) const [inline, virtual]

Legal value limits check: Report and return error state.

Implements utility::options::Option.

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::legal_specs_report().

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_report ( ) const [inline, virtual]

Legal value check: Report and return error state.

Implements utility::options::Option.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_size_report ( ) const [inline, virtual]

Legal size limits check: Report and return error state.

Implements utility::options::Option.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_specs_report ( ) const [inline, virtual]

Legal specifications check: Report and return error state.

Implements utility::options::Option.

template<typename K, typename T>
std::string utility::options::ScalarOption_T_< K, T >::legal_string ( ) const [inline, virtual]
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::legal_value ( Value const &  value_a) const [inline]
template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::lower ( Value const &  value_a) [inline]

Set a lower bound.

template<typename K, typename T>
LegalBound const& utility::options::ScalarOption_T_< K, T >::lower ( ) const [inline]

Lower bound.

template<typename K, typename T>
Size utility::options::ScalarOption_T_< K, T >::n_default_value ( ) const [inline, virtual]

Number of default values (default size)

Implements utility::options::Option.

template<typename K, typename T>
Size utility::options::ScalarOption_T_< K, T >::n_value ( ) const [inline, virtual]

Number of values (size)

Implements utility::options::Option.

template<typename K, typename T>
std::string const& utility::options::ScalarOption_T_< K, T >::name ( ) const [inline, virtual]

Name.

Implements utility::options::Option.

template<typename K, typename T>
utility::options::ScalarOption_T_< K, T >::operator Value const & ( ) const [inline]

Value conversion.

template<typename K, typename T>
virtual ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::operator() ( Value const &  value_a) [inline, virtual]

Value assignment.

template<typename K, typename T>
Value const& utility::options::ScalarOption_T_< K, T >::operator() ( ) const [inline]

Value.

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::operator= ( ScalarOption_T_< K, T > const &  option) [inline, protected]

Copy assignment.

template<typename K, typename T>
std::string const& utility::options::ScalarOption_T_< K, T >::short_description ( ) const [inline, virtual]

Short Description.

Implements utility::options::Option.

template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::short_description ( std::string const &  sd) [inline]
template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::shortd ( std::string const &  s) [inline]

Set a short description.

template<typename K, typename T>
Size utility::options::ScalarOption_T_< K, T >::size ( ) const [inline, virtual]

Size (number of values)

Implements utility::options::Option.

template<typename K, typename T>
std::string utility::options::ScalarOption_T_< K, T >::size_constraint_string ( ) const [inline, virtual]

Size constraint string representation.

Implements utility::options::Option.

template<typename K, typename T>
void utility::options::ScalarOption_T_< K, T >::specified_check ( ) const [inline, virtual]

Required specified option check.

Implements utility::options::Option.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::specified_report ( ) const [inline, virtual]

Required specified option check: Report and return error state.

Implements utility::options::Option.

template<typename K, typename T>
virtual void utility::options::ScalarOption_T_< K, T >::stream_setup ( std::ostream &  ) const [inline, protected, virtual]
template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::strict_lower ( Value const &  value_a) [inline]

Set a strict lower bound.

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::strict_upper ( Value const &  value_a) [inline]

Set a strict upper bound.

template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::to_default ( ) [inline, virtual]

Set to default value, if any.

Implements utility::options::ScalarOption.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::unconstrained ( ) const [inline, protected]
template<typename K, typename T>
ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::upper ( Value const &  value_a) [inline]

Set an upper bound.

template<typename K, typename T>
LegalBound const& utility::options::ScalarOption_T_< K, T >::upper ( ) [inline]

Upper bound.

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::user ( ) const [inline, virtual]

User-specified? That is, the option value was specified on the command line. You should probably use active() instead in almost all cases!

Implements utility::options::Option.

Referenced by utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::specified_check(), and utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::specified_report().

template<typename K, typename T>
Value utility::options::ScalarOption_T_< K, T >::user_or ( Value const &  value_a) const [inline]

Value or passed default if not user-specified.

template<typename K, typename T>
Value const& utility::options::ScalarOption_T_< K, T >::value ( ) const [inline]
template<typename K, typename T>
virtual ScalarOption_T_& utility::options::ScalarOption_T_< K, T >::value ( Value const &  value_a) [inline, virtual]
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::value_is_legal ( Value const &  value_a) const [inline, protected]

Value is legal?

template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::value_is_legal ( ) const [inline, protected]
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::value_obeys_bounds ( ) const [inline, protected]
template<typename K, typename T>
bool utility::options::ScalarOption_T_< K, T >::value_obeys_bounds ( Value const &  value_a) const [inline, protected]

Given value obeys specified bounds?

template<typename K, typename T>
virtual Value utility::options::ScalarOption_T_< K, T >::value_of ( std::string const &  value_str) const [protected, pure virtual]
template<typename K, typename T>
Value utility::options::ScalarOption_T_< K, T >::value_or ( Value const &  value_a) const [inline]

Value or passed default if inactive.

template<typename K, typename T>
std::string utility::options::ScalarOption_T_< K, T >::value_string ( ) const [inline, virtual]
template<typename K, typename T>
virtual std::string utility::options::ScalarOption_T_< K, T >::value_string_of ( Value const &  v) const [inline, protected, virtual]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines