A Discrete-Event Network Simulator
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
13
14#include "ns3/object.h"
15#include "ns3/traced-value.h"
16#include "ns3/type-id.h"
17
18namespace 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 */
39{
40 public:
41 /**
42 * \brief Get the type ID.
43 * \return the object TypeId
44 */
45 static TypeId GetTypeId();
46
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:
115};
116
117} // namespace ns3
118
119#endif // TIME_SERIES_ADAPTOR_H
Base class for data collection framework objects.
Takes probed values of different types and outputs the current time plus the value with both converte...
void TraceSinkUinteger8(uint8_t oldData, uint8_t newData)
Trace sink for receiving data from uint8_t valued trace sources.
void TraceSinkDouble(double oldData, double newData)
Trace sink for receiving data from double valued trace sources.
TracedCallback< double, double > m_output
output trace
void TraceSinkBoolean(bool oldData, bool newData)
Trace sink for receiving data from bool valued trace sources.
void(* OutputTracedCallback)(const double now, const double data)
TracedCallback signature for output trace.
void TraceSinkUinteger32(uint32_t oldData, uint32_t newData)
Trace sink for receiving data from uint32_t valued trace sources.
void TraceSinkUinteger16(uint16_t oldData, uint16_t newData)
Trace sink for receiving data from uint16_t valued trace sources.
static TypeId GetTypeId()
Get the type ID.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t data[writeSize]