libkovan  1
The kovan standard library
datalog.hpp
Go to the documentation of this file.
1 
8 #ifndef _DATALOG_HPP_
9 #define _DATALOG_HPP_
10 
11 #include <string>
12 #include <vector>
13 #include <map>
14 
15 #include "export.h"
16 
17 class DataLog;
18 
26 {
27 public:
31  void append(const std::string& data);
32 
36  void append(const double& data);
37 
38  void remove(const unsigned int& index);
39 
44  const std::vector<std::string>& entries() const;
45 
49  const std::string& name() const;
50 
51  friend class DataLog;
52 private:
53  Category(const std::string& name);
54 
55  std::string m_name;
56  std::vector<std::string> m_entries;
57 };
58 
65 {
66 public:
67  virtual ~DataLogWriter();
68 
69  virtual bool write(const DataLog *dataLog) = 0;
70 };
71 
79 {
80 public:
81  CsvWriter(const std::string& path);
82  virtual bool write(const DataLog *dataLog);
83 
84 private:
85  std::string m_path;
86 };
87 
94 {
95 public:
96  PlainWriter(const std::string& path);
97  virtual bool write(const DataLog *dataLog);
98 private:
99  unsigned int columnWidth(Category *category) const;
100 
101  std::string m_path;
102 };
103 
111 {
112 public:
113  ~DataLog();
119  Category *category(const std::string& name);
120 
125  void removeCategory(const std::string& name);
126 
131  std::vector<Category *> categories() const;
132 
137  bool write(DataLogWriter *writer) const;
138 
142  void clear();
143 private:
144  std::map<std::string, Category *> m_categories;
145 };
146 
147 #endif
Definition: datalog.hpp:110
Definition: datalog.hpp:93
Definition: datalog.hpp:64
Definition: datalog.hpp:25
Definition: datalog.hpp:78
virtual bool write(const DataLog *dataLog)=0
#define EXPORT_SYM
Definition: export.h:7