A Discrete-Event Network Simulator
API
qkd-total-graph.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 DOTFEESA www.tk.etf.unsa.ba
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: Miralem Mehic <miralem.mehic@ieee.org>
19  */
20 
21 #ifndef QKD_TOTAL_GRAPH_H
22 #define QKD_TOTAL_GRAPH_H
23 
24 #include <fstream>
25 #include "ns3/object.h"
26 #include "ns3/gnuplot.h"
27 #include "ns3/core-module.h"
28 #include "ns3/node-list.h"
29 #include <sstream>
30 
31 namespace ns3 {
32 
43 class QKDTotalGraph : public Object
44 {
45 public:
46 
51  static TypeId GetTypeId (void);
52 
56  QKDTotalGraph ();
57 
64  std::string graphName,
65  std::string graphType
66  );
67 
71  void Init (
72  std::string graphName,
73  std::string graphType
74  );
75 
79  virtual ~QKDTotalGraph();
80 
84  void PrintGraph ();
85 
91  void ProcessMThr (uint32_t value, char sign);
92 
98  void ProcessMCurrent (uint32_t value, char sign);
99 
100 private:
101 
102  uint32_t m_keymCurrent;
103  uint32_t m_keymThreshold;
104 
105  std::string m_plotFileName;
106  std::string m_plotFileType; //png or svg
108 
112 };
113 }
114 
115 #endif /* QKDTotalGraph */
Class to represent a 2D points plot.
Definition: gnuplot.h:118
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Definition: gnuplot.h:373
A base class which provides memory management and object aggregation.
Definition: object.h:89
QKDTotalGraph is implemented to allow easier access to the state of ALL QKD buffers and easier monito...
double m_simulationTime
time value, x-axis
Gnuplot2dDataset m_dataset
void PrintGraph()
Print the graph.
std::string m_plotFileName
output filename
virtual ~QKDTotalGraph()
Destructor.
static TypeId GetTypeId(void)
Get the type ID.
void ProcessMThr(uint32_t value, char sign)
Mthr value of the QKDBuffer changed, so plot it on the graph.
uint32_t m_keymCurrent
get some boundaries for the graph
void ProcessMCurrent(uint32_t value, char sign)
MCurrent value of the QKDBuffer changed, so plot it on the graph.
void Init(std::string graphName, std::string graphType)
Initialized function used in constructor.
uint32_t m_keymThreshold
get some boundaries for the graph
Gnuplot2dDataset m_datasetThreshold
QKDTotalGraph()
Constructor.
std::string m_plotFileType
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.