NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
signal-connection.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_UTIL_SIGNAL_CONNECTION_HPP
23 #define NDN_UTIL_SIGNAL_CONNECTION_HPP
24 
25 #include "../common.hpp"
26 
27 namespace ndn {
28 namespace util {
29 namespace signal {
30 
35 {
36 public:
37  Connection();
38 
45  void
46  disconnect();
47 
51  bool
52  isConnected() const;
53 
59  bool
60  operator==(const Connection& other) const;
61 
62  bool
63  operator!=(const Connection& other) const;
64 
65 private:
68  explicit
69  Connection(weak_ptr<function<void()>> disconnect);
70 
71  template<typename Owner, typename ...TArgs>
72  friend class Signal;
73 
74 private:
82  weak_ptr<function<void()>> m_disconnect;
83 };
84 
85 } // namespace signal
86 } // namespace util
87 } // namespace ndn
88 
89 #endif // NDN_UTIL_SIGNAL_CONNECTION_HPP
bool operator!=(const Connection &other) const
Copyright (c) 2011-2015 Regents of the University of California.
represents a connection to a signal
provides a lightweight signal / event system
void disconnect()
disconnects from the signal
bool isConnected() const
check if connected to the signal
bool operator==(const Connection &other) const
compare for equality