Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
limbo::programoptions::ValueBase Class Referenceabstract

abstract type of data value which defines various virtual functions More...

#include <ProgramOptions.h>

Inheritance diagram for limbo::programoptions::ValueBase:
limbo::programoptions::Value< T >

Public Member Functions

 ValueBase (std::string const &cat, std::string const &m)
 constructor More...
 
 ValueBase (ValueBase const &rhs)
 copy constructor More...
 
ValueBaseoperator= (ValueBase const &rhs)
 assignment More...
 
virtual ~ValueBase ()
 destructor
 
virtual bool parse (const char *)=0
 parse command More...
 
virtual void print (std::ostream &os) const =0
 print target value More...
 
virtual void print_default (std::ostream &os) const =0
 print default value More...
 
virtual void apply_default ()=0
 apply default value
 
virtual void apply_toggle ()=0
 apply toggle value
 
virtual bool valid_target () const =0
 check whether target value is valid More...
 
virtual bool valid_default () const =0
 check whether default value is valid More...
 
virtual bool valid_toggle () const =0
 check whether toggle value is valid More...
 
virtual unsigned count_default_chars () const =0
 count the length of default value string More...
 
virtual bool help_on () const =0
 check whether help message is turned on More...
 
std::string const & category () const
 
std::string const & msg () const
 
bool help () const
 
bool required () const
 
bool valid () const
 
bool toggle () const
 
void print_category (std::ostream &os) const
 print category More...
 
void print_msg (std::ostream &os) const
 print message More...
 

Protected Member Functions

void copy (ValueBase const &rhs)
 copy another object More...
 

Protected Attributes

std::string m_category
 category
 
std::string m_msg
 helper message
 
unsigned char m_help: 1
 whether is help option
 
unsigned char m_required: 1
 whether the value is a required option
 
unsigned char m_valid: 1
 true if target is set, not default
 
unsigned char m_toggle: 1
 true if this option is a toggle value
 

Detailed Description

abstract type of data value which defines various virtual functions

Definition at line 67 of file ProgramOptions.h.

Constructor & Destructor Documentation

limbo::programoptions::ValueBase::ValueBase ( std::string const &  cat,
std::string const &  m 
)
inline

constructor

Parameters
catcategory
mmessage

Definition at line 75 of file ProgramOptions.h.

limbo::programoptions::ValueBase::ValueBase ( ValueBase const &  rhs)
inline

copy constructor

Parameters
rhsthe other object to copy

Definition at line 87 of file ProgramOptions.h.

Member Function Documentation

std::string const& limbo::programoptions::ValueBase::category ( ) const
inline
Returns
category

Definition at line 157 of file ProgramOptions.h.

void limbo::programoptions::ValueBase::copy ( ValueBase const &  rhs)
inlineprotected

copy another object

Parameters
rhsanother object

Definition at line 193 of file ProgramOptions.h.

virtual unsigned limbo::programoptions::ValueBase::count_default_chars ( ) const
pure virtual

count the length of default value string

Returns
the length of string if default value is printed

Implemented in limbo::programoptions::Value< T >.

bool limbo::programoptions::ValueBase::help ( ) const
inline
Returns
help flag

Definition at line 165 of file ProgramOptions.h.

virtual bool limbo::programoptions::ValueBase::help_on ( ) const
pure virtual

check whether help message is turned on

Returns
true if this option is a help option and it is on

Implemented in limbo::programoptions::Value< T >.

std::string const& limbo::programoptions::ValueBase::msg ( ) const
inline
Returns
message

Definition at line 161 of file ProgramOptions.h.

ValueBase& limbo::programoptions::ValueBase::operator= ( ValueBase const &  rhs)
inline

assignment

Parameters
rhsthe other object to copy
Returns
reference to current object

Definition at line 93 of file ProgramOptions.h.

virtual bool limbo::programoptions::ValueBase::parse ( const char *  )
pure virtual

parse command

pure virtual function to parse string

Returns
true if succeeded

Implemented in limbo::programoptions::Value< T >.

virtual void limbo::programoptions::ValueBase::print ( std::ostream &  os) const
pure virtual

print target value

Parameters
osoutput stream

Implemented in limbo::programoptions::Value< T >.

void limbo::programoptions::ValueBase::print_category ( std::ostream &  os) const
inline

print category

Parameters
osoutput stream

Definition at line 182 of file ProgramOptions.h.

virtual void limbo::programoptions::ValueBase::print_default ( std::ostream &  os) const
pure virtual

print default value

Parameters
osoutput stream

Implemented in limbo::programoptions::Value< T >.

void limbo::programoptions::ValueBase::print_msg ( std::ostream &  os) const
inline

print message

Parameters
osoutput stream

Definition at line 187 of file ProgramOptions.h.

bool limbo::programoptions::ValueBase::required ( ) const
inline
Returns
required flag

Definition at line 169 of file ProgramOptions.h.

bool limbo::programoptions::ValueBase::toggle ( ) const
inline
Returns
toggle flag

Definition at line 177 of file ProgramOptions.h.

bool limbo::programoptions::ValueBase::valid ( ) const
inline
Returns
category

Definition at line 173 of file ProgramOptions.h.

virtual bool limbo::programoptions::ValueBase::valid_default ( ) const
pure virtual

check whether default value is valid

Returns
true if default value is set

Implemented in limbo::programoptions::Value< T >.

virtual bool limbo::programoptions::ValueBase::valid_target ( ) const
pure virtual

check whether target value is valid

Returns
true if target pointer is defined

Implemented in limbo::programoptions::Value< T >.

virtual bool limbo::programoptions::ValueBase::valid_toggle ( ) const
pure virtual

check whether toggle value is valid

Returns
true if toggle value is set

Implemented in limbo::programoptions::Value< T >.


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