A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
time-data-calculators.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 TIME_DATA_CALCULATORS_H
10#define TIME_DATA_CALCULATORS_H
11
12#include "data-calculator.h"
14
15#include "ns3/nstime.h"
16
17namespace ns3
18{
19
20//------------------------------------------------------------
21//--------------------------------------------
22/**
23 * \ingroup stats
24 *
25 * Unfortunately, templating the base MinMaxAvgTotalCalculator to
26 * operate over Time values isn't straightforward. The main issues
27 * are setting the maximum value, which can be worked around easily
28 * as it done here, and dividing to get the average, which is not as
29 * easily worked around.
30 */
32{
33 public:
36
37 /**
38 * Register this type.
39 * \return The TypeId.
40 */
41 static TypeId GetTypeId();
42
43 /**
44 * Updates all variables of TimeMinMaxAvgTotalCalculator
45 * \param i value of type Time to use for updating the calculator
46 */
47 void Update(const Time i);
48
49 /**
50 * Outputs data based on the provided callback
51 * \param callback
52 */
53 void Output(DataOutputCallback& callback) const override;
54
55 protected:
56 void DoDispose() override;
57
58 uint32_t m_count; //!< Count value of TimeMinMaxAvgTotalCalculator
59 Time m_total; //!< Total value of TimeMinMaxAvgTotalCalculator
60 Time m_min; //!< Minimum value of TimeMinMaxAvgTotalCalculator
61 Time m_max; //!< Maximum value of TimeMinMaxAvgTotalCalculator
62
63 // end class TimeMinMaxAvgTotalCalculator
64};
65
66// end namespace ns3
67}; // namespace ns3
68
69#endif /* TIME_DATA_CALCULATORS_H */
Calculates data during a simulation.
Callback class for the DataOutput classes.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Unfortunately, templating the base MinMaxAvgTotalCalculator to operate over Time values isn't straigh...
Time m_total
Total value of TimeMinMaxAvgTotalCalculator.
void Update(const Time i)
Updates all variables of TimeMinMaxAvgTotalCalculator.
void DoDispose() override
Destructor implementation.
void Output(DataOutputCallback &callback) const override
Outputs data based on the provided callback.
static TypeId GetTypeId()
Register this type.
uint32_t m_count
Count value of TimeMinMaxAvgTotalCalculator.
Time m_min
Minimum value of TimeMinMaxAvgTotalCalculator.
Time m_max
Maximum value of TimeMinMaxAvgTotalCalculator.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.