KDBindings API Documentation  1.0.95
Public Member Functions | List of all members
KDBindings::ScopedConnection Class Reference

A ScopedConnection is a RAII-style way to make sure a Connection is disconnected. More...

#include <connection_handle.h>

Public Member Functions

 ScopedConnection ()=default
 A ScopedConnection can be default constructed. More...
 
 ScopedConnection (ConnectionHandle &&h) noexcept
 
 ScopedConnection (const ScopedConnection &)=delete
 
 ScopedConnection (ScopedConnection &&) noexcept=default
 
 ~ScopedConnection () noexcept
 
ConnectionHandlehandle ()
 
const ConnectionHandlehandle () const
 
ConnectionHandleoperator-> ()
 
const ConnectionHandleoperator-> () const
 
ScopedConnectionoperator= (ConnectionHandle &&h) noexcept
 
ScopedConnectionoperator= (const ScopedConnection &)=delete
 
ScopedConnectionoperator= (ScopedConnection &&other) noexcept
 

Detailed Description

A ScopedConnection is a RAII-style way to make sure a Connection is disconnected.

When the ScopedConnections scope ends, the connection this ScopedConnection guards will be disconnected.

Example:

Definition at line 239 of file connection_handle.h.

Constructor & Destructor Documentation

◆ ScopedConnection() [1/4]

KDBindings::ScopedConnection::ScopedConnection ( )
default

A ScopedConnection can be default constructed.

A default constructed ScopedConnection has no connection to guard. Therefore it does nothing when it is destructed, unless a ConnectionHandle is assigned to it.

◆ ScopedConnection() [2/4]

KDBindings::ScopedConnection::ScopedConnection ( ScopedConnection &&  )
defaultnoexcept

A ScopedConnection can be move constructed

◆ ScopedConnection() [3/4]

KDBindings::ScopedConnection::ScopedConnection ( const ScopedConnection )
delete

A ScopedConnection cannot be copied

◆ ScopedConnection() [4/4]

KDBindings::ScopedConnection::ScopedConnection ( ConnectionHandle &&  h)
inlinenoexcept

A ScopedConnection can be constructed from a ConnectionHandle

Definition at line 269 of file connection_handle.h.

◆ ~ScopedConnection()

KDBindings::ScopedConnection::~ScopedConnection ( )
inlinenoexcept

When a ConnectionHandle is destructed it disconnects the connection it guards.

Warning
While this function isn't marked as throwing, it may throw and terminate the program if it is not possible to allocate memory or if mutex locking isn't possible.

Definition at line 320 of file connection_handle.h.

Member Function Documentation

◆ handle() [1/2]

ConnectionHandle& KDBindings::ScopedConnection::handle ( )
inline
Returns
the handle to the connection this instance is managing

Definition at line 285 of file connection_handle.h.

◆ handle() [2/2]

const ConnectionHandle& KDBindings::ScopedConnection::handle ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 293 of file connection_handle.h.

◆ operator->() [1/2]

ConnectionHandle* KDBindings::ScopedConnection::operator-> ( )
inline

Convenience access to the underlying ConnectionHandle using the -> operator.

Definition at line 301 of file connection_handle.h.

◆ operator->() [2/2]

const ConnectionHandle* KDBindings::ScopedConnection::operator-> ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 309 of file connection_handle.h.

◆ operator=() [1/3]

ScopedConnection& KDBindings::ScopedConnection::operator= ( ConnectionHandle &&  h)
inlinenoexcept

A ScopedConnection can be assigned from a ConnectionHandle

Definition at line 277 of file connection_handle.h.

◆ operator=() [2/3]

ScopedConnection& KDBindings::ScopedConnection::operator= ( const ScopedConnection )
delete

A ScopedConnection cannot be copied

◆ operator=() [3/3]

ScopedConnection& KDBindings::ScopedConnection::operator= ( ScopedConnection &&  other)
inlinenoexcept

A ScopedConnection can be move assigned

Definition at line 259 of file connection_handle.h.


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

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDBindings
Reactive programming & data binding in C++
https://github.com/KDAB/KDBindings/
Generated by doxygen 1.9.1