A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sqlite-data-output.h
Go to the documentation of this file.
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 //--------------------------------------------
42 public:
44  virtual ~SqliteDataOutput();
45 
50  static TypeId GetTypeId (void);
51 
52  virtual void Output (DataCollector &dc);
53 
54 protected:
55  virtual void DoDispose ();
56 
57 private:
64 public:
70  SqliteOutputCallback(Ptr<SqliteDataOutput> owner, std::string run);
71 
78  void OutputStatistic (std::string key,
79  std::string variable,
80  const StatisticalSummary *statSum);
81 
88  void OutputSingleton (std::string key,
89  std::string variable,
90  int val);
91 
98  void OutputSingleton (std::string key,
99  std::string variable,
100  uint32_t val);
101 
108  void OutputSingleton (std::string key,
109  std::string variable,
110  double val);
111 
118  void OutputSingleton (std::string key,
119  std::string variable,
120  std::string val);
121 
128  void OutputSingleton (std::string key,
129  std::string variable,
130  Time val);
131 
132 private:
134  std::string m_runLabel;
135 
136  // end class SqliteOutputCallback
137  };
138 
139 
140  sqlite3 *m_db;
141 
147  int Exec (std::string exe);
148 
149  // end class SqliteDataOutput
150 };
151 
152 // end namespace ns3
153 };
154 
155 
156 #endif /* SQLITE_DATA_OUTPUT_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Ptr< SqliteDataOutput > m_owner
the instance this object belongs to
Abstract Data Output Interface class s.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Abstract class for calculating statistical data.
Class to generate OMNeT output.
SqliteOutputCallback(Ptr< SqliteDataOutput > owner, std::string run)
Constructor.
Outputs data in a format compatible with SQLite.
Callback class for the DataOutput classes.
static TypeId GetTypeId(void)
Register this type.
void OutputSingleton(std::string key, std::string variable, int val)
Generates a single data output.
Collects data.
virtual void DoDispose()
Destructor implementation.
sqlite3 * m_db
pointer to the SQL database
void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum)
Generates data statistics.
int Exec(std::string exe)
Execute a sqlite3 query.
virtual void Output(DataCollector &dc)
Outputs information from the provided DataCollector.
a unique identifier for an interface.
Definition: type-id.h:58