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

disconnects a Connection automatically upon destruction More...

#include <signal-scoped-connection.hpp>

Inheritance diagram for ndn::util::signal::ScopedConnection:
Collaboration diagram for ndn::util::signal::ScopedConnection:

Public Member Functions

 ScopedConnection ()
 
 ScopedConnection (const Connection &connection)
 implicit constructor from Connection More...
 
 ScopedConnection (ScopedConnection &&other) noexcept
 move constructor More...
 
ScopedConnectionoperator= (const Connection &connection)
 assigns a connection More...
 
 ~ScopedConnection ()
 disconnects the connection More...
 
void disconnect ()
 disconnects the connection manually More...
 
bool isConnected () const
 check if the connection is connected to the signal More...
 
void release ()
 releases the connection so that it won't be disconnected when this ScopedConnection is destructed More...
 

Detailed Description

disconnects a Connection automatically upon destruction

Definition at line 33 of file signal-scoped-connection.hpp.

Constructor & Destructor Documentation

ndn::util::signal::ScopedConnection::ScopedConnection ( )

Definition at line 33 of file signal-scoped-connection.cpp.

ndn::util::signal::ScopedConnection::ScopedConnection ( const Connection connection)

implicit constructor from Connection

Parameters
connectionthe Connection to be disconnected upon destruction

Definition at line 37 of file signal-scoped-connection.cpp.

ndn::util::signal::ScopedConnection::ScopedConnection ( ScopedConnection &&  other)
noexcept

move constructor

Definition at line 42 of file signal-scoped-connection.cpp.

ndn::util::signal::ScopedConnection::~ScopedConnection ( )

disconnects the connection

Definition at line 58 of file signal-scoped-connection.cpp.

References ndn::util::signal::Connection::disconnect().

Member Function Documentation

ScopedConnection & ndn::util::signal::ScopedConnection::operator= ( const Connection connection)

assigns a connection

If a different connection has been assigned to this instance previously, that connection will be disconnected immediately.

Definition at line 49 of file signal-scoped-connection.cpp.

References ndn::util::signal::Connection::disconnect().

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

disconnects the connection manually

Definition at line 64 of file signal-scoped-connection.cpp.

References ndn::util::signal::Connection::disconnect().

Referenced by nfd::rib::RemoteRegistrator::disable().

bool ndn::util::signal::ScopedConnection::isConnected ( ) const

check if the connection is connected to the signal

Returns
false when a default-constructed connection is used, the connection is released, or the connection is disconnected

Definition at line 70 of file signal-scoped-connection.cpp.

References ndn::util::signal::Connection::isConnected().

void ndn::util::signal::ScopedConnection::release ( )

releases the connection so that it won't be disconnected when this ScopedConnection is destructed

Definition at line 76 of file signal-scoped-connection.cpp.


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