A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
data-output-interface.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 DATA_OUTPUT_INTERFACE_H
22 #define DATA_OUTPUT_INTERFACE_H
23 
24 #include "ns3/object.h"
25 #include "ns3/nstime.h"
26 #include "ns3/data-calculator.h"
27 
28 namespace ns3 {
29 
30 class DataCollector;
31 
32 //------------------------------------------------------------
33 //--------------------------------------------
39 class DataOutputInterface : public Object {
40 public:
42  virtual ~DataOutputInterface();
43 
48  virtual void Output (DataCollector &dc) = 0;
49 
54  void SetFilePrefix (const std::string prefix);
59  std::string GetFilePrefix () const;
60 
61 protected:
62  virtual void DoDispose ();
63 
64  std::string m_filePrefix;
65 
66  // end class DataOutputInterface
67 };
68 
76 public:
80  virtual ~DataOutputCallback() {}
81 
88  virtual void OutputStatistic (std::string key,
89  std::string variable,
90  const StatisticalSummary *statSum) = 0;
91 
98  virtual void OutputSingleton (std::string key,
99  std::string variable,
100  int val) = 0;
101 
108  virtual void OutputSingleton (std::string key,
109  std::string variable,
110  uint32_t val) = 0;
111 
118  virtual void OutputSingleton (std::string key,
119  std::string variable,
120  double val) = 0;
121 
128  virtual void OutputSingleton (std::string key,
129  std::string variable,
130  std::string val) = 0;
131 
138  virtual void OutputSingleton (std::string key,
139  std::string variable,
140  Time val) = 0;
141  // end class DataOutputCallback
142 };
143 
144 // end namespace ns3
145 };
146 
147 
148 #endif /* DATA_OUTPUT_INTERFACE_H */
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
Abstract Data Output Interface class s.
virtual void Output(DataCollector &dc)=0
Outputs information from the provided DataCollector.
Abstract class for calculating statistical data.
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::string m_filePrefix
File prefix for the DataOutputInterface.
Callback class for the DataOutput classes.
void SetFilePrefix(const std::string prefix)
Sets the DataOutputInterface prefix to the provided prefix.
Collects data.
virtual ~DataOutputCallback()
Destructor.
a base class which provides memory management and object aggregation
Definition: object.h:63
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, int val)=0
Associates the integer value with the variable name for a specific output format. ...
std::string GetFilePrefix() const
Gets the file prefix of the DataOutputInterface.