Skip to main content

CommandHandlerRef Struct Template

Typed reference wrapper for invoking a registered handler. More...

Declaration

template <typename CommandType> struct helios::engine::runtime::messaging::command::CommandHandlerRef<CommandType> { ... }

Public Operators Index

template <typename CommandType>
operator bool () const noexcept

Checks if this reference points to a valid handler. More...

Public Member Functions Index

template <typename CommandType>
boolsubmit (const CommandType &cmd) const noexcept

Submits a command to the referenced handler. More...

Public Member Attributes Index

template <typename CommandType>
void *owner = nullptr

Pointer to the handler instance. More...

template <typename CommandType>
bool(*submitFn)(void *, const void *) noexcept = nullptr

Type-erased trampoline for command dispatch. More...

Description

Typed reference wrapper for invoking a registered handler.

Template Parameters
CommandType

The specific command type this reference handles.

Definition at line 43 of file CommandHandlerRegistry.ixx.

Public Operators

operator bool()

template <typename CommandType>
helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::operator bool ()
inline explicit nodiscard noexcept

Checks if this reference points to a valid handler.

Returns

True if both owner and submitFn are non-null.

Definition at line 60 of file CommandHandlerRegistry.ixx.

60 [[nodiscard]] explicit operator bool() const noexcept {
61 return owner && submitFn;
62 }

References helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::owner and helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::submitFn.

Public Member Functions

submit()

template <typename CommandType>
bool helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::submit (const CommandType & cmd)
inline noexcept

Submits a command to the referenced handler.

Parameters
cmd

The command instance to submit.

Returns

True if the command was accepted/handled.

Definition at line 70 of file CommandHandlerRegistry.ixx.

70 bool submit(const CommandType& cmd) const noexcept {
71 return submitFn(owner, &cmd);
72 }

References helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::owner and helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::submitFn.

Public Member Attributes

owner

template <typename CommandType>
void* helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::owner = nullptr

submitFn

template <typename CommandType>
bool(* helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::submitFn) (void *, const void *) noexcept = nullptr

Type-erased trampoline for command dispatch.

Definition at line 53 of file CommandHandlerRegistry.ixx.

53 bool (*submitFn)(void*, const void*) noexcept = nullptr;

Referenced by helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::operator bool and helios::engine::runtime::messaging::command::CommandHandlerRef< CommandType >::submit.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.