#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdlib>
#include <list>
#include <limits>
#include <set>
#include <algorithm>
#include <cassert>
#include <cstring>
#include "moab/MOABConfig.h"
#include "moab/ProgOptions.hpp"
Go to the source code of this file.
◆ DECLARE_OPTION_TYPE
#define DECLARE_OPTION_TYPE |
( |
|
T | ) |
|
Value: template void ProgOptions::addOpt< T >( const std::string&, const std::string&, T*, int ); \
template bool ProgOptions::getOpt< T >( const std::string&, T* );
Definition at line 1029 of file ProgOptions.cpp.
◆ DECLARE_VALUED_OPTION_TYPE
#define DECLARE_VALUED_OPTION_TYPE |
( |
|
T | ) |
|
Value:
template void ProgOptions::getOptAllArgs< T >( const std::string&, std::vector< T >& ); \
template void ProgOptions::addRequiredArg< T >( const std::string&, const std::string&, T*, int ); \
template void ProgOptions::addOptionalArgs< T >( unsigned, const std::string&, const std::string&, int ); \
template T ProgOptions::getReqArg< T >( const std::string& ); \
template void ProgOptions::getArgs< T >( const std::string&, std::vector< T >& );
Definition at line 1033 of file ProgOptions.cpp.
◆ OptType
Enumerator |
---|
FLAG | |
INT | |
REAL | |
STRING | |
INT_VECT | |
Definition at line 19 of file ProgOptions.cpp.
◆ do_rank_subst()
static std::string do_rank_subst |
( |
const std::string & |
s | ) |
|
|
static |
Definition at line 459 of file ProgOptions.cpp.
461 #ifndef MOAB_HAVE_MPI
465 if( MPI_SUCCESS != MPI_Comm_rank( MPI_COMM_WORLD, &rank ) || MPI_SUCCESS != MPI_Comm_size( MPI_COMM_WORLD, &
size ) )
474 size_t j = s.find(
'%' );
475 if( j == std::string::npos )
return s;
477 std::ostringstream st;
478 st << std::setfill(
'0' );
479 st << s.substr( 0, j );
483 while( ( i = s.find(
'%', j + 1 ) ) != std::string::npos )
485 st << s.substr( j, i - j );
486 st << std::setw( width ) << rank;
489 st << s.substr( j + 1 );
References size.
Referenced by ProgOptions::evaluate().
◆ get_opt_type()
◆ get_opt_type< double >()
◆ get_opt_type< int >()
◆ get_opt_type< std::string >()
◆ get_opt_type< std::vector< int > >()
◆ get_opt_type< void >()
◆ parse_int_list()
static bool parse_int_list |
( |
const char * |
string, |
|
|
std::vector< int > & |
results |
|
) |
| |
|
static |
Definition at line 409 of file ProgOptions.cpp.
412 char* mystr = strdup(
string );
413 for(
const char* ptr = strtok( mystr,
", \t" ); ptr; ptr = strtok( 0,
", \t" ) )
416 long val = strtol( ptr, &endptr, 0 );
419 std::cerr <<
"Not an integer: \"" << ptr <<
'"' << std::endl;
427 const char* sptr = endptr + 1;
428 val2 = strtol( sptr, &endptr, 0 );
431 std::cerr <<
"Not an integer: \"" << sptr <<
'"' << std::endl;
437 std::cerr <<
"Invalid id range: \"" << ptr <<
'"' << std::endl;
449 for( ; val <= val2; ++val )
450 results.push_back( (
int)val );
Referenced by ProgOptions::evaluate().