class

ArcDelegate

Module
Arc
Header
#include "Arc/Core/ArcDelegate.h"
Namespace
Arcf
Template
template<typename Ret, typename... Args>

Type aliases

AliasDescription
using FunctionType = std::function<Ret(Args...)>

Constructors

SignatureNameDescription
ArcDelegate() = defaultArcDelegate
ArcDelegate(const ArcDelegate& other)ArcDelegateBindings are owned by a shared block rather than by the delegate itself so a Broadcast can keep walking after a handler destroys the delegate (a button whose click closes the panel that owns it).
ArcDelegate(ArcDelegate&&) noexcept = defaultArcDelegate
~ArcDelegate()~ArcDelegate

Public functions

ReturnsNameDescription
ArcDelegate&operator=
ArcDelegate&operator=
CDelegateHandleAddThe returned handle is what Remove takes
CDelegateHandleAdd
boolRemove
voidClear
voidBroadcastHandlers may add or remove listeners, destroy the widget that owns this delegate, or close the panel a LATER listener belongs to.
boolIsBound
size_tGetCount
voidoperator()

Function details

ArcDelegate

C++
ArcDelegate() = default

ArcDelegate

C++
ArcDelegate(const ArcDelegate& other)

Bindings are owned by a shared block rather than by the delegate itself so a Broadcast can keep walking after a handler destroys the delegate (a button whose click closes the panel that owns it). A copied delegate must not share that block — it would fire the source's listeners — so copies deep-copy it.

ArcDelegate

C++
ArcDelegate(ArcDelegate&&) noexcept = default

~ArcDelegate

C++
~ArcDelegate()

operator=

C++
ArcDelegate& operator=(const ArcDelegate& other)

operator=

C++
ArcDelegate& operator=(ArcDelegate&&) noexcept = default

Add

C++
CDelegateHandle Add(FunctionType func)

The returned handle is what Remove takes

Add

C++
template<typename T> CDelegateHandle Add(T* obj, Ret (T::*method)(Args...))

Remove

C++
bool Remove(CDelegateHandle handle)

Clear

C++
void Clear()

Broadcast

C++
void Broadcast(Args... args) const

Handlers may add or remove listeners, destroy the widget that owns this delegate, or close the panel a LATER listener belongs to. The walk therefore never touches this after the first call: it pins the shared block, snapshots the handles, and before each call re-resolves the handle against the live list — a listener removed by an earlier handler is skipped rather than run against an object that no longer exists. The functor is copied out before the call because a handler that removes ITSELF would otherwise free the storage it is executing from.

IsBound

C++
bool IsBound() const

GetCount

C++
size_t GetCount() const

operator()

C++
void operator()(Args... args) const
Generated from Arc/Core/ArcDelegate.h via arc.json · Nov 5, 2026Version 1.0.0