13#include "../asrtc/cntr_assm.h"
14#include "../asrtc/result.h"
15#include "../asrtl/asrt_assert.h"
16#include "../asrtlpp/callback.hpp"
17#include "../asrtlpp/task.hpp"
18#include "../asrtlpp/util.hpp"
27 return asrt_cntr_assm_init( assm, alloc );
32inline void tick( ref< asrt_cntr_assm > assm, uint32_t now )
34 asrt_cntr_assm_tick( assm, now );
41 ref< asrt_cntr_assm > assm,
48 return asrt_cntr_assm_exec_test( assm,
tree, root_id, tid, timeout, cb.fn, cb.ptr );
52inline void deinit( ref< asrt_cntr_assm > assm )
54 asrt_cntr_assm_deinit( assm );
61struct _cntr_assm_exec_test_ctx
63 using completion_signatures = ecor::
64 completion_signatures< ecor::set_value_t(
asrt_result ), ecor::set_error_t( status ) >;
72 template <
typename OP >
75 auto s = asrt_cntr_assm_exec_test(
81 +[](
void* p, asrt_status s,
asrt_result* res ) -> asrt_status {
82 auto& o = *
static_cast< OP*
>( p );
83 if ( s != ASRT_SUCCESS )
84 o.receiver.set_error( s );
86 o.receiver.set_value( *res );
90 if ( s != ASRT_SUCCESS )
91 op.receiver.set_error( s );
102 ref< asrt_cntr_assm > assm,
104 asrt_flat_id root_id,
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: callback.hpp:17
ecor::sender_from< _cntr_assm_exec_test_ctx > cntr_assm_exec_test_sender
Sender backing co_await exec_test(assm, tree, root_id, tid, timeout).
Definition: cntr_assm.hpp:97
void tick(ref< asrt_cntr_assm > assm, uint32_t now)
Advance all assembly modules by one tick.
Definition: cntr_assm.hpp:32
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_flat_tree const & tree(ref< asrt_collect_server > srv)
Access the flat_tree assembled from incoming APPEND messages.
Definition: collect.hpp:49
void deinit(ref< asrt_cntr_assm > assm)
Release all resources owned by the assembly.
Definition: cntr_assm.hpp:52
ASRT_NODISCARD enum asrt_status exec_test(ref< asrt_cntr_assm > assm, asrt_flat_tree const *tree, asrt_flat_id root_id, uint16_t tid, uint32_t timeout, callback< asrt_assembly_exec_cb > cb)
Execute test tid using the full assembly protocol sequence (param upload, collect ready,...
Definition: cntr_assm.hpp:40
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
Definition: cntr_assm.h:37
node_id maps to blocks[node_id / node_capacity][node_id % node_capacity].
Definition: flat_tree.h:121
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: result.h:25