DelegateMQ
Loading...
Searching...
No Matches
dmq::Connection Class Reference

Represents a unique handle to a delegate connection. Move-only to prevent double-disconnection bugs. More...

#include <SignalSafe.h>

Public Member Functions

 Connection ()=default
 
template<typename DisconnectFunc >
 Connection (std::weak_ptr< void > watcher, DisconnectFunc &&func)
 
 Connection (const Connection &)=delete
 
Connectionoperator= (const Connection &)=delete
 
 Connection (Connection &&other) noexcept
 
Connectionoperator= (Connection &&other) noexcept
 
 ~Connection ()
 
bool IsConnected () const
 
void Disconnect ()
 

Detailed Description

Represents a unique handle to a delegate connection. Move-only to prevent double-disconnection bugs.

Constructor & Destructor Documentation

◆ Connection() [1/4]

dmq::Connection::Connection ( )
default

◆ Connection() [2/4]

template<typename DisconnectFunc >
dmq::Connection::Connection ( std::weak_ptr< void > watcher,
DisconnectFunc && func )
inline

◆ Connection() [3/4]

dmq::Connection::Connection ( const Connection & )
delete

◆ Connection() [4/4]

dmq::Connection::Connection ( Connection && other)
inlinenoexcept

◆ ~Connection()

dmq::Connection::~Connection ( )
inline

Member Function Documentation

◆ Disconnect()

void dmq::Connection::Disconnect ( )
inline

◆ IsConnected()

bool dmq::Connection::IsConnected ( ) const
inline

◆ operator=() [1/2]

Connection & dmq::Connection::operator= ( Connection && other)
inlinenoexcept

◆ operator=() [2/2]

Connection & dmq::Connection::operator= ( const Connection & )
delete

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