DNWA/11/wywolania/Data/stide_v1.2/config.h
Jakub Stefko ab1d7e2546 ...
2021-01-28 18:33:55 +01:00

73 lines
2.8 KiB
C++

#ifndef __SEQ_CONFIG_H
#define __SEQ_CONFIG_H
#define CFREV 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "opt_info.h"
using std::vector;
using std::ifstream;
class Config {
public:
Config(const int argc, const char *argv[]); // Constructor; reads
// configuration file and command
// line arguments
string cfg_name; // Name of configuration file
string db_name; // Name of database
int seq_len; // Sequence Length
int max_elements; // Maximum number of different
// data elements we may encounter
int max_streams; // Maximum number of different
// streams we may encounter
int pair_offset; // Number by which to offset
// num_pairs_read
string add_output_format; // Format for verbose-mode output
// when adding to database
string compare_output_format; // Format for verbose-mode output
// when comparing with an
// existing database
int lf_size; // Size of locality frames: 1
// effectively means don't
// compute locality frames
int add_to_db; // Flag indicating that we should
// add to the database rather
// than make comparisons
int output_graph; // Output graphing information in
// Dot format
int compute_hdist; // Compute Hamming distance
int write_db_stats; // Write statistics about the
// database
int verbose; // Output information about each
// anomaly or each new sequence
// added to the database
int very_verbose; // Output information about each
// sequence encountered
char fmt_str[10][50]; // String used for outputting
// information in verbose mode
char write_val[7]; // Do we write the value? used
// with fmt_str
int num_fvars; // Number of format variables
void Config::InitOptArray(vector<OptInfo> &opt_array);
void Config::SetDefaults();
void Config::ReadCommandLine(const int argc, const char *argv[],
vector<OptInfo> &opt_array);
void Config::AssignValToVar(vector<OptInfo> &opt_array, const
string &var_val, const string
&var_name, const int name_type);
void Config::ReadConfigFile(vector<OptInfo> &opt_array);
void Config::ReadOldConfigFile(ifstream &cfg_file,
vector<OptInfo> &opt_array);
void Config::InitOutputFormat();
void Config::CheckValues();
void Config::OuputConfigInfo(const vector<OptInfo> &opt_array) const;
void Config::WriteHelpInfo() const;
};
#endif