channel.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FACE_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_CHANNEL_HPP
28 
29 #include "face.hpp"
30 
31 namespace nfd {
32 
38 typedef function<void(const shared_ptr<Face>& newFace)> FaceCreatedCallback;
39 
44 typedef function<void(uint32_t status, const std::string& reason)> FaceCreationFailedCallback;
45 
52 class Channel : noncopyable
53 {
54 public:
55  virtual
56  ~Channel();
57 
58  const FaceUri&
59  getUri() const;
60 
61 protected:
62  void
63  setUri(const FaceUri& uri);
64 
65 private:
66  FaceUri m_uri;
67 };
68 
69 inline const FaceUri&
71 {
72  return m_uri;
73 }
74 
82 void
83 connectFaceClosedSignal(Face& face, const std::function<void()>& f);
84 
85 } // namespace nfd
86 
87 #endif // NFD_DAEMON_FACE_CHANNEL_HPP
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
Definition: channel.cpp:41
represent a channel that communicates on a local endpoint
Definition: channel.hpp:52
const FaceUri & getUri() const
Definition: channel.hpp:70
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
virtual ~Channel()
Definition: channel.cpp:30
void setUri(const FaceUri &uri)
Definition: channel.cpp:35
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
Definition: channel.hpp:44
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
Definition: channel.hpp:38