MOAB: Mesh Oriented datABase  (version 5.4.1)
CLArgs::IntRangeArg Class Reference

Integer argument constrained to a range of valid values. More...

#include <CLArgs.hpp>

+ Inheritance diagram for CLArgs::IntRangeArg:
+ Collaboration diagram for CLArgs::IntRangeArg:

Public Member Functions

 IntRangeArg (const int *min=0, const int *max=0)
 IntRangeArg (int default_val, const int *min, const int *max)
bool value (const int &val)
const int & value () const
 get value
std::string desc_append () const
 Get optional additional info to print with flag description.

Private Attributes

IntRange mRange

Detailed Description

Integer argument constrained to a range of valid values.

Definition at line 251 of file CLArgs.hpp.


Constructor & Destructor Documentation

CLArgs::IntRangeArg::IntRangeArg ( const int *  min = 0,
const int *  max = 0 
) [inline]

Definition at line 257 of file CLArgs.hpp.

: mRange( min, max ) {}
CLArgs::IntRangeArg::IntRangeArg ( int  default_val,
const int *  min,
const int *  max 
) [inline]

Definition at line 258 of file CLArgs.hpp.

: IntArg( default_val ), mRange( min, max ) {}

Member Function Documentation

std::string CLArgs::IntRangeArg::desc_append ( ) const [inline, virtual]

Get optional additional info to print with flag description.

Reimplemented from CLArgs::ArgIBase.

Definition at line 264 of file CLArgs.hpp.

References CLArgs::IntRange::desc_append(), and mRange.

        {
            return mRange.desc_append();
        }
bool CLArgs::IntRangeArg::value ( const int &  val)

Definition at line 486 of file CLArgs.cpp.

References CLArgs::ArgTemplate< T >::value().

Referenced by main().

{
    if( !mRange.is_valid( val ) ) return false;
    return IntArg::value( val );
}
const int& CLArgs::IntRangeArg::value ( ) const [inline]

get value

Reimplemented from CLArgs::ArgTemplate< T >.

Definition at line 260 of file CLArgs.hpp.

        {
            return IntArg::value();
        }

Member Data Documentation

Definition at line 254 of file CLArgs.hpp.

Referenced by desc_append().

List of all members.


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