stats: allow cleaning the content of an histogram
This commit is contained in:
@@ -24,6 +24,7 @@ Changes from ns-3.38 to ns-3-dev
|
||||
* (network) Added `Mac16Address::Mac16Address(uint16t addr)` and `Mac16Address::Mac64Address(uint64t addr)` constructors.
|
||||
* (lr-wpan) Added `LrwpanMac::MlmeGetRequest` function and the corresponding confirm callbacks as well as `LrwpanMac::SetMlmeGetConfirm` function.
|
||||
* (applications) Added `Tx` and `TxWithAddresses` trace sources in `UdpClient`.
|
||||
* (stats) Added `Histogram::Clear` function to clear the histogram contents.
|
||||
|
||||
### Changes to existing API
|
||||
|
||||
|
||||
@@ -92,6 +92,12 @@ Histogram::AddValue(double value)
|
||||
m_histogram[index]++;
|
||||
}
|
||||
|
||||
void
|
||||
Histogram::Clear()
|
||||
{
|
||||
m_histogram.clear();
|
||||
}
|
||||
|
||||
Histogram::Histogram(double binWidth)
|
||||
{
|
||||
m_binWidth = binWidth;
|
||||
|
||||
@@ -102,6 +102,11 @@ class Histogram
|
||||
*/
|
||||
void AddValue(double value);
|
||||
|
||||
/**
|
||||
* Clear the histogram content.
|
||||
*/
|
||||
void Clear();
|
||||
|
||||
/**
|
||||
* \brief Serializes the results to an std::ostream in XML format.
|
||||
* \param os the output stream
|
||||
|
||||
Reference in New Issue
Block a user