MOAB: Mesh Oriented datABase  (version 5.2.1)
CLArgs::ArgTemplate< T > Class Template Reference

Trivial implementation for type-specific classes. More...

#include <CLArgs.hpp>

+ Inheritance diagram for CLArgs::ArgTemplate< T >:
+ Collaboration diagram for CLArgs::ArgTemplate< T >:

Public Member Functions

virtual ~ArgTemplate ()
virtual bool value (const T &val)
const Tvalue () 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.

Detailed Description

template<typename T>
class CLArgs::ArgTemplate< T >

Trivial implementation for type-specific classes.

Definition at line 118 of file CLArgs.hpp.


Constructor & Destructor Documentation

template<typename T >
virtual CLArgs::ArgTemplate< T >::~ArgTemplate ( ) [inline, virtual]

Definition at line 124 of file CLArgs.hpp.

{}
template<typename T >
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 ) {}
template<typename T >
CLArgs::ArgTemplate< T >::ArgTemplate ( ) [inline]

Initialize without default value.

Definition at line 138 of file CLArgs.hpp.

: mValue( T() ), haveDefault( false ) {}

Member Function Documentation

template<typename T >
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();
        }
template<typename T >
virtual bool CLArgs::ArgTemplate< T >::value ( const T val) [inline, virtual]
Parameters:
valSet 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;
        }
template<typename T >
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().


Member Data Documentation

template<typename T >
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().

template<typename T >
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().

List of all members.


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