NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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 
31 {
32 }
33 
34 void
36 {
37  m_uri = uri;
38 }
39 
40 void
41 connectFaceClosedSignal(Face& face, const std::function<void()>& f)
42 {
43  using face::FaceState;
44 
45  face.afterStateChange.connect(
46  [f] (FaceState oldState, FaceState newState) {
47  if (newState == FaceState::CLOSED) {
48  f();
49  }
50  });
51 }
52 
53 } // namespace nfd
generalization of a network interface
Definition: face.hpp:67
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
Definition: channel.cpp:41
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
TransportState FaceState
indicates the state of a face
Definition: face.hpp:54
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
signals after face state changed
Definition: face.hpp:166
void setUri(const FaceUri &uri)
Definition: channel.cpp:35
virtual ~Channel()
Definition: channel.cpp:30