MetaImGUI 1.0.0
ImGui Application Template for C++20
Loading...
Searching...
No Matches
MetaImGUI::Connection Class Reference

RAII handle that owns a single subscription to a Signal. More...

#include <Signal.h>

Public Member Functions

 Connection ()=default
 
 Connection (const Connection &)=delete
 
Connectionoperator= (const Connection &)=delete
 
 Connection (Connection &&other) noexcept
 
Connectionoperator= (Connection &&other) noexcept
 
 ~Connection ()
 
void Reset ()
 Disconnect now (idempotent).
 
void Release ()
 Detach without disconnecting — caller takes responsibility.
 
bool IsConnected () const noexcept
 

Friends

template<typename... Args>
class Signal
 

Detailed Description

RAII handle that owns a single subscription to a Signal.

A Connection disconnects automatically on destruction, on assignment, or via Reset(). It is move-only — copying would let two owners try to disconnect the same slot.

If the parent Signal is destroyed first, the Connection becomes a no-op: Reset() / destruction is safe.

Definition at line 43 of file Signal.h.

Constructor & Destructor Documentation

◆ Connection() [1/3]

MetaImGUI::Connection::Connection ( )
default

◆ Connection() [2/3]

MetaImGUI::Connection::Connection ( const Connection )
delete

◆ Connection() [3/3]

MetaImGUI::Connection::Connection ( Connection &&  other)
inlinenoexcept

Definition at line 49 of file Signal.h.

◆ ~Connection()

MetaImGUI::Connection::~Connection ( )
inline

Definition at line 59 of file Signal.h.

References Reset().

Member Function Documentation

◆ IsConnected()

bool MetaImGUI::Connection::IsConnected ( ) const
inlinenoexcept

Definition at line 76 of file Signal.h.

◆ operator=() [1/2]

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

Definition at line 51 of file Signal.h.

References Reset().

◆ operator=() [2/2]

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

◆ Release()

void MetaImGUI::Connection::Release ( )
inline

Detach without disconnecting — caller takes responsibility.

Definition at line 72 of file Signal.h.

◆ Reset()

void MetaImGUI::Connection::Reset ( )
inline

Disconnect now (idempotent).

Definition at line 64 of file Signal.h.

Referenced by operator=(), and ~Connection().

Friends And Related Symbol Documentation

◆ Signal

template<typename... Args>
friend class Signal
friend

Definition at line 82 of file Signal.h.


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