Junxiao Shi | 61e3cc5 | 2014-03-03 20:40:28 -0700 | [diff] [blame^] | 1 | /* -*- 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 | |
| 12 | namespace nfd { |
| 13 | |
| 14 | class Channel : noncopyable |
| 15 | { |
| 16 | public: |
| 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 | |
| 34 | protected: |
| 35 | void |
| 36 | setUri(const FaceUri& uri); |
| 37 | |
| 38 | private: |
| 39 | FaceUri m_uri; |
| 40 | }; |
| 41 | |
| 42 | inline const FaceUri& |
| 43 | Channel::getUri() const |
| 44 | { |
| 45 | return m_uri; |
| 46 | } |
| 47 | |
| 48 | } // namespace nfd |
| 49 | |
| 50 | #endif // NFD_FACE_CHANNEL_HPP |