212 SnlProg(
const string aName,
const string aDescription=
"",
const string aDocPage=
"");
241 int Scan(
int argc,
char* argv[]);
255 const string aDefaultValue,
256 const bool aRequired=
true,
257 const string aExtraDescription=
"");
359 void SaveValue(
const string aKeyWord,
const string aValue);
vector< string > SplitString(const string aStringToSplit, const char aSeparator)
Splits a string.
Definition CUtils.cc:39
This module offers C++ utility functions.
This module is used to define SatAndLight error codes.
enum _E_ERROR_CODE E_ERROR_CODE
List of error codes.
_E_OPTIONS_ID
List of option IDs.
Definition Options.h:21
@ OPTIONS_ID_HALF_OPENING_ANGLE
half opening angle.
Definition Options.h:49
@ OPTIONS_ID_REDSHIFT
redshift.
Definition Options.h:47
@ OPTIONS_ID_INTRINSIC_DENSITY
intrinsic column density.
Definition Options.h:45
@ OPTIONS_ID_TIME_START
time start .
Definition Options.h:31
@ OPTIONS_ID_ENERGY_DECAY
Energy decay .
Definition Options.h:42
@ OPTIONS_ID_TIME_DECAY
time decay .
Definition Options.h:33
@ OPTIONS_ID_CAM_NAME
camera name.
Definition Options.h:28
@ OPTIONS_ID_TIME_DELTA
time delta .
Definition Options.h:32
@ OPTIONS_ID_FLUX
flux .
Definition Options.h:36
@ OPTIONS_ID_OPENING_ANGLE
opening angle.
Definition Options.h:48
@ OPTIONS_ID_ALPHA
alpha.
Definition Options.h:37
@ OPTIONS_ID_ENERGY_MIN
minimum energies .
Definition Options.h:40
@ OPTIONS_ID_NAME
name.
Definition Options.h:27
@ OPTIONS_ID_SRC_NAME
source name.
Definition Options.h:29
@ OPTIONS_ID_TIME
time .
Definition Options.h:30
@ OPTIONS_ID_IN_FILE
input file.
Definition Options.h:23
@ OPTIONS_ID_ENERGY
energy .
Definition Options.h:39
@ OPTIONS_ID_PHOTON_INDEX
photon index ( ).
Definition Options.h:44
@ OPTIONS_ID_ENERGIES
list of energies .
Definition Options.h:43
@ OPTIONS_ID_OUT_FILE
output file.
Definition Options.h:25
@ OPTIONS_ID_OUT_DIR
output directory.
Definition Options.h:26
@ OPTIONS_ID_GALACTIC_DENSITY
galactic column density.
Definition Options.h:46
@ OPTIONS_ID_IN_FILES
input files (file pattern).
Definition Options.h:24
@ OPTIONS_ID_N
number of option names.
Definition Options.h:50
@ OPTIONS_ID_THRESHOLD
threshold.
Definition Options.h:35
@ OPTIONS_ID_NONE
none.
Definition Options.h:22
@ OPTIONS_ID_ENERGY_MAX
maximum energies .
Definition Options.h:41
@ OPTIONS_ID_BETA
beta.
Definition Options.h:38
@ OPTIONS_ID_N_PIX
number of pictures.
Definition Options.h:34
enum _E_OPTIONS_ID E_OPTIONS_ID
List of option IDs.
Manage a SNL command line option.
Definition Options.h:66
double dvalue
double value.
Definition Options.h:169
int ivalue
integer value.
Definition Options.h:166
void SetExtraDescription(const string aExtraDescription)
Sets the option extra description attribute.
Definition Options.h:114
double GetValueD(void)
Returns the option value attribute (double).
Definition Options.h:132
int GetValueI(void)
Returns the option value attribute (integer).
Definition Options.h:139
string GetValueS(void)
Returns the option value attribute (string).
Definition Options.h:160
unsigned int uivalue
unsigned 32b integer value.
Definition Options.h:167
string extra_description
Extra description message.
Definition Options.h:165
unsigned int GetValueUI(void)
Returns the option value attribute (32-bit unsigned integer).
Definition Options.h:146
E_OPTIONS_ID GetId(void)
Returns option ID.
Definition Options.h:106
void Print(void)
Prints option in stderr.
Definition Options.cc:411
E_OPTIONS_ID id
ID.
Definition Options.h:164
void SetValue(const string aValue)
Sets the option value attribute.
Definition Options.cc:400
virtual ~SnlOpt(void)
Destructor of the SnlOpt class.
Definition Options.cc:395
unsigned long int ulivalue
unsigned 64b integer value.
Definition Options.h:168
string svalue
string value.
Definition Options.h:170
unsigned long int GetValueULI(void)
Returns the option value attribute (64-bit unsigned integer).
Definition Options.h:153
Parse user options from the command line.
Definition Options.h:195
string name
Program name.
Definition Options.h:344
void SaveValue(const string aKeyWord, const string aValue)
Saves option value.
Definition Options.cc:290
bool used[OPTIONS_ID_N]
List of used options.
Definition Options.h:350
virtual ~SnlProg(void)
Destructor of the SnlProg class.
Definition Options.cc:144
double GetValueD(const E_OPTIONS_ID aId)
Returns option value (double).
Definition Options.h:299
E_ERROR_CODE CheckOpt(const E_OPTIONS_ID aId)
Checks the sanity of user input values.
Definition Options.cc:305
string doc
Link to documentation page.
Definition Options.h:346
unsigned int GetValueUI(const E_OPTIONS_ID aId)
Returns option value (unsigned 32b integer).
Definition Options.h:281
bool selected[OPTIONS_ID_N]
List of selected options.
Definition Options.h:348
void SelectOption(const E_OPTIONS_ID aId, const string aDefaultValue, const bool aRequired=true, const string aExtraDescription="")
Selects an option.
Definition Options.cc:214
vector< string > GetValueVectorS(const E_OPTIONS_ID aId)
Returns the option value as a vector of sub-strings.
Definition Options.h:324
unsigned long int GetValueULI(const E_OPTIONS_ID aId)
Returns option value (unsigned 64b integer).
Definition Options.h:290
int GetValueI(const E_OPTIONS_ID aId)
Returns option value (integer).
Definition Options.h:272
int Scan(int argc, char *argv[])
Parse the command line arguments.
Definition Options.cc:150
SnlOpt * opt[OPTIONS_ID_N]
List of options.
Definition Options.h:347
void PrintUsage(void)
Prints program usage.
Definition Options.cc:231
vector< double > GetValueVector(const E_OPTIONS_ID aId)
Returns the option value as a vector of double values.
Definition Options.cc:362
string desc
Program description.
Definition Options.h:345
string GetValueS(const E_OPTIONS_ID aId)
Returns option value (string).
Definition Options.h:308
bool required[OPTIONS_ID_N]
List of required options.
Definition Options.h:349