face: move isListening()/size() to Channel as pure virtual methods
As a side effect, this ensures that Channel cannot be instantiated.
Change-Id: I875876ddf8fc0fbb04f3e88726c708ece8106702
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index 99153f7..7da5647 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -53,6 +53,18 @@
explicit
WebSocketChannel(const websocket::Endpoint& localEndpoint);
+ bool
+ isListening() const override
+ {
+ return m_server.is_listening();
+ }
+
+ size_t
+ size() const override
+ {
+ return m_channelFaces.size();
+ }
+
/**
* \brief Enable listening on the local endpoint, accept connections,
* and create faces when remote host makes a connection
@@ -62,15 +74,6 @@
void
listen(const FaceCreatedCallback& onFaceCreated);
- /**
- * \brief Get number of faces in the channel
- */
- size_t
- size() const;
-
- bool
- isListening() const;
-
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/** \pre listen hasn't been invoked
*/
@@ -110,12 +113,6 @@
time::milliseconds m_pingInterval;
};
-inline bool
-WebSocketChannel::isListening() const
-{
- return m_server.is_listening();
-}
-
} // namespace face
} // namespace nfd