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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mitch Watrous (watrous@u.washington.edu)
7
*/
8
9
#ifndef TIME_SERIES_ADAPTOR_H
10
#define TIME_SERIES_ADAPTOR_H
11
12
#include "
data-collection-object.h
"
13
14
#include "ns3/object.h"
15
#include "ns3/traced-value.h"
16
#include "ns3/type-id.h"
17
18
namespace
ns3
19
{
20
21
/**
22
* \ingroup aggregator
23
*
24
* \brief Takes probed values of different types and outputs the
25
* current time plus the value with both converted to doubles.
26
*
27
* The role of the TimeSeriesAdaptor class is that of an adaptor
28
* class, to take raw-valued probe data of different types, and output
29
* a tuple of two double values. The first is a timestamp which may
30
* be set to different resolutions (e.g. Seconds, Milliseconds, etc.)
31
* in the future, but which presently is hardcoded to Seconds. The second
32
* is the conversion of
33
* a non-double value to a double value (possibly with loss of precision).
34
*
35
* It should be noted that time series adaptors convert
36
* Simulation Time objects to double values in its output.
37
*/
38
class
TimeSeriesAdaptor
:
public
DataCollectionObject
39
{
40
public
:
41
/**
42
* \brief Get the type ID.
43
* \return the object TypeId
44
*/
45
static
TypeId
GetTypeId
();
46
47
TimeSeriesAdaptor
();
48
~TimeSeriesAdaptor
()
override
;
49
50
/**
51
* \brief Trace sink for receiving data from double valued trace
52
* sources.
53
* \param oldData the original value.
54
* \param newData the new value.
55
*
56
* This method serves as a trace sink to double valued trace
57
* sources.
58
*/
59
void
TraceSinkDouble
(
double
oldData,
double
newData);
60
61
/**
62
* \brief Trace sink for receiving data from bool 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 bool valued trace
68
* sources.
69
*/
70
void
TraceSinkBoolean
(
bool
oldData,
bool
newData);
71
72
/**
73
* \brief Trace sink for receiving data from uint8_t 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 uint8_t valued trace
79
* sources.
80
*/
81
void
TraceSinkUinteger8
(uint8_t oldData, uint8_t newData);
82
83
/**
84
* \brief Trace sink for receiving data from uint16_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 uint16_t valued trace
90
* sources.
91
*/
92
void
TraceSinkUinteger16
(uint16_t oldData, uint16_t newData);
93
94
/**
95
* \brief Trace sink for receiving data from uint32_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 uint32_t valued trace
101
* sources.
102
*/
103
void
TraceSinkUinteger32
(
uint32_t
oldData,
uint32_t
newData);
104
105
/**
106
* TracedCallback signature for output trace.
107
*
108
* \param [in] now The current time, in seconds.
109
* \param [in] data The new data value.
110
*/
111
typedef
void (*
OutputTracedCallback
)(
const
double
now,
const
double
data
);
112
113
private
:
114
TracedCallback<double, double>
m_output
;
//!< output trace
115
};
116
117
}
// namespace ns3
118
119
#endif
// TIME_SERIES_ADAPTOR_H
ns3::DataCollectionObject
Base class for data collection framework objects.
Definition
data-collection-object.h:28
ns3::TimeSeriesAdaptor
Takes probed values of different types and outputs the current time plus the value with both converte...
Definition
time-series-adaptor.h:39
ns3::TimeSeriesAdaptor::TimeSeriesAdaptor
TimeSeriesAdaptor()
Definition
time-series-adaptor.cc:41
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:77
ns3::TimeSeriesAdaptor::TraceSinkDouble
void TraceSinkDouble(double oldData, double newData)
Trace sink for receiving data from double valued trace sources.
Definition
time-series-adaptor.cc:52
ns3::TimeSeriesAdaptor::m_output
TracedCallback< double, double > m_output
output trace
Definition
time-series-adaptor.h:114
ns3::TimeSeriesAdaptor::TraceSinkBoolean
void TraceSinkBoolean(bool oldData, bool newData)
Trace sink for receiving data from bool valued trace sources.
Definition
time-series-adaptor.cc:68
ns3::TimeSeriesAdaptor::~TimeSeriesAdaptor
~TimeSeriesAdaptor() override
Definition
time-series-adaptor.cc:46
ns3::TimeSeriesAdaptor::OutputTracedCallback
void(* OutputTracedCallback)(const double now, const double data)
TracedCallback signature for output trace.
Definition
time-series-adaptor.h:111
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:95
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:86
ns3::TimeSeriesAdaptor::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
time-series-adaptor.cc:27
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition
traced-callback.h:43
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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:41
src
stats
model
time-series-adaptor.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0