Template Class EventChannel

Class Documentation

template<EventPayload Payload>
class EventChannel

Declaration: final

Owned exact name and payload type identify one typed channel within a bus.

Same name/type values are equivalent; other payload types and legacy named channels are separate. Type identity is in-process, not a serialized protocol. Callback arguments borrow an invocation-owned copy; retain a copy for later use.

Public Types

using Callback = std::function<void(const Payload&)>

Callback borrows one invocation-owned payload copy; copy it to retain beyond the call.

Public Functions

inline explicit EventChannel(std::string name)

Own the exact channel name for this payload type.

See also

Detailed guide

Parameters:

name – Copied/moved name; empty is permitted and not normalized. Equal names with different payload types and legacy named channels remain separate. Type identity is process-local, not a serialization format.

inline const std::string &name() const noexcept

Declaration: [[nodiscard]]

Borrow the retained exact channel name until this value is changed or destroyed.

See also

Detailed guide