asrt
Automated System Runtime Testing library
Loading...
Searching...
No Matches
asrt Namespace Reference

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. More...

Classes

struct  _cntr_assm_exec_test_ctx
 Context for cntr_assm_exec_test_sender: runs the full single-test protocol sequence.
 
struct  _cntr_exec_test_ctx
 Context for cntr_exec_test_sender: executes a test on the target.
 
struct  _cntr_query_desc_ctx
 Context for cntr_query_desc_sender: fetches the target description string.
 
struct  _cntr_query_test_count_ctx
 Context for cntr_query_test_count_sender: fetches the number of registered tests.
 
struct  _cntr_query_test_info_ctx
 Context for cntr_query_test_info_sender: fetches name and metadata for a test.
 
struct  _cntr_start_ctx
 Context for cntr_start_sender: performs the protocol handshake.
 
struct  _collect_append_ctx
 Sender that appends a single node to the collect client's tree.
 
struct  _collect_append_ctx< T >
 
struct  _collect_send_ready_ctx
 Context for collect_send_ready_sender: advertises the tree to the reactor.
 
struct  _diag_rec_ctx
 Context for diag_rec_sender: enqueues a diagnostic RECORD message.
 
struct  _param_query_ctx
 Context for param_query_sender: submits a typed QUERY or FIND_BY_KEY request.
 
struct  _param_send_ready_ctx
 Context for param_send_ready_sender: advertises the param tree to the reactor.
 
struct  _stream_define_ctx
 Context for stream_define_sender: registers a schema and returns it on completion.
 
struct  _stream_emit_ctx
 Context for stream_emit_sender: encodes args into buf and sends one DATA message.
 
struct  arr
 Tag type representing a flat-tree ARRAY container node. More...
 
struct  callback
 A type-erasing wrapper for C-style callback + void* pairs. More...
 
struct  callback< R(*)(void *, Args...) >
 
struct  collect_append_traits
 Trait mapping C++ types to flat_value scalar member pointers. More...
 
struct  collect_append_traits< arr >
 
struct  collect_append_traits< bool >
 
struct  collect_append_traits< char const * >
 
struct  collect_append_traits< float >
 
struct  collect_append_traits< int32_t >
 
struct  collect_append_traits< obj >
 
struct  collect_append_traits< uint32_t >
 
struct  diag_record_deleter
 Custom deleter for diag_record unique_ptr; uses the server's allocator. More...
 
struct  flat_type_traits
 Trait mapping a C++ type to its flat_tree metadata. More...
 
struct  flat_type_traits< arr >
 
struct  flat_type_traits< bool >
 
struct  flat_type_traits< char const * >
 
struct  flat_type_traits< float >
 
struct  flat_type_traits< int32_t >
 
struct  flat_type_traits< obj >
 
struct  flat_type_traits< uint32_t >
 
struct  malloc_free_memory_resource
 
struct  obj
 Tag type representing a flat-tree OBJECT container node. More...
 
struct  param_query_traits
 Trait mapping a C++ type T to its corresponding C callback type and asrt_param_cb union member pointer. More...
 
struct  param_query_traits< arr >
 
struct  param_query_traits< asrt_flat_value >
 
struct  param_query_traits< bool >
 
struct  param_query_traits< char const * >
 
struct  param_query_traits< float >
 
struct  param_query_traits< int32_t >
 
struct  param_query_traits< obj >
 
struct  param_query_traits< uint32_t >
 
struct  param_query_traits< void >
 
struct  param_result
 Result of a completed param query. More...
 
struct  status_sender
 Sender that completes with success if the contained status is ASRT_SUCCESS, and with test_fail otherwise. More...
 
struct  stream_schema
 Compile-time typed stream schema. More...
 
struct  stream_schemas
 Owning handle for a collection of stream schemas and their records. More...
 
struct  strm_field_traits
 
struct  strm_field_traits< bool >
 
struct  strm_field_traits< float >
 
struct  strm_field_traits< int16_t >
 
struct  strm_field_traits< int32_t >
 
struct  strm_field_traits< int8_t >
 
struct  strm_field_traits< uint16_t >
 
struct  strm_field_traits< uint32_t >
 
struct  strm_field_traits< uint8_t >
 
struct  task_cfg
 Error signatures and trace policy used by all asrt tasks. More...
 
struct  task_ctx
 Event-loop context that owns a coroutine task scheduler. More...
 
struct  task_test
 Coroutine context object passed to task tests. More...
 
struct  task_unit
 Coroutine test adaptor that wraps a definition type T into an asrt_test driven by an ecor coroutine. More...
 
struct  test_fail_t
 
struct  unit
 Test adaptor that wraps a synchronous callable T into an asrt_test. More...
 

Concepts

concept  collect_scalar
 Concept: T is a scalar type with a flat_value member pointer.
 
concept  collect_container
 Concept: T is a container tag (OBJECT or ARRAY).
 
concept  typed_param_query_callable
 Concept: CB is a typed callback for T (callable as cb(client*, query*, value_type)).
 

Typedefs

using cntr_assm_exec_test_sender = ecor::sender_from< _cntr_assm_exec_test_ctx >
 Sender backing co_await exec_test(assm, tree, root_id, tid, timeout). More...
 
using cntr_exec_test_sender = ecor::sender_from< _cntr_exec_test_ctx >
 Sender backing co_await exec_test(c, id, timeout). More...
 
using cntr_query_desc_sender = ecor::sender_from< _cntr_query_desc_ctx >
 Sender backing co_await query_desc(c, timeout). More...
 
using cntr_query_test_count_sender = ecor::sender_from< _cntr_query_test_count_ctx >
 Sender backing co_await query_test_count(c, timeout). More...
 
using cntr_query_test_info_sender = ecor::sender_from< _cntr_query_test_info_ctx >
 Sender backing co_await query_test_info(c, id, timeout). More...
 
using cntr_start_sender = ecor::sender_from< _cntr_start_ctx >
 Sender backing co_await start(c, timeout). More...
 
template<typename T >
using collect_append_sender = ecor::sender_from< _collect_append_ctx< T > >
 
using collect_send_ready_sender = ecor::sender_from< _collect_send_ready_ctx >
 Sender backing co_await send_ready(srv, root_id, timeout). More...
 
using diag_rec_sender = ecor::sender_from< _diag_rec_ctx >
 Sender backing co_await rec_diag(d, file, line, extra). More...
 
using diag_record = asrt_diag_record
 
using flat_id = asrt_flat_id
 
template<has_param_query_traits T>
using param_query_sender = ecor::sender_from< _param_query_ctx< T > >
 Sender backing co_await fetch<T> and co_await find<T>. More...
 
using param_send_ready_sender = ecor::sender_from< _param_send_ready_ctx >
 Sender backing co_await send_ready(srv, root_id, timeout). More...
 
using record = asrt_record
 
using result = asrt_result
 
using send_req_list = asrt_send_req_list
 
using status = asrt_status
 
template<typename... Ts>
using stream_define_sender = ecor::sender_from< _stream_define_ctx< Ts... > >
 Sender for co_await define<Ts...>(client, schema_id). More...
 
template<typename... Ts>
using stream_emit_sender = ecor::sender_from< _stream_emit_ctx< Ts... > >
 Sender for co_await emit(schema, args...). More...
 
template<typename T >
using task = ecor::task< T, asrt::task_cfg >
 Coroutine task type used throughout asrt's C++ layer. More...
 

Functions

ASRT_NODISCARD enum asrt_status add_test (ref< asrt_reac_assm > assm, asrt_test &test)
 Append test to the assembly's reactor test list.
 
ASRT_NODISCARD enum asrt_status add_test (ref< asrt_reactor > reac, asrt_test &test)
 Append test to the reactor's test list.
 
template<collect_container T>
status append (ref< asrt_collect_client > cc, flat_id parent, char const *key, flat_id &out, callback< asrt_send_done_cb > done_cb)
 Container append with key: append<obj>(parent, "key", out_id). More...
 
template<collect_scalar T>
ecor::sender auto append (ref< asrt_collect_client > cc, flat_id parent, char const *key, T val)
 Scalar append with key: co_await append<uint32_t>(parent, "key", 42).
 
template<collect_scalar T>
status append (ref< asrt_collect_client > cc, flat_id parent, char const *key, T val, callback< asrt_send_done_cb > done_cb)
 Scalar append with key: append<uint32_t>(parent, "key", 42, cb).
 
template<collect_container T>
status append (ref< asrt_collect_client > cc, flat_id parent, flat_id &out, callback< asrt_send_done_cb > done_cb)
 Container append without key (array child): append<obj>(parent, out_id).
 
template<collect_scalar T>
ecor::sender auto append (ref< asrt_collect_client > cc, flat_id parent, T val)
 co_await append(client, parent, val) — scalar without key (array child); returns void.
 
template<collect_scalar T>
status append (ref< asrt_collect_client > cc, flat_id parent, T val, callback< asrt_send_done_cb > done_cb)
 Scalar append without key (array child): append<uint32_t>(parent, 42).
 
template<collect_container T>
ecor::sender auto append (ref< asrt_collect_client > client, flat_id parent)
 co_await append<T>(client, parent) — container without key (array child); returns flat_id.
 
template<collect_container T>
ecor::sender auto append (ref< asrt_collect_client > client, flat_id parent, char const *key)
 co_await append<T>(client, parent, key) — container with key; returns flat_id.
 
void clear (ref< asrt_stream_server > srv)
 Discard all schemas and records (e.g. at a test boundary).
 
template<typename... Ts>
ecor::sender auto define (asrt_stream_client &client, uint8_t schema_id)
 Define a stream schema. More...
 
ASRT_NODISCARD status define (ref< asrt_stream_client > client, uint8_t schema_id, enum asrt_strm_field_type_e const *fields, uint8_t field_count, callback< asrt_stream_done_cb > done_cb)
 Send a DEFINE message registering schema_id with the given fields. More...
 
void deinit (ref< asrt_cntr_assm > assm)
 Release all resources owned by the assembly.
 
void deinit (ref< asrt_collect_client > client)
 
void deinit (ref< asrt_collect_server > srv)
 Free the flat_tree storage and all server resources.
 
void deinit (ref< asrt_controller > c)
 Release all resources owned by the controller.
 
void deinit (ref< asrt_diag_client > d)
 Unlink and release the diag client.
 
void deinit (ref< asrt_diag_server > d)
 Free all buffered records and server resources.
 
void deinit (ref< asrt_param_client > client)
 Unlink and release the param client.
 
void deinit (ref< asrt_param_server > srv)
 Free all param server resources.
 
void deinit (ref< asrt_reac_assm > assm)
 Release all resources owned by the assembly.
 
void deinit (ref< asrt_reactor > reac)
 Unlink the reactor from the channel chain and release its resources.
 
void deinit (ref< asrt_stream_client > client)
 Unlink and release the stream client.
 
void deinit (ref< asrt_stream_server > srv)
 Free all stream server resources.
 
ASRT_NODISCARD status emit (ref< asrt_stream_client > client, uint8_t schema_id, uint8_t const *data, uint16_t data_size, callback< asrt_stream_done_cb > done_cb)
 Send one DATA record for schema_id. More...
 
template<typename... Ts>
ecor::sender auto emit (stream_schema< Ts... > &schema, Ts... args)
 Emit one record. More...
 
ecor::sender auto exec_test (ref< asrt_cntr_assm > assm, asrt_flat_tree const *tree, asrt_flat_id root_id, uint16_t tid, uint32_t timeout)
 co_await exec_test(assm, tree, root_id, tid, timeout) — runs the full single-test sequence; completes with asrt_result.
 
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, test exec). More...
 
ASRT_NODISCARD status exec_test (ref< asrt_controller > c, uint16_t id, callback< asrt_test_result_callback > cb, uint32_t timeout)
 Execute test id on the target; cb receives the pass/fail result.
 
ecor::sender auto exec_test (ref< asrt_controller > c, uint16_t id, uint32_t timeout)
 co_await exec_test(c, id, timeout) — executes test id; completes with asrt_result.
 
ASRT_NODISCARD asrt_status fetch (ref< asrt_param_client > cl, asrt_param_query *q, flat_id node_id, asrt_param_any_cb cb, void *cb_ptr)
 Raw fetch without explicit expected type and C callback + void* context.
 
template<has_param_query_traits T, typed_param_query_callable< T > CB>
ASRT_NODISCARD asrt_status fetch (ref< asrt_param_client > cl, asrt_param_query *q, flat_id node_id, CB &cb)
 Fetch information about node node_id from param client, call cb with the value if successful. More...
 
template<has_param_query_traits T>
ASRT_NODISCARD asrt_status fetch (ref< asrt_param_client > cl, asrt_param_query *q, flat_id node_id, typename param_query_traits< T >::cb_type cb, void *cb_ptr)
 Fetch information about node node_id from param client, call cb with the value if successful. More...
 
template<typename T >
ecor::sender auto fetch (ref< asrt_param_client > client, flat_id node_id)
 co_await fetch<T>(client, node_id) — query a node by ID; completes with param_result<T>.
 
ecor::sender auto fetch (ref< asrt_param_client > client, flat_id node_id)
 co_await fetch(client, node_id) — typeless query; completes with param_result<void> (asrt_flat_value with .type and .data populated).
 
ASRT_NODISCARD asrt_status find (ref< asrt_param_client > cl, asrt_param_query *q, flat_id parent_id, char const *key, asrt_param_any_cb cb, void *cb_ptr)
 Raw find without explicit expected type and C callback + void* context.
 
template<has_param_query_traits T, typed_param_query_callable< T > CB>
ASRT_NODISCARD asrt_status find (ref< asrt_param_client > cl, asrt_param_query *q, flat_id parent_id, char const *key, CB &cb)
 Find child with key under parent_id, call cb with the value if successful.
 
template<has_param_query_traits T>
ASRT_NODISCARD asrt_status find (ref< asrt_param_client > cl, asrt_param_query *q, flat_id parent_id, char const *key, typename param_query_traits< T >::cb_type cb, void *cb_ptr)
 Find child with key under parent_id. Raw function pointer + void* context overload.
 
template<typename T >
ecor::sender auto find (ref< asrt_param_client > client, flat_id parent_id, char const *key)
 co_await find<T>(client, parent_id, key) — find a child by key; completes with param_result<T>.
 
ecor::sender auto find (ref< asrt_param_client > client, flat_id parent_id, char const *key)
 co_await find(client, parent_id, key) — typeless find by key; completes with param_result<void> (asrt_flat_value with .type and .data populated).
 
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. More...
 
ASRT_NODISCARD status init (ref< asrt_collect_client > client, asrt_node &prev)
 
ASRT_NODISCARD status init (ref< asrt_collect_server > srv, asrt_node &prev, asrt_allocator alloc, uint32_t tree_block_cap, uint32_t tree_node_cap)
 Initialise a collect server, linked after prev. More...
 
ASRT_NODISCARD status init (ref< asrt_controller > c, asrt_send_req_list *s, allocator a)
 Initialise a controller, wiring it to s for outgoing messages.
 
ASRT_NODISCARD status init (ref< asrt_diag_client > d, asrt_node &prev)
 Initialise a diag client and link it into the channel chain after prev.
 
ASRT_NODISCARD status init (ref< asrt_diag_server > d, asrt_node &prev, asrt_allocator alloc)
 Initialise a diag server and link it into the channel chain after prev.
 
ASRT_NODISCARD status init (ref< asrt_param_client > client, asrt_node &prev, asrt_span msg_buffer, uint32_t timeout)
 Initialise the param client, link it after prev, and set the response cache buffer. More...
 
ASRT_NODISCARD status init (ref< asrt_param_server > srv, asrt_node &prev, asrt_allocator alloc)
 Initialise a param server and link it into the channel chain after prev.
 
ASRT_NODISCARD enum asrt_status init (ref< asrt_reac_assm > assm, char const *desc, uint32_t param_timeout_ms)
 Initialise the reactor assembly — wires reactor, diag, param, collect and stream channels. More...
 
ASRT_NODISCARD enum asrt_status init (ref< asrt_reactor > reac, send_req_list &req_l, char const *desc)
 Initialise a reactor and wire it to req_l for outgoing messages. More...
 
ASRT_NODISCARD status init (ref< asrt_stream_client > client, asrt_node &prev)
 Initialise a stream client and link it into the channel chain after prev.
 
ASRT_NODISCARD status init (ref< asrt_stream_server > srv, asrt_node &prev, asrt_allocator alloc)
 Initialise a stream server and link it into the channel chain after prev.
 
ASRT_NODISCARD bool is_idle (ref< asrt_controller > c)
 Returns true if the controller has no pending operation.
 
ASRT_NODISCARD flat_id next_node_id (ref< asrt_collect_server > srv)
 Return the next node ID the server will assign (useful for pre-allocating root IDs).
 
ASRT_NODISCARD asrt_status query (ref< asrt_param_client > cl, asrt_param_query *q, flat_id node_id, char const *key, asrt_param_any_cb cb, void *cb_ptr)
 Submit a QUERY without type filtering. Raw C callback + void* overload.
 
template<has_param_query_traits T, typed_param_query_callable< T > CB>
ASRT_NODISCARD asrt_status query (ref< asrt_param_client > cl, asrt_param_query *q, flat_id node_id, char const *key, CB &cb)
 Submit a typed QUERY or FIND_BY_KEY. More...
 
template<has_param_query_traits T>
ASRT_NODISCARD asrt_status query (ref< asrt_param_client > cl, asrt_param_query *q, flat_id node_id, char const *key, typename param_query_traits< T >::cb_type cb, void *cb_ptr)
 Submit a typed QUERY or FIND_BY_KEY. Raw function pointer + void* context overload.
 
ASRT_NODISCARD status query_desc (ref< asrt_controller > c, callback< asrt_desc_callback > cb, uint32_t timeout)
 Request the target description string; cb receives it on success.
 
ecor::sender auto query_desc (ref< asrt_controller > c, uint32_t timeout)
 co_await query_desc(c, timeout) — fetches the target description; completes with std::string.
 
ASRT_NODISCARD bool query_pending (ref< asrt_param_client const > client)
 Returns true if a query is currently in flight.
 
ASRT_NODISCARD status query_test_count (ref< asrt_controller > c, callback< asrt_test_count_callback > cb, uint32_t timeout)
 Request the number of tests registered on the target; cb receives the count.
 
ecor::sender auto query_test_count (ref< asrt_controller > c, uint32_t timeout)
 co_await query_test_count(c, timeout) — fetches the number of registered tests; completes with uint16_t.
 
ASRT_NODISCARD status query_test_info (ref< asrt_controller > c, uint16_t id, callback< asrt_test_info_callback > cb, uint32_t timeout)
 Request name and metadata for test id; cb receives the info.
 
ecor::sender auto query_test_info (ref< asrt_controller > c, uint16_t id, uint32_t timeout)
 co_await query_test_info(c, id, timeout) — fetches name for test id; completes with (uint16_t tid, std::string name).
 
ASRT_NODISCARD bool ready (ref< asrt_param_client const > client)
 Returns true once the controller's READY has been received.
 
ecor::sender auto rec_diag (ref< asrt_diag_client > d, char const *file, uint32_t line, char const *extra)
 co_await rec_diag(d, file, line, extra) — enqueue a diagnostic record; completes with void once the send completes.
 
void rec_diag (ref< asrt_diag_client > d, char const *file, uint32_t line, char const *extra, callback< asrt_diag_record_done_cb > done_cb)
 Enqueue a diagnostic record from file:@p line with optional expression extra. More...
 
ASRT_NODISCARD status reset (ref< asrt_stream_client > client)
 Clear all pending state on the client (e.g. at a test boundary).
 
ASRT_NODISCARD flat_id root_id (ref< asrt_collect_client const > cc)
 
ASRT_NODISCARD flat_id root_id (ref< asrt_param_client const > client)
 Return the root node ID received in the last READY message.
 
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. More...
 
ecor::sender auto send_ready (ref< asrt_collect_server > srv, flat_id root_id, uint32_t timeout)
 co_await send_ready(srv, root_id, timeout) — advertise the tree to the reactor; completes with void once the READY_ACK arrives.
 
ASRT_NODISCARD status send_ready (ref< asrt_param_server > srv, flat_id root_id, callback< asrt_param_ready_ack_cb > ack_cb, uint32_t timeout)
 Advertise the param tree to the reactor with a READY message. More...
 
ecor::sender auto send_ready (ref< asrt_param_server > srv, flat_id root_id, uint32_t timeout)
 co_await send_ready(srv, root_id, timeout) — advertise the param tree to the reactor; completes with void once the READY_ACK arrives.
 
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. More...
 
ASRT_NODISCARD status start (ref< asrt_controller > c, callback< asrt_init_callback > cb, uint32_t timeout)
 Begin the protocol handshake; cb is invoked once the target responds or the operation times out.
 
ecor::sender auto start (ref< asrt_controller > c, uint32_t timeout)
 co_await start(c, timeout) — performs the protocol handshake; completes with void on success.
 
ASRT_NODISCARD stream_schemas take (ref< asrt_stream_server > srv)
 Take all received schemas and their records; clears the server's internal state.
 
ASRT_NODISCARD std::unique_ptr< diag_record, diag_record_deletertake_record (ref< asrt_diag_server > d)
 Remove and return the oldest buffered record as an owning unique_ptr. More...
 
void tick (ref< asrt_cntr_assm > assm, uint32_t now)
 Advance all assembly modules by one tick. More...
 
void tick (ref< asrt_reac_assm > assm, uint32_t now)
 Advance all assembly modules by one tick. More...
 
asrt_flat_tree const & tree (ref< asrt_collect_server > srv)
 Access the flat_tree assembled from incoming APPEND messages.
 

Detailed Description

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Typedef Documentation

◆ cntr_assm_exec_test_sender

using asrt::cntr_assm_exec_test_sender = typedef ecor::sender_from< _cntr_assm_exec_test_ctx >

Sender backing co_await exec_test(assm, tree, root_id, tid, timeout).

Runs the full single-test protocol sequence; completes with asrt_result.

◆ cntr_exec_test_sender

using asrt::cntr_exec_test_sender = typedef ecor::sender_from< _cntr_exec_test_ctx >

Sender backing co_await exec_test(c, id, timeout).

Executes test id on the target; completes with asrt_result.

◆ cntr_query_desc_sender

using asrt::cntr_query_desc_sender = typedef ecor::sender_from< _cntr_query_desc_ctx >

Sender backing co_await query_desc(c, timeout).

Fetches the target description string; completes with std::string.

◆ cntr_query_test_count_sender

using asrt::cntr_query_test_count_sender = typedef ecor::sender_from< _cntr_query_test_count_ctx >

Sender backing co_await query_test_count(c, timeout).

Fetches the number of registered tests; completes with uint16_t.

◆ cntr_query_test_info_sender

using asrt::cntr_query_test_info_sender = typedef ecor::sender_from< _cntr_query_test_info_ctx >

Sender backing co_await query_test_info(c, id, timeout).

Fetches name and metadata for test id; completes with (uint16_t tid, std::string name).

◆ cntr_start_sender

using asrt::cntr_start_sender = typedef ecor::sender_from< _cntr_start_ctx >

Sender backing co_await start(c, timeout).

Performs the protocol handshake; completes with void on success.

◆ collect_send_ready_sender

using asrt::collect_send_ready_sender = typedef ecor::sender_from< _collect_send_ready_ctx >

Sender backing co_await send_ready(srv, root_id, timeout).

Completes with void once the reactor acknowledges the READY message.

◆ diag_rec_sender

using asrt::diag_rec_sender = typedef ecor::sender_from< _diag_rec_ctx >

Sender backing co_await rec_diag(d, file, line, extra).

Completes with void once the RECORD message has been sent.

◆ param_query_sender

template<has_param_query_traits T>
using asrt::param_query_sender = typedef ecor::sender_from< _param_query_ctx< T > >

Sender backing co_await fetch<T> and co_await find<T>.

Submits a QUERY or FIND_BY_KEY request and completes with param_result<T>.

◆ param_send_ready_sender

using asrt::param_send_ready_sender = typedef ecor::sender_from< _param_send_ready_ctx >

Sender backing co_await send_ready(srv, root_id, timeout).

Completes with void once the reactor acknowledges the READY message.

◆ stream_define_sender

template<typename... Ts>
using asrt::stream_define_sender = typedef ecor::sender_from< _stream_define_ctx< Ts... > >

Sender for co_await define<Ts...>(client, schema_id).

Registers a schema and completes with a stream_schema<Ts...> once the DEFINE message is acknowledged via done_cb.

◆ stream_emit_sender

template<typename... Ts>
using asrt::stream_emit_sender = typedef ecor::sender_from< _stream_emit_ctx< Ts... > >

Sender for co_await emit(schema, args...).

Encodes args into a fixed-size buffer and sends one DATA message, completing once done_cb fires.

◆ task

template<typename T >
using asrt::task = typedef ecor::task< T, asrt::task_cfg >

Coroutine task type used throughout asrt's C++ layer.

Supports asrt::status and asrt::test_fail_t error channels.

Function Documentation

◆ append()

template<collect_container T>
status asrt::append ( ref< asrt_collect_client cc,
flat_id  parent,
char const *  key,
flat_id &  out,
callback< asrt_send_done_cb >  done_cb 
)

Container append with key: append<obj>(parent, "key", out_id).

Parameters
outReceives the auto-assigned node ID for the new container.

◆ define() [1/2]

template<typename... Ts>
ecor::sender auto asrt::define ( asrt_stream_client client,
uint8_t  schema_id 
)

Define a stream schema.

Returns a sender that completes with a stream_schema<Ts...> once the DEFINE message has been acknowledged.

◆ define() [2/2]

ASRT_NODISCARD status asrt::define ( ref< asrt_stream_client client,
uint8_t  schema_id,
enum asrt_strm_field_type_e const *  fields,
uint8_t  field_count,
callback< asrt_stream_done_cb >  done_cb 
)
inline

Send a DEFINE message registering schema_id with the given fields.

done_cb fires once the send completes.

◆ emit() [1/2]

ASRT_NODISCARD status asrt::emit ( ref< asrt_stream_client client,
uint8_t  schema_id,
uint8_t const *  data,
uint16_t  data_size,
callback< asrt_stream_done_cb >  done_cb 
)
inline

Send one DATA record for schema_id.

data must be exactly data_size bytes. done_cb fires once the send completes.

◆ emit() [2/2]

template<typename... Ts>
ecor::sender auto asrt::emit ( stream_schema< Ts... > &  schema,
Ts...  args 
)

Emit one record.

Returns a sender that completes once the DATA message has been sent.

◆ exec_test()

ASRT_NODISCARD enum asrt_status asrt::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 
)
inline

Execute test tid using the full assembly protocol sequence (param upload, collect ready, test exec).

tree may be nullptr to skip the param upload step. cb is invoked exactly once with the test result or the first error status.

◆ fetch() [1/2]

template<has_param_query_traits T, typed_param_query_callable< T > CB>
ASRT_NODISCARD asrt_status asrt::fetch ( ref< asrt_param_client cl,
asrt_param_query q,
flat_id  node_id,
CB &  cb 
)

Fetch information about node node_id from param client, call cb with the value if successful.

cb will be called even on error, with an appropriate error code in q->error_code and possibly an invalid value. T is the expected type of the value, if value type doesn't match, cb will be called with an error.

◆ fetch() [2/2]

template<has_param_query_traits T>
ASRT_NODISCARD asrt_status asrt::fetch ( ref< asrt_param_client cl,
asrt_param_query q,
flat_id  node_id,
typename param_query_traits< T >::cb_type  cb,
void *  cb_ptr 
)

Fetch information about node node_id from param client, call cb with the value if successful.

This overload expects raw function pointer and void* context.

◆ init() [1/5]

ASRT_NODISCARD enum asrt_status asrt::init ( ref< asrt_cntr_assm assm,
asrt_allocator  alloc 
)
inline

Initialise the controller assembly — wires controller, diag, param, collect and stream channels.

alloc is used for all dynamic allocations inside the assembly.

◆ init() [2/5]

ASRT_NODISCARD status asrt::init ( ref< asrt_collect_server srv,
asrt_node prev,
asrt_allocator  alloc,
uint32_t  tree_block_cap,
uint32_t  tree_node_cap 
)
inline

Initialise a collect server, linked after prev.

tree_block_cap and tree_node_cap set the capacity of the internal flat_tree storage.

◆ init() [3/5]

ASRT_NODISCARD status asrt::init ( ref< asrt_param_client client,
asrt_node prev,
asrt_span  msg_buffer,
uint32_t  timeout 
)
inline

Initialise the param client, link it after prev, and set the response cache buffer.

timeout is how long the client waits for a READY from the controller.

◆ init() [4/5]

ASRT_NODISCARD enum asrt_status asrt::init ( ref< asrt_reac_assm assm,
char const *  desc,
uint32_t  param_timeout_ms 
)
inline

Initialise the reactor assembly — wires reactor, diag, param, collect and stream channels.

desc is a human-readable target description (borrowed). param_timeout_ms is the maximum time to wait for a PARAM READY acknowledgement.

◆ init() [5/5]

ASRT_NODISCARD enum asrt_status asrt::init ( ref< asrt_reactor reac,
send_req_list req_l,
char const *  desc 
)
inline

Initialise a reactor and wire it to req_l for outgoing messages.

desc is a human-readable target description (borrowed).

◆ query()

template<has_param_query_traits T, typed_param_query_callable< T > CB>
ASRT_NODISCARD asrt_status asrt::query ( ref< asrt_param_client cl,
asrt_param_query q,
flat_id  node_id,
char const *  key,
CB &  cb 
)

Submit a typed QUERY or FIND_BY_KEY.

T selects the expected value type; if key is non-null, a FIND_BY_KEY is sent; otherwise a QUERY by node_id. Callable callback overload.

◆ rec_diag()

void asrt::rec_diag ( ref< asrt_diag_client d,
char const *  file,
uint32_t  line,
char const *  extra,
callback< asrt_diag_record_done_cb >  done_cb 
)
inline

Enqueue a diagnostic record from file:@p line with optional expression extra.

Calls done_cb when the send completes.

◆ send_ready() [1/2]

ASRT_NODISCARD status asrt::send_ready ( ref< asrt_collect_server srv,
flat_id  root_id,
callback< asrt_collect_ready_ack_cb >  ack_cb,
uint32_t  timeout 
)
inline

Send a READY message to the reactor to start a collection session rooted at root_id.

ack_cb fires once the reactor acknowledges or the operation times out.

◆ send_ready() [2/2]

ASRT_NODISCARD status asrt::send_ready ( ref< asrt_param_server srv,
flat_id  root_id,
callback< asrt_param_ready_ack_cb >  ack_cb,
uint32_t  timeout 
)
inline

Advertise the param tree to the reactor with a READY message.

ack_cb fires once the reactor acknowledges or the operation times out.

◆ set_tree()

void asrt::set_tree ( ref< asrt_param_server srv,
asrt_flat_tree const &  tree 
)
inline

Set the flat_tree to be served in response to QUERY and FIND_BY_KEY requests.

The tree is borrowed — it must remain valid for the duration of the READY session.

◆ take_record()

ASRT_NODISCARD std::unique_ptr< diag_record, diag_record_deleter > asrt::take_record ( ref< asrt_diag_server d)
inline

Remove and return the oldest buffered record as an owning unique_ptr.

Returns an empty unique_ptr if no records are pending.

◆ tick() [1/2]

void asrt::tick ( ref< asrt_cntr_assm assm,
uint32_t  now 
)
inline

Advance all assembly modules by one tick.

Must be called periodically from the event loop.

◆ tick() [2/2]

void asrt::tick ( ref< asrt_reac_assm assm,
uint32_t  now 
)
inline

Advance all assembly modules by one tick.

Must be called periodically from the main loop.