AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AAbstractSignal Class Referenceabstract

Base class for signal. More...

#include <AUI/Common/AAbstractSignal.h>

Classes#

struct  AutoDestroyedConnection
 Connection owner which destroys the connection in destructor. More...
 
struct  Connection
 Connection handle. More...
 

Public Member Functions#

virtual void clearAllOutgoingConnections () const noexcept=0
 Destroys all connections of this signal, if any.
 
virtual void clearAllOutgoingConnectionsWith (aui::no_escape< AObjectBase > receiver) const noexcept=0
 Destroys all connections with passed receiver, if any.
 
virtual bool hasOutgoingConnectionsWith (aui::no_escape< AObjectBase > receiver) const noexcept=0
 
virtual _< ConnectionaddGenericObserver (AObjectBase *receiver, std::function< void()> observer)=0
 Creates generic connection (without arguments).
 

Static Protected Member Functions#

static _weak< AObjectweakPtrFromObject (AObject *object)
 
static void addIngoingConnectionIn (aui::no_escape< AObjectBase > object, _< Connection > connection)
 Adds a connection to the specified object.
 
static void removeIngoingConnectionIn (aui::no_escape< AObjectBase > object, Connection &connection, std::unique_lock< ASpinlockMutex > &lock)
 Removes a connection from the specified object.
 

Detailed Description#

Since ASignal is a template class, AAbstractSignal provides unified access to template inseparable fields of ASignal.

Member Function Documentation#

◆ addGenericObserver()#

virtual _< Connection > AAbstractSignal::addGenericObserver ( AObjectBase * receiver,
std::function< void()> observer )
pure virtual
Parameters
receiverreceiver object.
observerfunction to be called when signal is fired.

◆ clearAllOutgoingConnections()#

virtual void AAbstractSignal::clearAllOutgoingConnections ( ) const
pure virtualnoexcept

◆ clearAllOutgoingConnectionsWith()#

virtual void AAbstractSignal::clearAllOutgoingConnectionsWith ( aui::no_escape< AObjectBase > receiver) const
pure virtualnoexcept

◆ hasOutgoingConnectionsWith()#

virtual bool AAbstractSignal::hasOutgoingConnectionsWith ( aui::no_escape< AObjectBase > receiver) const
pure virtualnoexcept
Parameters
receiverreceiver objects to check connections with.
Returns
Whether this signal has connections with passed receiver object.

Implemented in ASignal< Args >, ASignal< Args... >, ASignal< Args... >, ASignal< std::decay_t< Getter > >, ASignal< T > &, ASignal< T > &, ASignal< T >, ASignal<> &, ASignal<> &, and ASignal<>.