#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/tokenizer.hpp>
#include <boost/program_options.hpp>
#include <stdair/stdair_basic_types.hpp>
#include <stdair/basic/BasConst_General.hpp>
#include <stdair/basic/BasDBParams.hpp>
#include <stdair/basic/BasLogParams.hpp>
#include <trademgen/TRADEMGEN_Service.hpp>
#include <trademgen/config/trademgen-paths.hpp>
Go to the source code of this file.
Typedefs | |
typedef std::vector< std::string > | WordList_T |
Functions | |
const std::string | K_TRADEMGEN_DEFAULT_LOG_FILENAME ("trademgen_with_db.log") |
const std::string | K_TRADEMGEN_DEFAULT_INPUT_FILENAME (STDAIR_SAMPLE_DIR"/demand01.csv") |
const std::string | K_TRADEMGEN_DEFAULT_QUERY_STRING ("my good old query") |
const std::string | K_TRADEMGEN_DEFAULT_DB_USER ("dsim") |
const std::string | K_TRADEMGEN_DEFAULT_DB_PASSWD ("dsim") |
const std::string | K_TRADEMGEN_DEFAULT_DB_DBNAME ("sim_dsim") |
const std::string | K_TRADEMGEN_DEFAULT_DB_HOST ("localhost") |
const std::string | K_TRADEMGEN_DEFAULT_DB_PORT ("3306") |
void | tokeniseStringIntoWordList (const std::string &iPhrase, WordList_T &ioWordList) |
std::string | createStringFromWordList (const WordList_T &iWordList) |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const std::vector< T > &v) |
int | readConfiguration (int argc, char *argv[], bool &ioIsBuiltin, stdair::RandomSeed_T &ioRandomSeed, std::string &ioQueryString, stdair::Filename_T &ioInputFilename, std::string &ioLogFilename, std::string &ioDBUser, std::string &ioDBPasswd, std::string &ioDBHost, std::string &ioDBPort, std::string &ioDBDBName) |
int | main (int argc, char *argv[]) |
Variables | |
const bool | K_TRADEMGEN_DEFAULT_BUILT_IN_INPUT = false |
const stdair::RandomSeed_T | K_TRADEMGEN_DEFAULT_RANDOM_SEED |
const int | K_TRADEMGEN_EARLY_RETURN_STATUS = 99 |
typedef std::vector<std::string> WordList_T |
Definition at line 24 of file trademgen_with_db.cpp.
const std::string K_TRADEMGEN_DEFAULT_LOG_FILENAME | ( | "trademgen_with_db.log" | ) |
Default name and location for the log file.
const std::string K_TRADEMGEN_DEFAULT_INPUT_FILENAME | ( | STDAIR_SAMPLE_DIR"/demand01.csv" | ) |
Default name and location for the (CSV) input file.
const std::string K_TRADEMGEN_DEFAULT_QUERY_STRING | ( | "my good old query" | ) |
Default query string.
Referenced by readConfiguration().
const std::string K_TRADEMGEN_DEFAULT_DB_USER | ( | "dsim" | ) |
Default parameters for the database connection.
Referenced by readConfiguration().
const std::string K_TRADEMGEN_DEFAULT_DB_PASSWD | ( | "dsim" | ) |
Referenced by readConfiguration().
const std::string K_TRADEMGEN_DEFAULT_DB_DBNAME | ( | "sim_dsim" | ) |
Referenced by readConfiguration().
const std::string K_TRADEMGEN_DEFAULT_DB_HOST | ( | "localhost" | ) |
Referenced by readConfiguration().
const std::string K_TRADEMGEN_DEFAULT_DB_PORT | ( | "3306" | ) |
Referenced by readConfiguration().
void tokeniseStringIntoWordList | ( | const std::string & | iPhrase, |
WordList_T & | ioWordList | ||
) |
Definition at line 67 of file trademgen_with_db.cpp.
Referenced by readConfiguration().
std::string createStringFromWordList | ( | const WordList_T & | iWordList | ) |
Definition at line 89 of file trademgen_with_db.cpp.
Referenced by readConfiguration().
std::ostream& operator<< | ( | std::ostream & | os, |
const std::vector< T > & | v | ||
) |
Definition at line 108 of file trademgen_with_db.cpp.
int readConfiguration | ( | int | argc, |
char * | argv[], | ||
bool & | ioIsBuiltin, | ||
stdair::RandomSeed_T & | ioRandomSeed, | ||
std::string & | ioQueryString, | ||
stdair::Filename_T & | ioInputFilename, | ||
std::string & | ioLogFilename, | ||
std::string & | ioDBUser, | ||
std::string & | ioDBPasswd, | ||
std::string & | ioDBHost, | ||
std::string & | ioDBPort, | ||
std::string & | ioDBDBName | ||
) |
Read and parse the command line options.
Definition at line 118 of file trademgen_with_db.cpp.
References createStringFromWordList(), K_TRADEMGEN_DEFAULT_BUILT_IN_INPUT, K_TRADEMGEN_DEFAULT_DB_DBNAME(), K_TRADEMGEN_DEFAULT_DB_HOST(), K_TRADEMGEN_DEFAULT_DB_PASSWD(), K_TRADEMGEN_DEFAULT_DB_PORT(), K_TRADEMGEN_DEFAULT_DB_USER(), K_TRADEMGEN_DEFAULT_INPUT_FILENAME(), K_TRADEMGEN_DEFAULT_LOG_FILENAME(), K_TRADEMGEN_DEFAULT_QUERY_STRING(), K_TRADEMGEN_DEFAULT_RANDOM_SEED, K_TRADEMGEN_EARLY_RETURN_STATUS, and tokeniseStringIntoWordList().
int main | ( | int | argc, |
char * | argv[] | ||
) |
const bool K_TRADEMGEN_DEFAULT_BUILT_IN_INPUT = false |
Default for the input type. It can be either built-in or provided by an input file. That latter must then be given with the -i option.
Definition at line 43 of file trademgen_with_db.cpp.
const stdair::RandomSeed_T K_TRADEMGEN_DEFAULT_RANDOM_SEED |
Default random generation seed (e.g., 120765987).
Definition at line 48 of file trademgen_with_db.cpp.
const int K_TRADEMGEN_EARLY_RETURN_STATUS = 99 |
Early return status (so that it can be differentiated from an error).
Definition at line 115 of file trademgen_with_db.cpp.