channel.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #include "channel.hpp"
27 
28 namespace nfd {
29 namespace face {
30 
31 Channel::~Channel() = default;
32 
33 void
34 Channel::setUri(const FaceUri& uri)
35 {
36  m_uri = uri;
37 }
38 
39 void
40 connectFaceClosedSignal(Face& face, const std::function<void()>& f)
41 {
42  face.afterStateChange.connect(
43  [f] (FaceState oldState, FaceState newState) {
44  if (newState == FaceState::CLOSED) {
45  f();
46  }
47  });
48 }
49 
50 } // namespace face
51 } // namespace nfd
TransportState
indicates the state of a transport
Definition: transport.hpp:41
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
Definition: channel.cpp:40
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
the transport is closed, and can be safely deallocated
generalization of a network interface
Definition: face.hpp:67
void setUri(const FaceUri &uri)
Definition: channel.cpp:34
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
signals after face state changed
Definition: face.hpp:160