NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
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
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
void setUri(const FaceUri &uri)
Definition: channel.cpp:34
generalization of a network interface
Definition: face.hpp:67
TransportState
indicates the state of a transport
Definition: transport.hpp:42
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
Definition: channel.cpp:40
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
the transport is closed, and can be safely deallocated
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
signals after face state changed
Definition: face.hpp:170
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44