Limbo 3.5.4
Loading...
Searching...
No Matches
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
 ValueBase (ValueBase const &rhs)
 copy constructor
ValueBaseoperator= (ValueBase const &rhs)
 assignment
virtual ~ValueBase ()
 destructor
virtual bool parse (const char *)=0
 parse command
virtual void print (std::ostream &os) const =0
 print target value
virtual void print_default (std::ostream &os) const =0
 print default value
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
virtual bool valid_default () const =0
 check whether default value is valid
virtual bool valid_toggle () const =0
 check whether toggle value is valid
virtual unsigned count_default_chars () const =0
 count the length of default value string
virtual bool help_on () const =0
 check whether help message is turned on
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
void print_msg (std::ostream &os) const
 print message

Protected Member Functions

void copy (ValueBase const &rhs)
 copy another object

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

◆ ValueBase() [1/2]

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.

◆ ValueBase() [2/2]

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

copy constructor

Parameters
rhsthe other object to copy

Definition at line 87 of file ProgramOptions.h.

◆ ~ValueBase()

virtual limbo::programoptions::ValueBase::~ValueBase ( )
inlinevirtual

destructor

Definition at line 102 of file ProgramOptions.h.

Member Function Documentation

◆ apply_default()

virtual void limbo::programoptions::ValueBase::apply_default ( )
pure virtual

apply default value

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

◆ apply_toggle()

virtual void limbo::programoptions::ValueBase::apply_toggle ( )
pure virtual

apply toggle value

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

◆ category()

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

Definition at line 157 of file ProgramOptions.h.

◆ copy()

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

copy another object

Parameters
rhsanother object

Definition at line 193 of file ProgramOptions.h.

◆ count_default_chars()

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 >.

◆ help()

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

Definition at line 165 of file ProgramOptions.h.

◆ help_on()

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 >.

◆ msg()

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

Definition at line 161 of file ProgramOptions.h.

◆ operator=()

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.

◆ parse()

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 >.

◆ print()

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

print target value

Parameters
osoutput stream

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

◆ print_category()

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

print category

Parameters
osoutput stream

Definition at line 182 of file ProgramOptions.h.

◆ print_default()

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 >.

◆ print_msg()

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

print message

Parameters
osoutput stream

Definition at line 187 of file ProgramOptions.h.

◆ required()

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

Definition at line 169 of file ProgramOptions.h.

◆ toggle()

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

Definition at line 177 of file ProgramOptions.h.

◆ valid()

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

Definition at line 173 of file ProgramOptions.h.

◆ valid_default()

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 >.

◆ valid_target()

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 >.

◆ valid_toggle()

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 >.

Member Data Documentation

◆ m_category

std::string limbo::programoptions::ValueBase::m_category
protected

category

Definition at line 203 of file ProgramOptions.h.

◆ m_help

unsigned char limbo::programoptions::ValueBase::m_help
protected

whether is help option

Definition at line 205 of file ProgramOptions.h.

◆ m_msg

std::string limbo::programoptions::ValueBase::m_msg
protected

helper message

Definition at line 204 of file ProgramOptions.h.

◆ m_required

unsigned char limbo::programoptions::ValueBase::m_required
protected

whether the value is a required option

Definition at line 206 of file ProgramOptions.h.

◆ m_toggle

unsigned char limbo::programoptions::ValueBase::m_toggle
protected

true if this option is a toggle value

Definition at line 208 of file ProgramOptions.h.

◆ m_valid

unsigned char limbo::programoptions::ValueBase::m_valid
protected

true if target is set, not default

Definition at line 207 of file ProgramOptions.h.


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