A Discrete-Event Network Simulator
API
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 "data-calculator.h"
24 
25 #include "ns3/nstime.h"
26 #include "ns3/object.h"
27 
28 namespace ns3
29 {
30 
31 class DataCollector;
32 
33 //------------------------------------------------------------
34 //--------------------------------------------
41 {
42  public:
44  ~DataOutputInterface() override;
45 
50  static TypeId GetTypeId();
51 
56  virtual void Output(DataCollector& dc) = 0;
57 
62  void SetFilePrefix(const std::string prefix);
67  std::string GetFilePrefix() const;
68 
69  protected:
70  void DoDispose() override;
71 
72  std::string m_filePrefix;
73 
74  // end class DataOutputInterface
75 };
76 
84 {
85  public:
90  {
91  }
92 
99  virtual void OutputStatistic(std::string key,
100  std::string variable,
101  const StatisticalSummary* statSum) = 0;
102 
109  virtual void OutputSingleton(std::string key, std::string variable, int val) = 0;
110 
117  virtual void OutputSingleton(std::string key, std::string variable, uint32_t val) = 0;
118 
125  virtual void OutputSingleton(std::string key, std::string variable, double val) = 0;
126 
133  virtual void OutputSingleton(std::string key, std::string variable, std::string val) = 0;
134 
141  virtual void OutputSingleton(std::string key, std::string variable, Time val) = 0;
142  // end class DataOutputCallback
143 };
144 
145 // end namespace ns3
146 }; // namespace ns3
147 
148 #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.