A Discrete-Event Network Simulator
API
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
28namespace ns3 {
29
30class DataCollector;
31
32//------------------------------------------------------------
33//--------------------------------------------
40public:
42 virtual ~DataOutputInterface();
43
48 static TypeId GetTypeId (void);
49
54 virtual void Output (DataCollector &dc) = 0;
55
60 void SetFilePrefix (const std::string prefix);
65 std::string GetFilePrefix () const;
66
67protected:
68 virtual void DoDispose ();
69
70 std::string m_filePrefix;
71
72 // end class DataOutputInterface
73};
74
82public:
87
94 virtual void OutputStatistic (std::string key,
95 std::string variable,
96 const StatisticalSummary *statSum) = 0;
97
104 virtual void OutputSingleton (std::string key,
105 std::string variable,
106 int val) = 0;
107
114 virtual void OutputSingleton (std::string key,
115 std::string variable,
116 uint32_t val) = 0;
117
124 virtual void OutputSingleton (std::string key,
125 std::string variable,
126 double val) = 0;
127
134 virtual void OutputSingleton (std::string key,
135 std::string variable,
136 std::string val) = 0;
137
144 virtual void OutputSingleton (std::string key,
145 std::string variable,
146 Time val) = 0;
147 // end class DataOutputCallback
148};
149
150// end namespace ns3
151};
152
153
154#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.
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(void)
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.
virtual void DoDispose()
Destructor implementation.
A base class which provides memory management and object aggregation.
Definition: object.h:88
Abstract class for calculating statistical data.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.