face: LpFace counters
FaceCounters for LpFace consist of LinkService::Counters and
Transport::Counters. Old FaceCounters class from 2014 face architecture is
renamed as OldFaceCounters, and can be wrapped with new FaceCounters class.
OldFaceCounters is only used in old Face subclasses.
This commit also updates existing face test suites to use new FaceCounters,
updates ForwarderStatus so that it does not rely on FaceCounters,
and moves the logic of copying face properties and counters into management
structs from face system into FaceManager.
refs #3177
Change-Id: I587e8a32fa72bac3af9d750b2c88342740aa08d6
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 9c2f2e6..25b7fdf 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -29,6 +29,7 @@
#include "common.hpp"
#include "core/logger.hpp"
#include "face-counters.hpp"
+#include "old-face-counters.hpp"
#include "face-log.hpp"
#include <ndn-cxx/management/nfd-face-status.hpp>
@@ -162,8 +163,7 @@
virtual bool
isUp() const;
- // 'virtual' to allow override in LpFaceWrapper
- virtual const FaceCounters&
+ virtual const face::FaceCounters&
getCounters() const;
/** \return a FaceUri that represents the remote endpoint
@@ -176,17 +176,6 @@
const FaceUri&
getLocalUri() const;
- /** \return FaceTraits data structure filled with the current FaceTraits status
- */
- template<typename FaceTraits>
- void
- copyStatusTo(FaceTraits& traits) const;
-
- /** \return FaceStatus data structure filled with the current Face status
- */
- virtual ndn::nfd::FaceStatus
- getFaceStatus() const;
-
protected:
bool
decodeAndDispatchInput(const Block& element);
@@ -196,7 +185,7 @@
void
fail(const std::string& reason);
- FaceCounters&
+ OldFaceCounters&
getMutableCounters();
DECLARE_SIGNAL_EMIT(onReceiveInterest)
@@ -214,7 +203,8 @@
private:
FaceId m_id;
std::string m_description;
- FaceCounters m_counters;
+ OldFaceCounters m_counters;
+ face::FaceCounters m_countersWrapper;
const FaceUri m_remoteUri;
const FaceUri m_localUri;
const bool m_isLocal;
@@ -274,13 +264,13 @@
return m_isMultiAccess;
}
-inline const FaceCounters&
+inline const face::FaceCounters&
Face::getCounters() const
{
- return m_counters;
+ return m_countersWrapper;
}
-inline FaceCounters&
+inline OldFaceCounters&
Face::getMutableCounters()
{
return m_counters;