A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
stats
model
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
#include <sqlite3.h>
31
32
namespace
ns3
{
33
34
//------------------------------------------------------------
35
//--------------------------------------------
41
class
SqliteDataOutput
:
public
DataOutputInterface
{
42
public
:
43
SqliteDataOutput
();
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
:
63
class
SqliteOutputCallback
:
public
DataOutputCallback
{
64
public
:
70
SqliteOutputCallback
(
Ptr<SqliteDataOutput>
owner, std::string run);
71
75
~SqliteOutputCallback
();
76
83
void
OutputStatistic
(std::string key,
84
std::string
variable
,
85
const
StatisticalSummary
*statSum);
86
93
void
OutputSingleton
(std::string key,
94
std::string
variable
,
95
int
val);
96
103
void
OutputSingleton
(std::string key,
104
std::string
variable
,
105
uint32_t val);
106
113
void
OutputSingleton
(std::string key,
114
std::string
variable
,
115
double
val);
116
123
void
OutputSingleton
(std::string key,
124
std::string
variable
,
125
std::string val);
126
133
void
OutputSingleton
(std::string key,
134
std::string
variable
,
135
Time
val);
136
137
private
:
138
Ptr<SqliteDataOutput>
m_owner
;
139
std::string
m_runLabel
;
140
sqlite3_stmt *
m_insertSingletonStatement
;
141
142
// end class SqliteOutputCallback
143
};
144
145
146
sqlite3 *
m_db
;
147
153
int
Exec
(std::string exe);
154
155
// end class SqliteDataOutput
156
};
157
158
// end namespace ns3
159
};
160
161
162
#endif
/* SQLITE_DATA_OUTPUT_H */
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::SqliteDataOutput::SqliteOutputCallback::m_owner
Ptr< SqliteDataOutput > m_owner
the instance this object belongs to
Definition:
sqlite-data-output.h:138
ns3::DataOutputInterface
Abstract Data Output Interface class s
Definition:
data-output-interface.h:39
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::SqliteDataOutput::~SqliteDataOutput
virtual ~SqliteDataOutput()
Definition:
sqlite-data-output.cc:44
ns3::StatisticalSummary
Abstract class for calculating statistical data.
Definition:
data-calculator.h:46
ns3::SqliteDataOutput::SqliteOutputCallback::m_insertSingletonStatement
sqlite3_stmt * m_insertSingletonStatement
Prepared singleton insert statement.
Definition:
sqlite-data-output.h:140
ns3::SqliteDataOutput::SqliteOutputCallback
Class to generate OMNeT output.
Definition:
sqlite-data-output.h:63
anonymous_namespace{print-introspected-doxygen.cc}::variable
std::string variable
variable or class member
Definition:
print-introspected-doxygen.cc:86
ns3::SqliteDataOutput::SqliteOutputCallback::~SqliteOutputCallback
~SqliteOutputCallback()
Destructor.
Definition:
sqlite-data-output.cc:208
ns3::SqliteDataOutput::SqliteOutputCallback::SqliteOutputCallback
SqliteOutputCallback(Ptr< SqliteDataOutput > owner, std::string run)
Constructor.
Definition:
sqlite-data-output.cc:189
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::SqliteDataOutput::SqliteOutputCallback::m_runLabel
std::string m_runLabel
Run label.
Definition:
sqlite-data-output.h:139
ns3::SqliteDataOutput::SqliteDataOutput
SqliteDataOutput()
Definition:
sqlite-data-output.cc:38
ns3::SqliteDataOutput
Outputs data in a format compatible with SQLite.
Definition:
sqlite-data-output.h:41
ns3::DataOutputCallback
Callback class for the DataOutput classes.
Definition:
data-output-interface.h:81
data-output-interface.h
ns3::SqliteDataOutput::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition:
sqlite-data-output.cc:50
ns3::SqliteDataOutput::SqliteOutputCallback::OutputSingleton
void OutputSingleton(std::string key, std::string variable, int val)
Generates a single data output.
Definition:
sqlite-data-output.cc:235
ns3::DataCollector
Collects data.
Definition:
data-collector.h:49
ns3::SqliteDataOutput::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition:
sqlite-data-output.cc:60
ns3::SqliteDataOutput::m_db
sqlite3 * m_db
pointer to the SQL database
Definition:
sqlite-data-output.h:146
ns3::SqliteDataOutput::SqliteOutputCallback::OutputStatistic
void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum)
Generates data statistics.
Definition:
sqlite-data-output.cc:214
ns3::SqliteDataOutput::Exec
int Exec(std::string exe)
Execute a sqlite3 query.
Definition:
sqlite-data-output.cc:69
ns3::SqliteDataOutput::Output
virtual void Output(DataCollector &dc)
Outputs information from the provided DataCollector.
Definition:
sqlite-data-output.cc:115
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
Generated on Wed Nov 7 2018 10:02:10 for ns-3 by
1.8.14