TraDemGen Logo  1.00.0
C++ Simulated Travel Demand Generation Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
trademgen_with_db.cpp File Reference
#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 Documentation

typedef std::vector<std::string> WordList_T

Definition at line 24 of file trademgen_with_db.cpp.


Function Documentation

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().

template<class T >
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 
)

Variable Documentation

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
Initial value:
stdair::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.