17#include <AUI/Common/SharedPtrTypes.h>
18#include <AUI/Traits/values.h>
367 friend class AObject;
376 friend class API_AUI_CORE AObjectBase;
390 virtual void onBeforeReceiverSideDestroyed() = 0;
396 struct AutoDestroyedConnection {
399 AutoDestroyedConnection() =
default;
400 AutoDestroyedConnection(
_<Connection> connection) noexcept : value(std::move(connection)) {}
401 AutoDestroyedConnection(
const AutoDestroyedConnection&) =
default;
402 AutoDestroyedConnection(AutoDestroyedConnection&&)
noexcept =
default;
404 AutoDestroyedConnection& operator=(
_<Connection> rhs)
noexcept {
409 value = std::move(rhs);
413 AutoDestroyedConnection& operator=(
const AutoDestroyedConnection& rhs) {
414 return operator=(rhs.value);
417 AutoDestroyedConnection& operator=(AutoDestroyedConnection&& rhs)
noexcept {
418 return operator=(std::move(rhs.
value));
421 ~AutoDestroyedConnection() {
426 void release()
noexcept {
461 static
_weak<AObject> weakPtrFromObject(AObject*
object);
Base class for signal.
Definition AAbstractSignal.h:366
virtual _< Connection > addGenericObserver(AObjectBase *receiver, std::function< void()> observer)=0
Creates generic connection (without arguments).
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.
virtual void clearAllOutgoingConnections() const noexcept=0
Destroys all connections of this signal, if any.
virtual bool hasOutgoingConnectionsWith(aui::no_escape< AObjectBase > receiver) const noexcept=0
virtual void clearAllOutgoingConnectionsWith(aui::no_escape< AObjectBase > receiver) const noexcept=0
Destroys all connections with passed receiver, if any.
Definition AObjectBase.h:24
A base object class.
Definition AObject.h:39
Synchronization primitive that is implemented with atomic values instead of doing syscalls.
Definition AMutex.h:65
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:179
std::add_lvalue_reference_t< T > value() const noexcept
Dereferences the stored pointer.
Definition SharedPtrTypes.h:294
Connection handle.
Definition AAbstractSignal.h:375
virtual void disconnect()=0
Breaks connection.
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:52