mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
log.h
1 /* synonym for population? */
2 
3 #ifndef _LOG_H_
4 #define _LOG_H_
5 
6 #include <iostream>
7 #include <cfloat>
8 #include <iomanip>
9 #include <vector>
10 #include <string>
11 #include <stdio.h>
12 #include <time.h>
13 
14 #include "typedef.h"
15 #include "data.h"
16 #include "stream_tools.h"
17 
19 
21 class Log : public virtual Data {
22 private:
23  void read(std::istream& str);
25  void write(std::ostream& str) const;
26  static const Registration registered;
27  static Data * create(const std::vector <std::string> & Columns){
28  return new Log(Columns);
29  };
30 public:
31  char delim;
32  std::string command;
33  std::string message;
34  time_t time;
35 
36  Log();
37  Log(const std::vector <std::string> &) : Log(){};
38  Log(const std::string &, const float_t &);
39 
40  static const std::string file_name;
41  static const std::string table_name;
42  static const bool binary;
43 
44  const std::string header(void) const;
45  size_t size(void) const;
46 
47  const std::string get_file_name(void) const;
48  const std::string get_table_name(void) const;
49  const bool get_binary(void) const;
50 
51  const std::string sql_header(void) const;
52  const std::string sql_column_names(void) const;
53  const std::string sql_values(void) const;
54 };
55 
57 const std::string format_time(cosnt time_t &);
58 #endif
static const std::string table_name
Destination table in Db.
Definition: log.h:41
static const std::string file_name
The dafualt extention for files.
Definition: log.h:40
const std::string sql_header(void) const
Destination table in Db.
Definition: log.cc:60
const std::string get_table_name(void) const
The dafualt extention for files.
Definition: log.cc:87
const std::string get_file_name(void) const
The dafualt extention for files.
Definition: log.cc:81
A class to store a log of commands that have been run.
Definition: log.h:21
void write(std::ostream &str) const
! the write function must be ? by the child class.
Definition: log.cc:47
const std::string sql_values(void) const
Destination table in Db.
Definition: log.cc:70
const std::string sql_column_names(void) const
Destination table in Db.
Definition: log.cc:65
A class which registers a child of Data in Data::new_data_.
Definition: data.h:222
A class which can be written as flat text file or into an SQL database.
Definition: data.h:34
char delim
the delimiter used when reading/writing the class in text mode.
Definition: log.h:29
size_t size(void) const
The size of the class in bytes.
Definition: log.cc:75
void read(std::istream &str)
The read function must be defined in the child class.
Definition: log.cc:28