MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Trivial implementation for type-specific classes. More...
#include <CLArgs.hpp>
Public Member Functions | |
virtual | ~ArgTemplate () |
virtual bool | value (const T &val) |
const T & | value () const |
get value | |
ArgTemplate (const T &initial_value) | |
Initialize with default value. | |
ArgTemplate () | |
Initialize without default value. | |
virtual std::string | default_str () const |
Get string representation of default value, or empty string of no default value. | |
Private Attributes | |
T | mValue |
The default or user-specified value for an option. | |
bool | haveDefault |
True if app. provided default value. |
Trivial implementation for type-specific classes.
Definition at line 118 of file CLArgs.hpp.
virtual CLArgs::ArgTemplate< T >::~ArgTemplate | ( | ) | [inline, virtual] |
Definition at line 124 of file CLArgs.hpp.
{}
CLArgs::ArgTemplate< T >::ArgTemplate | ( | const T & | initial_value | ) | [inline] |
Initialize with default value.
Definition at line 136 of file CLArgs.hpp.
: mValue( initial_value ), haveDefault( true ) {}
CLArgs::ArgTemplate< T >::ArgTemplate | ( | ) | [inline] |
Initialize without default value.
Definition at line 138 of file CLArgs.hpp.
: mValue( T() ), haveDefault( false ) {}
virtual std::string CLArgs::ArgTemplate< T >::default_str | ( | ) | const [inline, virtual] |
Get string representation of default value, or empty string of no default value.
Reimplemented from CLArgs::ArgIBase.
Definition at line 140 of file CLArgs.hpp.
References CLArgs::ArgTemplate< T >::haveDefault, and CLArgs::ArgTemplate< T >::mValue.
{ std::ostringstream ss; if( haveDefault ) ss << mValue; return ss.str(); }
virtual bool CLArgs::ArgTemplate< T >::value | ( | const T & | val | ) | [inline, virtual] |
val | Set value |
Implements CLArgs::ArgTemplateI< T >.
Definition at line 125 of file CLArgs.hpp.
References CLArgs::ArgTemplate< T >::mValue, and CLArgs::ArgIBase::set_seen().
Referenced by main(), and process_domain_args().
{ mValue = val; ArgTemplateI< T >::set_seen(); return true; }
const T& CLArgs::ArgTemplate< T >::value | ( | ) | const [inline] |
get value
Reimplemented in CLArgs::DoubleRangeArg, and CLArgs::IntRangeArg.
Definition at line 131 of file CLArgs.hpp.
References CLArgs::ArgTemplate< T >::mValue.
Referenced by CLArgs::IntRangeArg::value(), and CLArgs::DoubleRangeArg::value().
bool CLArgs::ArgTemplate< T >::haveDefault [private] |
True if app. provided default value.
Definition at line 122 of file CLArgs.hpp.
Referenced by CLArgs::ArgTemplate< T >::default_str().
T CLArgs::ArgTemplate< T >::mValue [private] |
The default or user-specified value for an option.
Definition at line 121 of file CLArgs.hpp.
Referenced by CLArgs::ArgTemplate< T >::default_str(), and CLArgs::ArgTemplate< T >::value().