ZXFoundation™ 26h2
Loading...
Searching...
No Matches
registration.cxxm
Go to the documentation of this file.
1/// SPDX-License-Identifier: Apache-2.0
2/// @file zxfoundation/dgp/gate.zcomponent/registration.cxxm
3/// @brief Register all handlers into the dispatch table.
4
5export module zxfoundation.dgp.gate.registration;
6import zxfoundation.dgp.authorize.core;
7import zxfoundation.dgp.gate.types;
8import zxfoundation.dgp.gate.dispatch;
9import zxfoundation.base.types;
10
11export {
12
13namespace zxfoundation::dgp::gate::registration {
14
15 [[nodiscard]] constexpr auto make_op(
16 u8 op_id,
17 dispatch::dispatch_handler handler,
18 dispatch::gate_auth_level auth = dispatch::gate_auth_level::none,
19 dgp::operation_kind op_kind = dgp::operation_kind::none
20 ) noexcept -> dispatch::registration_op {
21 return dispatch::registration_op{
22 .operation_id = op_id,
23 .handler = handler,
24 .meta = dispatch::entry_meta{
25 .operation_id = op_id,
26 .auth = auth,
27 .op_kind = op_kind,
28 },
29 };
30 }
31
32 /// @brief Register accessible handlers into the dispatch table.
33 auto register_all_handlers() noexcept -> void;
34
35} // namespace zxfoundation::dgp::gate::registration
36
37} // end export