NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::util::signal::Connection Class Reference

represents a connection to a signal More...

#include <connection.hpp>

Public Member Functions

constexpr Connection () noexcept=default
 
void disconnect ()
 disconnects from the signal More...
 
bool isConnected () const noexcept
 check if connected to the signal More...
 
bool operator== (const Connection &other) const
 compare for equality More...
 
bool operator!= (const Connection &other) const
 

Friends

template<typename Owner , typename ... TArgs>
class Signal
 

Detailed Description

represents a connection to a signal

Note
This type is copyable. Any copy can be used to disconnect.

Definition at line 34 of file connection.hpp.

Constructor & Destructor Documentation

◆ Connection()

constexpr ndn::util::signal::Connection::Connection ( )
defaultnoexcept

Member Function Documentation

◆ disconnect()

void ndn::util::signal::Connection::disconnect ( )

disconnects from the signal

Note
If the connection is already disconnected, or if the Signal has been destructed, this operation has no effect.
Warning
During signal emission, attempting to disconnect a connection other than the executing handler's own connection results in undefined behavior.

Definition at line 36 of file connection.cpp.

Referenced by ndn::util::signal::ScopedConnection::disconnect().

◆ isConnected()

bool ndn::util::signal::Connection::isConnected ( ) const
noexcept

check if connected to the signal

Returns
false if disconnected from the signal

Definition at line 45 of file connection.cpp.

Referenced by ndn::util::signal::ScopedConnection::isConnected().

◆ operator==()

bool ndn::util::signal::Connection::operator== ( const Connection other) const

compare for equality

Two connections are equal if they both refer to the same connection that isn't disconnected, or they are both disconnected.

Definition at line 51 of file connection.cpp.

Referenced by operator!=().

◆ operator!=()

bool ndn::util::signal::Connection::operator!= ( const Connection other) const

Definition at line 59 of file connection.cpp.

References operator==().

Friends And Related Function Documentation

◆ Signal

template<typename Owner , typename ... TArgs>
friend class Signal
friend

Definition at line 73 of file connection.hpp.


The documentation for this class was generated from the following files: