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 * 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
13
14#include "ns3/nstime.h"
15
16struct sqlite3_stmt;
17
18namespace ns3
19{
20
21class SQLiteOutput;
22
23//------------------------------------------------------------
24//--------------------------------------------
25/**
26 * \ingroup dataoutput
27 * \class SqliteDataOutput
28 * \brief Outputs data in a format compatible with SQLite
29 */
31{
32 public:
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 */
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:
117 std::string m_runLabel; //!< Run label
118
119 /// Pointer to a Sqlite3 singleton statement
121 };
122
124};
125
126// end namespace ns3
127} // namespace ns3
128
129#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.
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.
SqliteOutputCallback(const Ptr< SQLiteOutput > &db, std::string run)
Constructor.
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:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.