A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Joe Kopena (tjkopena@cs.drexel.edu)
7
*/
8
9
#ifndef SQLITE_DATA_OUTPUT_H
10
#define SQLITE_DATA_OUTPUT_H
11
12
#include "
data-output-interface.h
"
13
14
#include "ns3/nstime.h"
15
16
struct
sqlite3_stmt;
17
18
namespace
ns3
19
{
20
21
class
SQLiteOutput;
22
23
//------------------------------------------------------------
24
//--------------------------------------------
25
/**
26
* \ingroup dataoutput
27
* \class SqliteDataOutput
28
* \brief Outputs data in a format compatible with SQLite
29
*/
30
class
SqliteDataOutput
:
public
DataOutputInterface
31
{
32
public
:
33
SqliteDataOutput
();
34
~SqliteDataOutput
()
override
;
35
36
/**
37
* Register this type.
38
* \return The TypeId.
39
*/
40
static
TypeId
GetTypeId
();
41
42
void
Output
(
DataCollector
& dc)
override
;
43
44
private
:
45
/**
46
* \ingroup dataoutput
47
*
48
* \brief Class to generate OMNeT output
49
*/
50
class
SqliteOutputCallback
:
public
DataOutputCallback
51
{
52
public
:
53
/**
54
* Constructor
55
* \param db pointer to the instance this object belongs to
56
* \param run experiment descriptor
57
*/
58
SqliteOutputCallback
(
const
Ptr<SQLiteOutput>
& db, std::string run);
59
60
/**
61
* Destructor
62
*/
63
~SqliteOutputCallback
()
override
;
64
65
/**
66
* \brief Generates data statistics
67
* \param key the SQL key to use
68
* \param variable the variable name
69
* \param statSum the stats to print
70
*/
71
void
OutputStatistic
(std::string key,
72
std::string variable,
73
const
StatisticalSummary
* statSum)
override
;
74
75
/**
76
* \brief Generates a single data output
77
* \param key the SQL key to use
78
* \param variable the variable name
79
* \param val the value
80
*/
81
void
OutputSingleton
(std::string key, std::string variable,
int
val)
override
;
82
83
/**
84
* \brief Generates a single data output
85
* \param key the SQL key to use
86
* \param variable the variable name
87
* \param val the value
88
*/
89
void
OutputSingleton
(std::string key, std::string variable,
uint32_t
val)
override
;
90
91
/**
92
* \brief Generates a single data output
93
* \param key the SQL key to use
94
* \param variable the variable name
95
* \param val the value
96
*/
97
void
OutputSingleton
(std::string key, std::string variable,
double
val)
override
;
98
99
/**
100
* \brief Generates a single data output
101
* \param key the SQL key to use
102
* \param variable the variable name
103
* \param val the value
104
*/
105
void
OutputSingleton
(std::string key, std::string variable, std::string val)
override
;
106
107
/**
108
* \brief Generates a single data output
109
* \param key the SQL key to use
110
* \param variable the variable name
111
* \param val the value
112
*/
113
void
OutputSingleton
(std::string key, std::string variable,
Time
val)
override
;
114
115
private
:
116
Ptr<SQLiteOutput>
m_db
;
//!< Db
117
std::string
m_runLabel
;
//!< Run label
118
119
/// Pointer to a Sqlite3 singleton statement
120
sqlite3_stmt*
m_insertSingletonStatement
;
121
};
122
123
Ptr<SQLiteOutput>
m_sqliteOut
;
//!< Database
124
};
125
126
// end namespace ns3
127
}
// namespace ns3
128
129
#endif
/* SQLITE_DATA_OUTPUT_H */
ns3::DataCollector
Collects data.
Definition
data-collector.h:39
ns3::DataOutputCallback
Callback class for the DataOutput classes.
Definition
data-output-interface.h:73
ns3::DataOutputInterface
Abstract Data Output Interface class s.
Definition
data-output-interface.h:30
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SqliteDataOutput::SqliteOutputCallback
Class to generate OMNeT output.
Definition
sqlite-data-output.h:51
ns3::SqliteDataOutput::SqliteOutputCallback::OutputStatistic
void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum) override
Generates data statistics.
Definition
sqlite-data-output.cc:154
ns3::SqliteDataOutput::SqliteOutputCallback::~SqliteOutputCallback
~SqliteOutputCallback() override
Destructor.
Definition
sqlite-data-output.cc:148
ns3::SqliteDataOutput::SqliteOutputCallback::m_insertSingletonStatement
sqlite3_stmt * m_insertSingletonStatement
Pointer to a Sqlite3 singleton statement.
Definition
sqlite-data-output.h:120
ns3::SqliteDataOutput::SqliteOutputCallback::SqliteOutputCallback
SqliteOutputCallback(const Ptr< SQLiteOutput > &db, std::string run)
Constructor.
Definition
sqlite-data-output.cc:131
ns3::SqliteDataOutput::SqliteOutputCallback::m_db
Ptr< SQLiteOutput > m_db
Db.
Definition
sqlite-data-output.h:116
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:184
ns3::SqliteDataOutput::SqliteOutputCallback::m_runLabel
std::string m_runLabel
Run label.
Definition
sqlite-data-output.h:117
ns3::SqliteDataOutput
Outputs data in a format compatible with SQLite.
Definition
sqlite-data-output.h:31
ns3::SqliteDataOutput::Output
void Output(DataCollector &dc) override
Outputs information from the provided DataCollector.
Definition
sqlite-data-output.cc:51
ns3::SqliteDataOutput::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
sqlite-data-output.cc:40
ns3::SqliteDataOutput::m_sqliteOut
Ptr< SQLiteOutput > m_sqliteOut
Database.
Definition
sqlite-data-output.h:123
ns3::SqliteDataOutput::~SqliteDataOutput
~SqliteDataOutput() override
Definition
sqlite-data-output.cc:33
ns3::SqliteDataOutput::SqliteDataOutput
SqliteDataOutput()
Definition
sqlite-data-output.cc:25
ns3::StatisticalSummary
Abstract class for calculating statistical data.
Definition
data-calculator.h:40
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
data-output-interface.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
stats
model
sqlite-data-output.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0