blob: 7f4a5d4978263ad9e32d93b8c33122c17e399af7 [file] [log] [blame]
Alexander Afanasyeva9034b02014-01-26 18:32:02 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NFD_FACE_CHANNEL_FACTORY_HPP
8#define NFD_FACE_CHANNEL_FACTORY_HPP
9
10#include "common.hpp"
11
12namespace ndn {
13
14/**
15 * \brief Base class for all channel factories
16 */
17template<class E, class C>
18class ChannelFactory
19{
20public:
21 typedef E Endpoint;
22 typedef C Channel;
23
24 /**
25 * \brief Base class for all exceptions thrown by channel factories
26 */
27 struct Error : public std::runtime_error
28 {
29 Error(const std::string& what) : std::runtime_error(what) {}
30 };
31
32protected:
33 typedef std::map<Endpoint, Channel> ChannelMap;
34 ChannelMap m_channels;
35};
36
37} // namespace ndn
38
39#endif // NFD_FACE_CHANNEL_FACTORY_HPP