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

disconnects a Connection automatically upon destruction More...

#include <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 () noexcept
 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 scoped-connection.hpp.

Constructor & Destructor Documentation

◆ ScopedConnection() [1/3]

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

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

◆ ScopedConnection() [2/3]

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 scoped-connection.cpp.

◆ ScopedConnection() [3/3]

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

move constructor

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

◆ ~ScopedConnection()

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

disconnects the connection

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

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

Member Function Documentation

◆ operator=()

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 scoped-connection.cpp.

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

◆ disconnect()

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

◆ isConnected()

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 scoped-connection.cpp.

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

◆ release()

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 scoped-connection.cpp.


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