A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
omnet-data-output.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 Drexel University
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Joe Kopena (tjkopena@cs.drexel.edu)
7 */
8
9#ifndef OMNET_DATA_OUTPUT_H
10#define OMNET_DATA_OUTPUT_H
11
13
14#include "ns3/nstime.h"
15
16namespace ns3
17{
18
19//------------------------------------------------------------
20//--------------------------------------------
21/**
22 * \ingroup dataoutput
23 * \class OmnetDataOutput
24 * \brief Outputs data in a format compatible with OMNeT library and framework
25 *
26 */
28{
29 public:
31 ~OmnetDataOutput() override;
32
33 /**
34 * Register this type.
35 * \return The TypeId.
36 */
37 static TypeId GetTypeId();
38
39 void Output(DataCollector& dc) override;
40
41 protected:
42 void DoDispose() override;
43
44 private:
45 /**
46 * \ingroup dataoutput
47 *
48 * \brief Class to generate OMNeT output
49 */
51 {
52 public:
53 /**
54 * Constructor
55 * \param scalar the output stream
56 */
57 OmnetOutputCallback(std::ostream* scalar);
58
59 /**
60 * \brief Generates data statistics
61 * \param context the output context
62 * \param name the output name
63 * \param statSum the stats to print
64 */
65 void OutputStatistic(std::string context,
66 std::string name,
67 const StatisticalSummary* statSum) override;
68
69 /**
70 * \brief Generates a single data output
71 * \param context the output context
72 * \param name the output name
73 * \param val the value
74 */
75 void OutputSingleton(std::string context, std::string name, int val) override;
76
77 /**
78 * \brief Generates a single data output
79 * \param context the output context
80 * \param name the output name
81 * \param val the value
82 */
83 void OutputSingleton(std::string context, std::string name, uint32_t val) override;
84
85 /**
86 * \brief Generates a single data output
87 * \param context the output context
88 * \param name the output name
89 * \param val the value
90 */
91 void OutputSingleton(std::string context, std::string name, double val) override;
92
93 /**
94 * \brief Generates a single data output
95 * \param context the output context
96 * \param name the output name
97 * \param val the value
98 */
99 void OutputSingleton(std::string context, std::string name, std::string val) override;
100
101 /**
102 * \brief Generates a single data output
103 * \param context the output context
104 * \param name the output name
105 * \param val the value
106 */
107 void OutputSingleton(std::string context, std::string name, Time val) override;
108
109 private:
110 std::ostream* m_scalar; //!< output stream
111 // end class OmnetOutputCallback
112 };
113
114 // end class OmnetDataOutput
115};
116
117// end namespace ns3
118}; // namespace ns3
119
120#endif /* OMNET_DATA_OUTPUT_H */
Collects data.
Callback class for the DataOutput classes.
Abstract Data Output Interface class s.
Class to generate OMNeT output.
OmnetOutputCallback(std::ostream *scalar)
Constructor.
void OutputSingleton(std::string context, std::string name, int val) override
Generates a single data output.
void OutputStatistic(std::string context, std::string name, const StatisticalSummary *statSum) override
Generates data statistics.
Outputs data in a format compatible with OMNeT library and framework.
void DoDispose() override
Destructor implementation.
void Output(DataCollector &dc) override
Outputs information from the provided DataCollector.
static TypeId GetTypeId()
Register this type.
Abstract class for calculating statistical data.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.