face: Skeleton implementation for the TCP protocol (face, channel, factory)
refs: #1132, #1133, #1134, #1135
Change-Id: I4a5935a078c7289dc6ea9b33f358f1a578c4405c
diff --git a/daemon/face/channel-factory.hpp b/daemon/face/channel-factory.hpp
new file mode 100644
index 0000000..7f4a5d4
--- /dev/null
+++ b/daemon/face/channel-factory.hpp
@@ -0,0 +1,39 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NFD_FACE_CHANNEL_FACTORY_HPP
+#define NFD_FACE_CHANNEL_FACTORY_HPP
+
+#include "common.hpp"
+
+namespace ndn {
+
+/**
+ * \brief Base class for all channel factories
+ */
+template<class E, class C>
+class ChannelFactory
+{
+public:
+ typedef E Endpoint;
+ typedef C Channel;
+
+ /**
+ * \brief Base class for all exceptions thrown by channel factories
+ */
+ struct Error : public std::runtime_error
+ {
+ Error(const std::string& what) : std::runtime_error(what) {}
+ };
+
+protected:
+ typedef std::map<Endpoint, Channel> ChannelMap;
+ ChannelMap m_channels;
+};
+
+} // namespace ndn
+
+#endif // NFD_FACE_CHANNEL_FACTORY_HPP