asrt
Automated System Runtime Testing library
Loading...
Searching...
No Matches
stream.hpp
1
11#pragma once
12
13#include "../asrtc/stream.h"
14#include "../asrtl/asrt_assert.h"
15#include "../asrtl/log.h"
16#include "../asrtl/status_to_str.h"
17#include "../asrtlpp/util.hpp"
18
19namespace asrt
20{
21
22using status = asrt_status;
23
29{
30 stream_schemas() = default;
31
33 : _s( s )
34 {
35 }
36
37 stream_schemas( stream_schemas const& ) = delete;
38 stream_schemas& operator=( stream_schemas const& ) = delete;
39
40 stream_schemas( stream_schemas&& o ) noexcept
41 : _s( o._s )
42 {
43 o._s = {};
44 }
45
46 stream_schemas& operator=( stream_schemas&& o ) noexcept;
47
49
50 asrt_stream_schemas const* operator->() const { return &_s; }
51
52 asrt_stream_schemas const& operator*() const { return _s; }
53
54private:
56};
57
59ASRT_NODISCARD inline status init(
60 ref< asrt_stream_server > srv,
61 asrt_node& prev,
62 asrt_allocator alloc )
63{
64 return asrt_stream_server_init( srv, &prev, alloc );
65}
66
68ASRT_NODISCARD inline stream_schemas take( ref< asrt_stream_server > srv )
69{
70 return stream_schemas{ asrt_stream_server_take( srv ) };
71}
72
74inline void clear( ref< asrt_stream_server > srv )
75{
76 asrt_stream_server_clear( srv );
77}
78
80inline void deinit( ref< asrt_stream_server > srv )
81{
82 asrt_stream_server_deinit( srv );
83}
84
85} // namespace asrt
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: callback.hpp:17
ASRT_NODISCARD stream_schemas take(ref< asrt_stream_server > srv)
Take all received schemas and their records; clears the server's internal state.
Definition: stream.hpp:68
void clear(ref< asrt_stream_server > srv)
Discard all schemas and records (e.g. at a test boundary).
Definition: stream.hpp:74
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
void deinit(ref< asrt_cntr_assm > assm)
Release all resources owned by the assembly.
Definition: cntr_assm.hpp:52
Owning handle for a collection of stream schemas and their records.
Definition: stream.hpp:29
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: allocator.h:28
A node in a doubly-linked channel chain.
Definition: chann.h:122
Collection of stream schemas — used both internally by the server and as the return value of take().
Definition: stream.h:48