face+mgmt: simplify factories and FaceManager using C++11 features
Change-Id: I113a4c15ef82bff705f61f31b170f49727bc3794
Refs: #3258
diff --git a/daemon/face/websocket-factory.hpp b/daemon/face/websocket-factory.hpp
index 7271b0a..87947ba 100644
--- a/daemon/face/websocket-factory.hpp
+++ b/daemon/face/websocket-factory.hpp
@@ -47,9 +47,6 @@
}
};
- explicit
- WebSocketFactory(const std::string& defaultPort);
-
/**
* \brief Create WebSocket-based channel using websocket::Endpoint
*
@@ -76,16 +73,16 @@
* \throws WebSocketFactory::Error
*/
shared_ptr<WebSocketChannel>
- createChannel(const std::string& localIp, const std::string& port);
+ createChannel(const std::string& localIp, const std::string& localPort);
- // from ProtocolFactory
+public: // from ProtocolFactory
virtual void
createFace(const FaceUri& uri,
ndn::nfd::FacePersistency persistency,
const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed) DECL_OVERRIDE;
+ const FaceCreationFailedCallback& onConnectFailed) DECL_OVERRIDE;
- virtual std::list<shared_ptr<const Channel> >
+ virtual std::vector<shared_ptr<const Channel>>
getChannels() const DECL_OVERRIDE;
private:
@@ -94,16 +91,12 @@
*
* \returns shared pointer to the existing WebSocketChannel object
* or empty shared pointer when such channel does not exist
- *
- * \throws never
*/
shared_ptr<WebSocketChannel>
- findChannel(const websocket::Endpoint& localEndpoint);
+ findChannel(const websocket::Endpoint& endpoint) const;
- typedef std::map< websocket::Endpoint, shared_ptr<WebSocketChannel> > ChannelMap;
- ChannelMap m_channels;
-
- std::string m_defaultPort;
+private:
+ std::map<websocket::Endpoint, shared_ptr<WebSocketChannel>> m_channels;
};
} // namespace nfd