A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
data-output-interface.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 DATA_OUTPUT_INTERFACE_H
21#define DATA_OUTPUT_INTERFACE_H
22
23#include "ns3/data-calculator.h"
24#include "ns3/nstime.h"
25#include "ns3/object.h"
26
27namespace ns3
28{
29
30class DataCollector;
31
32//------------------------------------------------------------
33//--------------------------------------------
40{
41 public:
43 ~DataOutputInterface() override;
44
49 static TypeId GetTypeId();
50
55 virtual void Output(DataCollector& dc) = 0;
56
61 void SetFilePrefix(const std::string prefix);
66 std::string GetFilePrefix() const;
67
68 protected:
69 void DoDispose() override;
70
71 std::string m_filePrefix;
72
73 // end class DataOutputInterface
74};
75
83{
84 public:
89 {
90 }
91
98 virtual void OutputStatistic(std::string key,
99 std::string variable,
100 const StatisticalSummary* statSum) = 0;
101
108 virtual void OutputSingleton(std::string key, std::string variable, int val) = 0;
109
116 virtual void OutputSingleton(std::string key, std::string variable, uint32_t val) = 0;
117
124 virtual void OutputSingleton(std::string key, std::string variable, double val) = 0;
125
132 virtual void OutputSingleton(std::string key, std::string variable, std::string val) = 0;
133
140 virtual void OutputSingleton(std::string key, std::string variable, Time val) = 0;
141 // end class DataOutputCallback
142};
143
144// end namespace ns3
145}; // namespace ns3
146
147#endif /* DATA_OUTPUT_INTERFACE_H */
Collects data.
Callback class for the DataOutput classes.
virtual void OutputSingleton(std::string key, std::string variable, uint32_t val)=0
Associates the uint32_t value with the variable name for a specific output format.
virtual ~DataOutputCallback()
Destructor.
virtual void OutputSingleton(std::string key, std::string variable, std::string val)=0
Associates the string value with the variable name for a specific output format.
virtual void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum)=0
Outputs the data from the specified StatisticalSummary.
virtual void OutputSingleton(std::string key, std::string variable, Time val)=0
Associates the Time value with the variable name for a specific output format.
virtual void OutputSingleton(std::string key, std::string variable, double val)=0
Associates the double value with the variable name for a specific output format.
virtual void OutputSingleton(std::string key, std::string variable, int val)=0
Associates the integer value with the variable name for a specific output format.
Abstract Data Output Interface class s.
void DoDispose() override
Destructor implementation.
virtual void Output(DataCollector &dc)=0
Outputs information from the provided DataCollector.
std::string GetFilePrefix() const
Gets the file prefix of the DataOutputInterface.
static TypeId GetTypeId()
Register this type.
std::string m_filePrefix
File prefix for the DataOutputInterface.
void SetFilePrefix(const std::string prefix)
Sets the DataOutputInterface prefix to the provided prefix.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Abstract class for calculating statistical data.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.