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

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

#include <CLArgs.hpp>

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

Public Member Functions

virtual ~ArgListTemplate ()
virtual bool value (const std::vector< T > &val)
const std::vector< T > & value () const
 get value
 ArgListTemplate (const std::vector< T > &initial_value)
 Initialize with default value.
 ArgListTemplate ()
 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

std::vector< TmValue
 The default or user-specified value for an option.
bool haveDefault
 True if app. provided default value.

Detailed Description

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

Trivial implementation for type-specific classes.

Definition at line 150 of file CLArgs.hpp.


Constructor & Destructor Documentation

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

Definition at line 156 of file CLArgs.hpp.

{}
template<typename T >
CLArgs::ArgListTemplate< T >::ArgListTemplate ( const std::vector< T > &  initial_value) [inline]

Initialize with default value.

Definition at line 168 of file CLArgs.hpp.

: mValue( initial_value ), haveDefault( true ) {}
template<typename T >
CLArgs::ArgListTemplate< T >::ArgListTemplate ( ) [inline]

Initialize without default value.

Definition at line 170 of file CLArgs.hpp.

: haveDefault( false ) {}

Member Function Documentation

template<typename T >
virtual std::string CLArgs::ArgListTemplate< 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 172 of file CLArgs.hpp.

References CLArgs::ArgListTemplate< T >::mValue.

        {
            std::ostringstream ss;
            std::copy( mValue.begin(), mValue.end(), std::ostream_iterator< T >( ss, ", " ) );
            return ss.str();
        }
template<typename T >
virtual bool CLArgs::ArgListTemplate< T >::value ( const std::vector< T > &  val) [inline, virtual]
Parameters:
valSet value

Implements CLArgs::ArgTemplateI< std::vector< T > >.

Definition at line 157 of file CLArgs.hpp.

References CLArgs::ArgListTemplate< T >::mValue, and CLArgs::ArgIBase::set_seen().

        {
            mValue = val;
            ArgTemplateI< std::vector< T > >::set_seen();
            return true;
        }
template<typename T >
const std::vector< T >& CLArgs::ArgListTemplate< T >::value ( ) const [inline]

Member Data Documentation

template<typename T >
bool CLArgs::ArgListTemplate< T >::haveDefault [private]

True if app. provided default value.

Definition at line 154 of file CLArgs.hpp.

template<typename T >
std::vector< T > CLArgs::ArgListTemplate< T >::mValue [private]

The default or user-specified value for an option.

Definition at line 153 of file CLArgs.hpp.

Referenced by CLArgs::ArgListTemplate< T >::default_str(), and CLArgs::ArgListTemplate< 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