NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
Enumerations
+
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
+
Enumerator
a
d
e
f
i
k
l
n
p
r
s
u
w
+
Related Functions
b
c
d
e
f
g
i
k
l
m
n
o
p
s
v
+
Files
File List
+
File Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
g
k
l
n
p
r
s
Typedefs
+
Macros
b
d
e
f
i
l
m
n
p
r
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
signal-connection.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
signal-connection.hpp
"
23
24
namespace
ndn
{
25
namespace
util {
26
namespace
signal
{
27
28
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Connection>));
29
30
Connection::Connection
()
31
{
32
}
33
34
Connection::Connection
(weak_ptr<
function
<
void
()>>
disconnect
)
35
: m_disconnect(
disconnect
)
36
{
37
}
38
39
void
40
Connection::disconnect
()
41
{
42
shared_ptr<function<void()>> f = m_disconnect.lock();
43
if
(f !=
nullptr
) {
44
(*f)();
45
}
46
}
47
48
bool
49
Connection::isConnected
()
const
50
{
51
return
!m_disconnect.expired();
52
}
53
54
bool
55
Connection::operator==
(
const
Connection
& other)
const
56
{
57
shared_ptr<function<void()>> f1 = m_disconnect.lock();
58
shared_ptr<function<void()>> f2 = other.m_disconnect.lock();
59
return
f1 == f2;
60
}
61
62
bool
63
Connection::operator!=
(
const
Connection
& other)
const
64
{
65
return
!(this->
operator==
(other));
66
}
67
68
}
// namespace signal
69
}
// namespace util
70
}
// namespace ndn
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::util::signal::Connection
represents a connection to a signal
Definition:
signal-connection.hpp:34
ndn::util::signal::Connection::disconnect
void disconnect()
disconnects from the signal
Definition:
signal-connection.cpp:40
ndn::util::signal::Connection::operator!=
bool operator!=(const Connection &other) const
Definition:
signal-connection.cpp:63
ndn::util::signal::Connection::operator==
bool operator==(const Connection &other) const
compare for equality
Definition:
signal-connection.cpp:55
signal-connection.hpp
ndn::util::signal::Connection::isConnected
bool isConnected() const
check if connected to the signal
Definition:
signal-connection.cpp:49
ndn::util::signal::Connection::Connection
Connection()
Definition:
signal-connection.cpp:30
ndn::util::signal
Definition:
signal-connection.cpp:26
ndnSIM
ndn-cxx
src
util
signal-connection.cpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13