A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
sqlite-data-output.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 Drexel University
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Joe Kopena (tjkopena@cs.drexel.edu)
19  */
20 
21 #ifndef SQLITE_DATA_OUTPUT_H
22 #define SQLITE_DATA_OUTPUT_H
23 
24 #include "ns3/nstime.h"
25 
26 #include "data-output-interface.h"
27 
28 #define STATS_HAS_SQLITE3
29 
30 struct sqlite3;
31 
32 namespace ns3 {
33 
34 //------------------------------------------------------------
35 //--------------------------------------------
41 public:
43  virtual ~SqliteDataOutput();
44 
45  virtual void Output (DataCollector &dc);
46 
47 protected:
48  virtual void DoDispose ();
49 
50 private:
52 public:
53  SqliteOutputCallback(Ptr<SqliteDataOutput> owner, std::string run);
54 
55  void OutputStatistic (std::string key,
56  std::string variable,
57  const StatisticalSummary *statSum);
58 
59  void OutputSingleton (std::string key,
60  std::string variable,
61  int val);
62 
63  void OutputSingleton (std::string key,
64  std::string variable,
65  uint32_t val);
66 
67  void OutputSingleton (std::string key,
68  std::string variable,
69  double val);
70 
71  void OutputSingleton (std::string key,
72  std::string variable,
73  std::string val);
74 
75  void OutputSingleton (std::string key,
76  std::string variable,
77  Time val);
78 
79 private:
80  Ptr<SqliteDataOutput> m_owner;
81  std::string m_runLabel;
82 
83  // end class SqliteOutputCallback
84  };
85 
86 
87  sqlite3 *m_db;
88  int Exec (std::string exe);
89 
90  // end class SqliteDataOutput
91 };
92 
93 // end namespace ns3
94 };
95 
96 
97 #endif /* SQLITE_DATA_OUTPUT_H */
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59