CommandRegistry class final
#include <control/registry.hpp>
Immutable-like view over currently registered command descriptors.
Constructors, destructors, conversion operators
- CommandRegistry(std::span<const CommandDescriptor> commands) explicit
- Constructs registry over caller-owned command table view.
Public functions
- auto commands() const -> std::span<const CommandDescriptor>
- Returns current command table view.
- auto find(std::string_view path) const -> const CommandDescriptor*
- Finds best matching command descriptor for request path.
- void set_commands(std::span<const CommandDescriptor> commands)
- Replaces active command table view.
Function documentation
const CommandDescriptor* prf:: control:: CommandRegistry:: find(std::string_view path) const
Finds best matching command descriptor for request path.
Returns nullptr when no descriptor matches.