#include <main.h>
Public Member Functions | |
ComSwitch () | |
Default Constructor. More... | |
ComSwitch (int rArgc, char *rpArgv[]) | |
Constructor with program arguments. More... | |
~ComSwitch () | |
Free memory, and close open file handles. More... | |
bool | parseOptions () |
Parse command options, begin logging. More... | |
void | setArguments (int rArgc, char *rpArgv[]) |
Set command line arguments. More... | |
bool | requiredArgsSet () |
Check if required arguments are set. More... | |
int | getFileDimensions (int rFile) |
Get file dimensions. More... | |
std::vector< adj_map > | getConvFactor (int rFile) |
Get conversion factors. More... | |
std::vector< adj_map > | getNormVal (int rFile) |
Get normalization values. More... | |
bool | getVerbosity () |
Get logging verbosity. More... | |
ifstream & | getInputFile (int rFile) |
Get Input File. More... | |
string | getFileName (int rFile) |
Get File Name. More... | |
ofstream & | getLogFile () |
Get Log File. More... | |
string | getOutPrefix () |
Get OutPrefix. More... | |
bool | isRangeSpecified () |
Returns a flag that indicates whether a range was supplied to this instance of CommSwitch. More... | |
BoundingBox | getRange () |
Returns a bounding box corresponding to the range of the region of interest. More... | |
std::vector< cmp_map > | getComparisonList () |
Get Comparison List. More... | |
std::vector< std::vector< int > > | getFieldMappings (int rFile) |
Get the field mapping vector for the specified file. More... | |
std::vector< index_order > | getIndexOrder (int rFile) |
Get the index order for the specified file. More... | |
Private Member Functions | |
void | setDefaultVars () |
Set default member variables. More... | |
bool | readOptions () |
Set option string and long opts struct then parse arguments. More... | |
bool | parseValuesFromArguments (string rOptString, const struct option *rLongOpts) |
Read and parse options from array. More... | |
bool | initializeFileStreams () |
Initialize file streams. More... | |
bool | writeLogHeader () |
Write the log file header Program Name - switches Input files. More... | |
Private Attributes | |
bool | mHelp |
Help flag is set from command line options. More... | |
int | mArgc |
char ** | mpArgv |
Number of arguments. More... | |
bool | mBadSwitch |
The actual command line arguments. More... | |
int | mInfile1Dimensions |
Bad command line switch detection. More... | |
int | mInfile2Dimensions |
Infile 1 independent variable dimensions. More... | |
bool | restrictToRange |
Infile 2 independent variable dimensions. More... | |
BoundingBox | mRange |
Flag used to indicate if the metrics will be restricted to a given range. More... | |
std::vector< adj_map > | mFile1ConversionFactor |
Range of region of interest. More... | |
std::vector< adj_map > | mFile2ConversionFactor |
std::vector< adj_map > | mFile1Norm |
std::vector< adj_map > | mFile2Norm |
ofstream | mLog |
string | mOutPrefix |
string | mInfileName1 |
string | mInfileName2 |
ifstream | mInfile1 |
ifstream | mInfile2 |
std::vector< cmp_map > | mComparisonList |
std::vector< std::vector< int > > | mFieldMappingsFile1 |
std::vector< std::vector< int > > | mFieldMappingsFile2 |
std::vector< index_order > | mIndexOrderFile1 |
std::vector< index_order > | mIndexOrderFile2 |
bool | mLoud |
ComSwitch | ( | ) |
Default Constructor.
Definition at line 348 of file main.cpp.
References setDefaultVars().
ComSwitch | ( | int | rArgc, |
char * | rpArgv[] | ||
) |
Constructor with program arguments.
rArgc | Number of arguments |
rpArgv | Actual arguments |
Definition at line 354 of file main.cpp.
References setArguments(), and setDefaultVars().
~ComSwitch | ( | ) |
std::vector< cmp_map > getComparisonList | ( | ) |
Get Comparison List.
Definition at line 550 of file main.cpp.
References mComparisonList.
Referenced by compareFiles().
std::vector< adj_map > getConvFactor | ( | int | rFile | ) |
Get conversion factors.
rFile | File number (1 or 2) |
Definition at line 474 of file main.cpp.
References mFile1ConversionFactor, and mFile2ConversionFactor.
Referenced by openAndParseFiles().
std::vector< std::vector< int > > getFieldMappings | ( | int | rFile | ) |
Get the field mapping vector for the specified file.
rFile | File number (1 or 2) |
Definition at line 557 of file main.cpp.
References empty(), mFieldMappingsFile1, and mFieldMappingsFile2.
Referenced by openAndParseFiles().
int getFileDimensions | ( | int | rFile | ) |
Get file dimensions.
rFile | File number (1 or 2) |
Definition at line 462 of file main.cpp.
References mInfile1Dimensions, and mInfile2Dimensions.
Referenced by openAndParseFiles().
string getFileName | ( | int | rFile | ) |
Get File Name.
rFile | File number (1 or 2) |
Definition at line 523 of file main.cpp.
References mInfileName1, and mInfileName2.
Referenced by openAndParseFiles().
std::vector< index_order > getIndexOrder | ( | int | rFile | ) |
Get the index order for the specified file.
rFile | File number (1 or 2) |
Definition at line 577 of file main.cpp.
References empty(), mIndexOrderFile1, and mIndexOrderFile2.
Referenced by openAndParseFiles().
ifstream & getInputFile | ( | int | rFile | ) |
Get Input File.
rFile | File number (1 or 2) |
Definition at line 511 of file main.cpp.
References mInfile1, and mInfile2.
Referenced by openAndParseFiles().
ofstream & getLogFile | ( | ) |
Get Log File.
Definition at line 536 of file main.cpp.
References mLog.
Referenced by compareFiles(), and openAndParseFiles().
std::vector< adj_map > getNormVal | ( | int | rFile | ) |
Get normalization values.
rFile | File number (1 or 2) |
Definition at line 489 of file main.cpp.
References mFile1Norm, and mFile2Norm.
Referenced by openAndParseFiles().
string getOutPrefix | ( | ) |
Get OutPrefix.
Definition at line 543 of file main.cpp.
References mOutPrefix.
Referenced by compareFiles().
|
inline |
Returns a bounding box corresponding to the range of the region of interest.
Definition at line 144 of file main.h.
Referenced by compareFiles().
bool getVerbosity | ( | ) |
Get logging verbosity.
Definition at line 504 of file main.cpp.
References mLoud.
Referenced by compareFiles(), and openAndParseFiles().
|
private |
Initialize file streams.
Definition at line 922 of file main.cpp.
References mInfile1, mInfile2, mInfileName1, mInfileName2, mLog, mOutPrefix, and printUsage().
Referenced by parseOptions().
|
inline |
Returns a flag that indicates whether a range was supplied to this instance of CommSwitch.
Definition at line 133 of file main.h.
Referenced by compareFiles().
bool parseOptions | ( | ) |
Parse command options, begin logging.
Definition at line 395 of file main.cpp.
References initializeFileStreams(), mBadSwitch, mHelp, printUsage(), readOptions(), requiredArgsSet(), and writeLogHeader().
Referenced by main().
|
private |
Read and parse options from array.
rOptString | Short options string |
rLongOpts | Long options struct |
Definition at line 624 of file main.cpp.
References cimg_library::cimg::atof(), check_non_numeric_str(), CGAL::compare(), adj_map::factor, cmp_map::file1_partitions, cmp_map::file2_partition, mArgc, mBadSwitch, mComparisonList, cmp_map::metric, mFieldMappingsFile1, mFieldMappingsFile2, mFile1ConversionFactor, mFile1Norm, mFile2ConversionFactor, mFile2Norm, mHelp, mIndexOrderFile1, mIndexOrderFile2, mInfile1Dimensions, mInfile2Dimensions, mInfileName1, mInfileName2, mLoud, mOutPrefix, mpArgv, mRange, index_order::order, index_order::partition_number, restrictToRange, BoundingBox::setCoordinates(), str_tokenize(), cmp_map::var1, cmp_map::var2, and adj_map::variable.
Referenced by readOptions().
|
private |
Set option string and long opts struct then parse arguments.
Definition at line 597 of file main.cpp.
References cimg_library::cimg::option(), and parseValuesFromArguments().
Referenced by parseOptions().
bool requiredArgsSet | ( | ) |
Check if required arguments are set.
Definition at line 436 of file main.cpp.
References mBadSwitch, mComparisonList, mInfile1, mInfile1Dimensions, mInfile2, mInfile2Dimensions, mLog, and mOutPrefix.
Referenced by parseOptions().
void setArguments | ( | int | rArgc, |
char * | rpArgv[] | ||
) |
Set command line arguments.
rArgc | Number of arguments |
rpArgv | Actual arguments |
Definition at line 365 of file main.cpp.
Referenced by ComSwitch(), and main().
|
private |
Set default member variables.
Definition at line 373 of file main.cpp.
References mBadSwitch, mHelp, mInfile1Dimensions, mInfile2Dimensions, mLoud, and restrictToRange.
Referenced by ComSwitch().
|
private |
Write the log file header Program Name - switches Input files.
Definition at line 969 of file main.cpp.
References mArgc, mInfileName1, mInfileName2, mLog, and mpArgv.
Referenced by parseOptions().
|
private |
Definition at line 213 of file main.h.
Referenced by parseValuesFromArguments(), setArguments(), and writeLogHeader().
|
private |
The actual command line arguments.
Definition at line 215 of file main.h.
Referenced by parseOptions(), parseValuesFromArguments(), requiredArgsSet(), and setDefaultVars().
|
private |
Definition at line 237 of file main.h.
Referenced by getComparisonList(), parseValuesFromArguments(), and requiredArgsSet().
|
private |
Definition at line 239 of file main.h.
Referenced by getFieldMappings(), and parseValuesFromArguments().
|
private |
Definition at line 240 of file main.h.
Referenced by getFieldMappings(), and parseValuesFromArguments().
|
private |
Range of region of interest.
Definition at line 222 of file main.h.
Referenced by getConvFactor(), and parseValuesFromArguments().
|
private |
Definition at line 225 of file main.h.
Referenced by getNormVal(), and parseValuesFromArguments().
|
private |
Definition at line 223 of file main.h.
Referenced by getConvFactor(), and parseValuesFromArguments().
|
private |
Definition at line 226 of file main.h.
Referenced by getNormVal(), and parseValuesFromArguments().
|
private |
Help flag is set from command line options.
Definition at line 211 of file main.h.
Referenced by parseOptions(), parseValuesFromArguments(), and setDefaultVars().
|
private |
Definition at line 242 of file main.h.
Referenced by getIndexOrder(), and parseValuesFromArguments().
|
private |
Definition at line 243 of file main.h.
Referenced by getIndexOrder(), and parseValuesFromArguments().
|
private |
Definition at line 234 of file main.h.
Referenced by getInputFile(), initializeFileStreams(), requiredArgsSet(), and ~ComSwitch().
|
private |
Bad command line switch detection.
Definition at line 216 of file main.h.
Referenced by getFileDimensions(), parseValuesFromArguments(), requiredArgsSet(), and setDefaultVars().
|
private |
Definition at line 235 of file main.h.
Referenced by getInputFile(), initializeFileStreams(), requiredArgsSet(), and ~ComSwitch().
|
private |
Infile 1 independent variable dimensions.
Definition at line 217 of file main.h.
Referenced by getFileDimensions(), parseValuesFromArguments(), requiredArgsSet(), and setDefaultVars().
|
private |
Definition at line 231 of file main.h.
Referenced by getFileName(), initializeFileStreams(), parseValuesFromArguments(), and writeLogHeader().
|
private |
Definition at line 232 of file main.h.
Referenced by getFileName(), initializeFileStreams(), parseValuesFromArguments(), and writeLogHeader().
|
private |
Definition at line 228 of file main.h.
Referenced by getLogFile(), initializeFileStreams(), requiredArgsSet(), writeLogHeader(), and ~ComSwitch().
|
private |
Definition at line 245 of file main.h.
Referenced by getVerbosity(), parseValuesFromArguments(), and setDefaultVars().
|
private |
Definition at line 229 of file main.h.
Referenced by getOutPrefix(), initializeFileStreams(), parseValuesFromArguments(), and requiredArgsSet().
|
private |
Number of arguments.
Definition at line 214 of file main.h.
Referenced by parseValuesFromArguments(), setArguments(), and writeLogHeader().
|
private |
Flag used to indicate if the metrics will be restricted to a given range.
Definition at line 220 of file main.h.
Referenced by parseValuesFromArguments().
|
private |
Infile 2 independent variable dimensions.
Definition at line 219 of file main.h.
Referenced by parseValuesFromArguments(), and setDefaultVars().