A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
23
#include "
data-output-interface.h
"
24
25
#include "ns3/nstime.h"
26
27
struct
sqlite3_stmt;
28
29
namespace
ns3
30
{
31
32
class
SQLiteOutput;
33
34
//------------------------------------------------------------
35
//--------------------------------------------
41
class
SqliteDataOutput
:
public
DataOutputInterface
42
{
43
public
:
44
SqliteDataOutput
();
45
~SqliteDataOutput
()
override
;
46
51
static
TypeId
GetTypeId
();
52
53
void
Output
(
DataCollector
& dc)
override
;
54
55
private
:
61
class
SqliteOutputCallback
:
public
DataOutputCallback
62
{
63
public
:
69
SqliteOutputCallback
(
const
Ptr<SQLiteOutput>
& db, std::string run);
70
74
~SqliteOutputCallback
()
override
;
75
82
void
OutputStatistic
(std::string key,
83
std::string
variable
,
84
const
StatisticalSummary
* statSum)
override
;
85
92
void
OutputSingleton
(std::string key, std::string
variable
,
int
val)
override
;
93
100
void
OutputSingleton
(std::string key, std::string
variable
, uint32_t val)
override
;
101
108
void
OutputSingleton
(std::string key, std::string
variable
,
double
val)
override
;
109
116
void
OutputSingleton
(std::string key, std::string
variable
, std::string val)
override
;
117
124
void
OutputSingleton
(std::string key, std::string
variable
,
Time
val)
override
;
125
126
private
:
127
Ptr<SQLiteOutput>
m_db
;
128
std::string
m_runLabel
;
129
131
sqlite3_stmt*
m_insertSingletonStatement
;
132
};
133
134
Ptr<SQLiteOutput>
m_sqliteOut
;
135
};
136
137
// end namespace ns3
138
}
// namespace ns3
139
140
#endif
/* SQLITE_DATA_OUTPUT_H */
ns3::DataCollector
Collects data.
Definition:
data-collector.h:50
ns3::DataOutputCallback
Callback class for the DataOutput classes.
Definition:
data-output-interface.h:84
ns3::DataOutputInterface
Abstract Data Output Interface class s.
Definition:
data-output-interface.h:41
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SqliteDataOutput::SqliteOutputCallback
Class to generate OMNeT output.
Definition:
sqlite-data-output.h:62
ns3::SqliteDataOutput::SqliteOutputCallback::OutputStatistic
void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum) override
Generates data statistics.
Definition:
sqlite-data-output.cc:165
ns3::SqliteDataOutput::SqliteOutputCallback::~SqliteOutputCallback
~SqliteOutputCallback() override
Destructor.
Definition:
sqlite-data-output.cc:159
ns3::SqliteDataOutput::SqliteOutputCallback::m_insertSingletonStatement
sqlite3_stmt * m_insertSingletonStatement
Pointer to a Sqlite3 singleton statement.
Definition:
sqlite-data-output.h:131
ns3::SqliteDataOutput::SqliteOutputCallback::SqliteOutputCallback
SqliteOutputCallback(const Ptr< SQLiteOutput > &db, std::string run)
Constructor.
Definition:
sqlite-data-output.cc:142
ns3::SqliteDataOutput::SqliteOutputCallback::m_db
Ptr< SQLiteOutput > m_db
Db.
Definition:
sqlite-data-output.h:127
ns3::SqliteDataOutput::SqliteOutputCallback::OutputSingleton
void OutputSingleton(std::string key, std::string variable, int val) override
Generates a single data output.
Definition:
sqlite-data-output.cc:195
ns3::SqliteDataOutput::SqliteOutputCallback::m_runLabel
std::string m_runLabel
Run label.
Definition:
sqlite-data-output.h:128
ns3::SqliteDataOutput
Outputs data in a format compatible with SQLite.
Definition:
sqlite-data-output.h:42
ns3::SqliteDataOutput::Output
void Output(DataCollector &dc) override
Outputs information from the provided DataCollector.
Definition:
sqlite-data-output.cc:62
ns3::SqliteDataOutput::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
sqlite-data-output.cc:51
ns3::SqliteDataOutput::m_sqliteOut
Ptr< SQLiteOutput > m_sqliteOut
Database.
Definition:
sqlite-data-output.h:134
ns3::SqliteDataOutput::~SqliteDataOutput
~SqliteDataOutput() override
Definition:
sqlite-data-output.cc:44
ns3::SqliteDataOutput::SqliteDataOutput
SqliteDataOutput()
Definition:
sqlite-data-output.cc:36
ns3::StatisticalSummary
Abstract class for calculating statistical data.
Definition:
data-calculator.h:51
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
data-output-interface.h
anonymous_namespace{print-introspected-doxygen.cc}::variable
std::string variable
variable or class member
Definition:
print-introspected-doxygen.cc:99
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
stats
model
sqlite-data-output.h
Generated on Sun Mar 3 2024 17:11:08 for ns-3 by
1.9.1