AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ASignal< Args > Class Template Referencefinal

Classes#

struct  call_wrapper
 

Public Types#

using func_t = std::function<void(const Args&...)>
 
using emits_args_t = std::tuple<Args...>
 

Public Member Functions#

template<typename Projection>
auto projected (Projection &&projection) const
 
call_wrapper operator() (const Args &... args)
 
 ASignal (ASignal &&) noexcept=default
 
 ASignal (const ASignal &) noexcept
 
ASignaloperator= (ASignal &&) noexcept=default
 
ASignaloperator= (const ASignal &) noexcept
 
 operator bool () const
 Check whether signal contains any connected slots or not.
 
void clearAllOutgoingConnections () const noexcept override
 Destroys all connections of this signal, if any.
 
void clearAllOutgoingConnectionsWith (aui::no_escape< AObjectBase > object) const noexcept override
 Destroys all connections with passed receiver, if any.
 
bool hasOutgoingConnections () const noexcept
 
bool hasOutgoingConnectionsWith (aui::no_escape< AObjectBase > object) const noexcept override
 
bool isAtSignalEmissionState () const noexcept
 

Additional Inherited Members#

- Static Protected Member Functions inherited from AAbstractSignal
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.
 

Member Function Documentation#

◆ clearAllOutgoingConnections()#

template<typename... Args>
void ASignal< Args >::clearAllOutgoingConnections ( ) const
inlineoverridevirtualnoexcept

Implements AAbstractSignal.

◆ clearAllOutgoingConnectionsWith()#

template<typename... Args>
void ASignal< Args >::clearAllOutgoingConnectionsWith ( aui::no_escape< AObjectBase > receiver) const
inlineoverridevirtualnoexcept
Parameters
receiverobject to clear connections with.

Implements AAbstractSignal.

◆ hasOutgoingConnectionsWith()#

template<typename... Args>
bool ASignal< Args >::hasOutgoingConnectionsWith ( aui::no_escape< AObjectBase > receiver) const
inlinenodiscardoverridevirtualnoexcept
Parameters
receiverreceiver objects to check connections with.
Returns
Whether this signal has connections with passed receiver object.

Implements AAbstractSignal.

◆ operator bool()#

template<typename... Args>
ASignal< Args >::operator bool ( ) const
inline

It's very useful then signal argument values calculation is expensive and you do not want to calculate them if no slots connected to the signal.

Returns
true, if slot contains any connected slots, false otherwise.