00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __SQLITE_DATA_OUTPUT_H__
00022 #define __SQLITE_DATA_OUTPUT_H__
00023
00024 #include "ns3/nstime.h"
00025
00026 #include "data-output-interface.h"
00027
00028 #define STATS_HAS_SQLITE3
00029
00030 class sqlite3;
00031
00032 namespace ns3 {
00033
00034
00035
00036 class SqliteDataOutput : public DataOutputInterface {
00037 public:
00038 SqliteDataOutput();
00039 virtual ~SqliteDataOutput();
00040
00041 virtual void Output(DataCollector &dc);
00042
00043 void SetDBFile(const std::string file);
00044 std::string GetDBFile() const;
00045
00046 protected:
00047 virtual void DoDispose();
00048
00049 private:
00050 class SqliteOutputCallback : public DataOutputCallback {
00051 public:
00052 SqliteOutputCallback(Ptr<SqliteDataOutput> owner, std::string run);
00053
00054 void OutputSingleton(std::string key,
00055 std::string variable,
00056 int val);
00057
00058 void OutputSingleton(std::string key,
00059 std::string variable,
00060 uint32_t val);
00061
00062 void OutputSingleton(std::string key,
00063 std::string variable,
00064 double val);
00065
00066 void OutputSingleton(std::string key,
00067 std::string variable,
00068 std::string val);
00069
00070 void OutputSingleton(std::string key,
00071 std::string variable,
00072 Time val);
00073
00074 private:
00075 Ptr<SqliteDataOutput> m_owner;
00076 std::string m_runLabel;
00077
00078
00079 };
00080
00081
00082 sqlite3 *m_db;
00083 int Exec(std::string exe);
00084
00085 std::string m_dbFile;
00086
00087 };
00088
00089
00090 };
00091
00092
00093 #endif // __SQLITE_DATA_OUTPUT_H__