A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
sqlite-data-output.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 Drexel University
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Joe Kopena (tjkopena@cs.drexel.edu)
18 */
19
20#ifndef SQLITE_DATA_OUTPUT_H
21#define SQLITE_DATA_OUTPUT_H
22
24
25#include "ns3/nstime.h"
26
27struct sqlite3_stmt;
28
29namespace ns3
30{
31
32class SQLiteOutput;
33
34//------------------------------------------------------------
35//--------------------------------------------
36/**
37 * \ingroup dataoutput
38 * \class SqliteDataOutput
39 * \brief Outputs data in a format compatible with SQLite
40 */
42{
43 public:
45 ~SqliteDataOutput() override;
46
47 /**
48 * Register this type.
49 * \return The TypeId.
50 */
51 static TypeId GetTypeId();
52
53 void Output(DataCollector& dc) override;
54
55 private:
56 /**
57 * \ingroup dataoutput
58 *
59 * \brief Class to generate OMNeT output
60 */
62 {
63 public:
64 /**
65 * Constructor
66 * \param db pointer to the instance this object belongs to
67 * \param run experiment descriptor
68 */
69 SqliteOutputCallback(const Ptr<SQLiteOutput>& db, std::string run);
70
71 /**
72 * Destructor
73 */
74 ~SqliteOutputCallback() override;
75
76 /**
77 * \brief Generates data statistics
78 * \param key the SQL key to use
79 * \param variable the variable name
80 * \param statSum the stats to print
81 */
82 void OutputStatistic(std::string key,
83 std::string variable,
84 const StatisticalSummary* statSum) override;
85
86 /**
87 * \brief Generates a single data output
88 * \param key the SQL key to use
89 * \param variable the variable name
90 * \param val the value
91 */
92 void OutputSingleton(std::string key, std::string variable, int val) override;
93
94 /**
95 * \brief Generates a single data output
96 * \param key the SQL key to use
97 * \param variable the variable name
98 * \param val the value
99 */
100 void OutputSingleton(std::string key, std::string variable, uint32_t val) override;
101
102 /**
103 * \brief Generates a single data output
104 * \param key the SQL key to use
105 * \param variable the variable name
106 * \param val the value
107 */
108 void OutputSingleton(std::string key, std::string variable, double val) override;
109
110 /**
111 * \brief Generates a single data output
112 * \param key the SQL key to use
113 * \param variable the variable name
114 * \param val the value
115 */
116 void OutputSingleton(std::string key, std::string variable, std::string val) override;
117
118 /**
119 * \brief Generates a single data output
120 * \param key the SQL key to use
121 * \param variable the variable name
122 * \param val the value
123 */
124 void OutputSingleton(std::string key, std::string variable, Time val) override;
125
126 private:
128 std::string m_runLabel; //!< Run label
129
130 /// Pointer to a Sqlite3 singleton statement
132 };
133
135};
136
137// end namespace ns3
138} // namespace ns3
139
140#endif /* SQLITE_DATA_OUTPUT_H */
Collects data.
Callback class for the DataOutput classes.
Abstract Data Output Interface class s.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum) override
Generates data statistics.
sqlite3_stmt * m_insertSingletonStatement
Pointer to a Sqlite3 singleton statement.
void OutputSingleton(std::string key, std::string variable, int val) override
Generates a single data output.
Outputs data in a format compatible with SQLite.
void Output(DataCollector &dc) override
Outputs information from the provided DataCollector.
static TypeId GetTypeId()
Register this type.
Ptr< SQLiteOutput > m_sqliteOut
Database.
Abstract class for calculating statistical data.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.