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.types;
9import zxfoundation.dgp.gate.dispatch;
10import zxfoundation.base.types;
11import lib.error;
12import std;
13
14export {
15
16namespace zxfoundation::dgp::gate::registration {
17
18 [[nodiscard]] constexpr auto make_op(
19 u8 op_id,
20 dispatch::dispatch_handler handler,
21 dispatch::gate_auth_level auth = dispatch::gate_auth_level::none,
22 dgp::operation_kind op_kind = dgp::operation_kind::none
23 ) noexcept -> dispatch::registration_op {
24 return dispatch::registration_op{
25 .operation_id = op_id,
26 .handler = handler,
27 .meta = dispatch::entry_meta{
28 .operation_id = op_id,
29 .auth = auth,
30 .op_kind = op_kind,
31 },
32 };
33 }
34
35 /// @brief Register accessible handlers into the dispatch table.
36 auto register_all_handlers() noexcept -> void;
37
38} // namespace zxfoundation::dgp::gate::registration
39
40} // end export