face: remove awkward Face::setLocal, use a constructor argument instead.
Change-Id: Ic366ecdc83c5771138ff584ffb944a4e17300eb1
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 45cde49..325ad67 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -20,7 +20,7 @@
const FaceId INVALID_FACEID = -1;
-const std::size_t MAX_NDN_PACKET_SIZE = 8800;
+const size_t MAX_NDN_PACKET_SIZE = 8800;
/** \brief represents a face
@@ -36,7 +36,8 @@
Error(const std::string& what) : std::runtime_error(what) {}
};
- Face();
+ explicit
+ Face(bool isLocal = false);
virtual
~Face();
@@ -69,21 +70,6 @@
virtual void
close() = 0;
- /** \brief Get whether underlying communication is up
- *
- * In this base class this property is always true.
- */
- virtual bool
- isUp() const;
-
- /** \brief Get whether face is connected to a local app
- *
- * False by default and can become true if a derived class, implementing
- * one of the local face types, explicitly calls Face::setLocal(true)
- */
- bool
- isLocal() const;
-
/** \brief Set the description
*
* This is typically invoked by mgmt on set description command
@@ -95,6 +81,11 @@
virtual const std::string&
getDescription() const;
+ /** \brief Get whether face is connected to a local app
+ */
+ bool
+ isLocal() const;
+
/** \brief Get whether packets sent this Face may reach multiple peers
*
* In this base class this property is always false.
@@ -102,13 +93,17 @@
virtual bool
isMultiAccess() const;
+ /** \brief Get whether underlying communication is up
+ *
+ * In this base class this property is always true.
+ */
+ virtual bool
+ isUp() const;
+
const FaceCounters&
getCounters() const;
protected:
- void
- setLocal(bool isLocal);
-
// this is a non-virtual method
bool
decodeAndDispatchInput(const Block& element);
@@ -131,6 +126,12 @@
};
+inline bool
+Face::isLocal() const
+{
+ return m_isLocal;
+}
+
inline const FaceCounters&
Face::getCounters() const
{