A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
time-series-adaptor.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 University of Washington
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: Mitch Watrous (watrous@u.washington.edu)
18
*/
19
20
#ifndef TIME_SERIES_ADAPTOR_H
21
#define TIME_SERIES_ADAPTOR_H
22
23
#include "
data-collection-object.h
"
24
25
#include "ns3/object.h"
26
#include "ns3/traced-value.h"
27
#include "ns3/type-id.h"
28
29
namespace
ns3
30
{
31
32
/**
33
* \ingroup aggregator
34
*
35
* \brief Takes probed values of different types and outputs the
36
* current time plus the value with both converted to doubles.
37
*
38
* The role of the TimeSeriesAdaptor class is that of an adaptor
39
* class, to take raw-valued probe data of different types, and output
40
* a tuple of two double values. The first is a timestamp which may
41
* be set to different resolutions (e.g. Seconds, Milliseconds, etc.)
42
* in the future, but which presently is hardcoded to Seconds. The second
43
* is the conversion of
44
* a non-double value to a double value (possibly with loss of precision).
45
*
46
* It should be noted that time series adaptors convert
47
* Simulation Time objects to double values in its output.
48
*/
49
class
TimeSeriesAdaptor
:
public
DataCollectionObject
50
{
51
public
:
52
/**
53
* \brief Get the type ID.
54
* \return the object TypeId
55
*/
56
static
TypeId
GetTypeId
();
57
58
TimeSeriesAdaptor
();
59
~TimeSeriesAdaptor
()
override
;
60
61
/**
62
* \brief Trace sink for receiving data from double valued trace
63
* sources.
64
* \param oldData the original value.
65
* \param newData the new value.
66
*
67
* This method serves as a trace sink to double valued trace
68
* sources.
69
*/
70
void
TraceSinkDouble
(
double
oldData,
double
newData);
71
72
/**
73
* \brief Trace sink for receiving data from bool valued trace
74
* sources.
75
* \param oldData the original value.
76
* \param newData the new value.
77
*
78
* This method serves as a trace sink to bool valued trace
79
* sources.
80
*/
81
void
TraceSinkBoolean
(
bool
oldData,
bool
newData);
82
83
/**
84
* \brief Trace sink for receiving data from uint8_t valued trace
85
* sources.
86
* \param oldData the original value.
87
* \param newData the new value.
88
*
89
* This method serves as a trace sink to uint8_t valued trace
90
* sources.
91
*/
92
void
TraceSinkUinteger8
(uint8_t oldData, uint8_t newData);
93
94
/**
95
* \brief Trace sink for receiving data from uint16_t valued trace
96
* sources.
97
* \param oldData the original value.
98
* \param newData the new value.
99
*
100
* This method serves as a trace sink to uint16_t valued trace
101
* sources.
102
*/
103
void
TraceSinkUinteger16
(uint16_t oldData, uint16_t newData);
104
105
/**
106
* \brief Trace sink for receiving data from uint32_t valued trace
107
* sources.
108
* \param oldData the original value.
109
* \param newData the new value.
110
*
111
* This method serves as a trace sink to uint32_t valued trace
112
* sources.
113
*/
114
void
TraceSinkUinteger32
(
uint32_t
oldData,
uint32_t
newData);
115
116
/**
117
* TracedCallback signature for output trace.
118
*
119
* \param [in] now The current time, in seconds.
120
* \param [in] data The new data value.
121
*/
122
typedef
void (*
OutputTracedCallback
)(
const
double
now,
const
double
data
);
123
124
private
:
125
TracedCallback<double, double>
m_output
;
//!< output trace
126
};
127
128
}
// namespace ns3
129
130
#endif
// TIME_SERIES_ADAPTOR_H
ns3::DataCollectionObject
Base class for data collection framework objects.
Definition:
data-collection-object.h:39
ns3::TimeSeriesAdaptor
Takes probed values of different types and outputs the current time plus the value with both converte...
Definition:
time-series-adaptor.h:50
ns3::TimeSeriesAdaptor::TimeSeriesAdaptor
TimeSeriesAdaptor()
Definition:
time-series-adaptor.cc:52
ns3::TimeSeriesAdaptor::TraceSinkUinteger8
void TraceSinkUinteger8(uint8_t oldData, uint8_t newData)
Trace sink for receiving data from uint8_t valued trace sources.
Definition:
time-series-adaptor.cc:88
ns3::TimeSeriesAdaptor::TraceSinkDouble
void TraceSinkDouble(double oldData, double newData)
Trace sink for receiving data from double valued trace sources.
Definition:
time-series-adaptor.cc:63
ns3::TimeSeriesAdaptor::m_output
TracedCallback< double, double > m_output
output trace
Definition:
time-series-adaptor.h:125
ns3::TimeSeriesAdaptor::TraceSinkBoolean
void TraceSinkBoolean(bool oldData, bool newData)
Trace sink for receiving data from bool valued trace sources.
Definition:
time-series-adaptor.cc:79
ns3::TimeSeriesAdaptor::~TimeSeriesAdaptor
~TimeSeriesAdaptor() override
Definition:
time-series-adaptor.cc:57
ns3::TimeSeriesAdaptor::OutputTracedCallback
void(* OutputTracedCallback)(const double now, const double data)
TracedCallback signature for output trace.
Definition:
time-series-adaptor.h:122
ns3::TimeSeriesAdaptor::TraceSinkUinteger32
void TraceSinkUinteger32(uint32_t oldData, uint32_t newData)
Trace sink for receiving data from uint32_t valued trace sources.
Definition:
time-series-adaptor.cc:106
ns3::TimeSeriesAdaptor::TraceSinkUinteger16
void TraceSinkUinteger16(uint16_t oldData, uint16_t newData)
Trace sink for receiving data from uint16_t valued trace sources.
Definition:
time-series-adaptor.cc:97
ns3::TimeSeriesAdaptor::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
time-series-adaptor.cc:38
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:54
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
data-collection-object.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
data
uint8_t data[writeSize]
Definition:
socket-bound-tcp-static-routing.cc:52
src
stats
model
time-series-adaptor.h
Generated on Tue May 28 2024 23:39:30 for ns-3 by
1.9.6