OLD | NEW |
| (Empty) |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | |
2 /* | |
3 * Copyright (c) 2013 University of Washington | |
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: Mitch Watrous (watrous@u.washington.edu) | |
19 */ | |
20 | |
21 #ifndef TIME_SERIES_ADAPTOR_H | |
22 #define TIME_SERIES_ADAPTOR_H | |
23 | |
24 #include "ns3/data-collection-object.h" | |
25 #include "ns3/object.h" | |
26 #include "ns3/type-id.h" | |
27 #include "ns3/traced-value.h" | |
28 | |
29 namespace ns3 { | |
30 | |
31 /** | |
32 * \ingroup aggregator | |
33 * | |
34 * \brief Takes probed values of different types and outputs the | |
35 * current time plus the value with both converted to doubles. | |
36 * | |
37 * The role of the TimeSeriesAdaptor class is that of an adaptor | |
38 * class, to take raw-valued probe data of different types, and output | |
39 * a tuple of two double values. The first is a timestamp which may | |
40 * be set to different resolutions (e.g. Seconds, Milliseconds, etc.) | |
41 * in the future, but which presently is hardcoded to Seconds. The second | |
42 * is the conversion of | |
43 * a non-double value to a double value (possibly with loss of precision). | |
44 * | |
45 * It should be noted that time series adaptors convert | |
46 * Simulation Time objects to double values in its output. | |
47 */ | |
48 class TimeSeriesAdaptor : public DataCollectionObject | |
49 { | |
50 public: | |
51 /** | |
52 * \brief Get the type ID. | |
53 * \return the object TypeId | |
54 */ | |
55 static TypeId GetTypeId (void); | |
56 | |
57 TimeSeriesAdaptor (); | |
58 virtual ~TimeSeriesAdaptor (); | |
59 | |
60 /** | |
61 * \brief Trace sink for receiving data from double valued trace | |
62 * sources. | |
63 * \param oldData the original value. | |
64 * \param newData the new value. | |
65 * | |
66 * This method serves as a trace sink to double valued trace | |
67 * sources. | |
68 */ | |
69 void TraceSinkDouble (double oldData, double newData); | |
70 | |
71 /** | |
72 * \brief Trace sink for receiving data from bool valued trace | |
73 * sources. | |
74 * \param oldData the original value. | |
75 * \param newData the new value. | |
76 * | |
77 * This method serves as a trace sink to bool valued trace | |
78 * sources. | |
79 */ | |
80 void TraceSinkBoolean (bool oldData, bool newData); | |
81 | |
82 /** | |
83 * \brief Trace sink for receiving data from uint8_t valued trace | |
84 * sources. | |
85 * \param oldData the original value. | |
86 * \param newData the new value. | |
87 * | |
88 * This method serves as a trace sink to uint8_t valued trace | |
89 * sources. | |
90 */ | |
91 void TraceSinkUinteger8 (uint8_t oldData, uint8_t newData); | |
92 | |
93 /** | |
94 * \brief Trace sink for receiving data from uint16_t valued trace | |
95 * sources. | |
96 * \param oldData the original value. | |
97 * \param newData the new value. | |
98 * | |
99 * This method serves as a trace sink to uint16_t valued trace | |
100 * sources. | |
101 */ | |
102 void TraceSinkUinteger16 (uint16_t oldData, uint16_t newData); | |
103 | |
104 /** | |
105 * \brief Trace sink for receiving data from uint32_t valued trace | |
106 * sources. | |
107 * \param oldData the original value. | |
108 * \param newData the new value. | |
109 * | |
110 * This method serves as a trace sink to uint32_t valued trace | |
111 * sources. | |
112 */ | |
113 void TraceSinkUinteger32 (uint32_t oldData, uint32_t newData); | |
114 | |
115 /** | |
116 * TracedCallback signature for output trace. | |
117 * | |
118 * \param [in] now The current Time. | |
119 * \param [in] data The new data value. | |
120 */ | |
121 typedef void (* OutputTracedCallback) (const double now, const double data); | |
122 ·· | |
123 private: | |
124 TracedCallback<double, double> m_output; //!< output trace | |
125 }; | |
126 | |
127 } // namespace ns3 | |
128 | |
129 #endif // TIME_SERIES_ADAPTOR_H | |
OLD | NEW |