13#include "../asrtc/param.h"
14#include "../asrtl/asrt_assert.h"
15#include "../asrtl/log.h"
16#include "../asrtl/status_to_str.h"
17#include "../asrtlpp/callback.hpp"
18#include "../asrtlpp/flat_type_traits.hpp"
19#include "../asrtlpp/task.hpp"
20#include "../asrtlpp/util.hpp"
25using status =
enum asrt_status;
28ASRT_NODISCARD
inline status
init(
29 ref< asrt_param_server > srv,
33 return asrt_param_server_init( srv, &prev, alloc );
40 asrt_param_server_set_tree( srv, &
tree );
46 ref< asrt_param_server > srv,
51 return asrt_param_server_send_ready( srv, root_id, timeout, ack_cb.fn, ack_cb.ptr );
55inline void deinit( ref< asrt_param_server > srv )
57 asrt_param_server_deinit( srv );
61struct _param_send_ready_ctx
63 using completion_signatures =
64 ecor::completion_signatures< ecor::set_value_t(), ecor::set_error_t( status ) >;
70 template <
typename OP >
73 auto s = asrt_param_server_send_ready(
77 +[](
void* p,
enum asrt_status s ) {
78 auto& o = *
static_cast< OP*
>( p );
79 if ( s == ASRT_SUCCESS )
80 o.receiver.set_value();
82 o.receiver.set_error( s );
85 if ( s != ASRT_SUCCESS )
86 op.receiver.set_error( s );
97 ref< asrt_param_server > srv,
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: callback.hpp:17
ecor::sender_from< _param_send_ready_ctx > param_send_ready_sender
Sender backing co_await send_ready(srv, root_id, timeout).
Definition: param.hpp:92
ASRT_NODISCARD enum asrt_status init(ref< asrt_cntr_assm > assm, asrt_allocator alloc)
Initialise the controller assembly — wires controller, diag, param, collect and stream channels.
Definition: cntr_assm.hpp:25
ASRT_NODISCARD status send_ready(ref< asrt_collect_server > srv, flat_id root_id, callback< asrt_collect_ready_ack_cb > ack_cb, uint32_t timeout)
Send a READY message to the reactor to start a collection session rooted at root_id.
Definition: collect.hpp:39
asrt_flat_tree const & tree(ref< asrt_collect_server > srv)
Access the flat_tree assembled from incoming APPEND messages.
Definition: collect.hpp:49
void set_tree(ref< asrt_param_server > srv, asrt_flat_tree const &tree)
Set the flat_tree to be served in response to QUERY and FIND_BY_KEY requests.
Definition: param.hpp:38
void deinit(ref< asrt_cntr_assm > assm)
Release all resources owned by the assembly.
Definition: cntr_assm.hpp:52
A type-erasing wrapper for C-style callback + void* pairs.
Definition: callback.hpp:27
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: allocator.h:28
node_id maps to blocks[node_id / node_capacity][node_id % node_capacity].
Definition: flat_tree.h:121
A node in a doubly-linked channel chain.
Definition: chann.h:122
Param server module — PARAM channel, controller side.
Definition: param.h:38