blob: 184703a74045e65ae15f36d0a6ff84822110df33 [file] [log] [blame]
/* -*- 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 nfd {
/**
* \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, shared_ptr<Channel> > ChannelMap;
ChannelMap m_channels;
};
} // namespace nfd
#endif // NFD_FACE_CHANNEL_FACTORY_HPP