Go to the documentation of this file.00001
00002
00003
00004 #ifndef resultsTable_hh
00005 #define resultsTable_hh
00006
00007 #include <map>
00008 #include <string>
00009 #include "basics/outputOperator.hh"
00010 #include "inputOutput.hh"
00011
00012 namespace concepts {
00013
00014
00015
00021 class ResultsTable : public OutputOperator {
00022 public:
00023 enum tableTypes { SCREEN, GNUPLOT, HTML };
00027 template<enum tableTypes t>
00028 struct tableDelimTraits {};
00029
00031 enum mapTypes { DOUBLE, STRING, INT, BOOL };
00032
00034 ResultsTable();
00035 ~ResultsTable();
00036
00038 void addMap(enum mapTypes type, const char* name,
00039 const InOutParameters& holder);
00040
00041 template<enum tableTypes t>
00042 void print(std::ostream& os) const;
00043
00044 template<enum tableTypes t>
00045 void print(std::ostream& os, enum mapTypes typeL, const char* nameL) const;
00046 protected:
00047 virtual std::ostream& info(std::ostream& os) const;
00048 private:
00049 std::map<const char*, const std::map<int, double>*, ltstr> doubleMaps_;
00050 std::map<const char*,
00051 const std::map<int, std::string>*, ltstr> stringMaps_;
00052 std::map<const char*, const std::map<int, int>*, ltstr> intMaps_;
00053 std::map<const char*, const std::map<int, bool>*, ltstr> boolMaps_;
00054 bool leader_;
00055 enum mapTypes typeL_;
00056 char* nameL_;
00057 template<enum tableTypes t>
00058 void headline_(std::ostream& os) const;
00059 template<enum tableTypes t>
00060 void tableline_(std::ostream& os, const int idx) const;
00061 };
00062
00063 }
00064
00065 #endif // resultsTable_hh