Add missing include
Fixes compilation with gcc 10
Change-Id: I54f0808c7519b8bf1a668f05c4d09d4ca3d3b11f
diff --git a/src/statistics.cpp b/src/statistics.cpp
index f5f5516..2eb6cbe 100644
--- a/src/statistics.cpp
+++ b/src/statistics.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, The University of Memphis,
+/*
+ * Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -28,13 +28,11 @@
size_t
Statistics::get(PacketType type) const
{
- std::map<PacketType,int>::const_iterator it = m_packetCounter.find(type);
- if(it != m_packetCounter.end())
- {
+ auto it = m_packetCounter.find(type);
+ if (it != m_packetCounter.end()) {
return it->second;
}
- else
- {
+ else {
return 0;
}
}
@@ -48,8 +46,7 @@
void
Statistics::resetAll()
{
- for (auto&& it : m_packetCounter )
- {
+ for (auto& it : m_packetCounter) {
it.second = 0;
}
}
diff --git a/src/statistics.hpp b/src/statistics.hpp
index 435938f..c93b93b 100644
--- a/src/statistics.hpp
+++ b/src/statistics.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, The University of Memphis,
+/*
+ * Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -23,12 +23,12 @@
#define NLSR_STATISTICS_HPP
#include <map>
+#include <ostream>
namespace nlsr {
class Statistics
{
-
public:
enum class PacketType {
SENT_HELLO_INTEREST,
@@ -57,10 +57,10 @@
get(PacketType) const;
void
- resetAll();
+ increment(PacketType);
void
- increment(PacketType);
+ resetAll();
const std::map<PacketType,int>&
getCounter() const
@@ -69,7 +69,7 @@
}
private:
- std::map<PacketType,int> m_packetCounter;
+ std::map<PacketType, int> m_packetCounter;
};
std::ostream&