blob: 5993363c6c6b779683ea27c03a007e5c540dd8b4 [file] [log] [blame]
Junxiao Shi61e3cc52014-03-03 20:40:28 -07001/* -*- 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_HPP
8#define NFD_FACE_CHANNEL_HPP
9
10#include "face.hpp"
11
12namespace nfd {
13
14class Channel : noncopyable
15{
16public:
17 /** \brief Prototype for the callback called when face is created
18 * (as a response to incoming connection or after connection
19 * is established)
20 */
21 typedef function<void(const shared_ptr<Face>& newFace)> FaceCreatedCallback;
22
23 /** \brief Prototype for the callback that is called when face is failed to
24 * get created
25 */
26 typedef function<void(const std::string& reason)> ConnectFailedCallback;
27
28 virtual
29 ~Channel();
30
31 const FaceUri&
32 getUri() const;
33
34protected:
35 void
36 setUri(const FaceUri& uri);
37
38private:
39 FaceUri m_uri;
40};
41
42inline const FaceUri&
43Channel::getUri() const
44{
45 return m_uri;
46}
47
48} // namespace nfd
49
50#endif // NFD_FACE_CHANNEL_HPP