asrt
Automated System Runtime Testing library
Loading...
Searching...
No Matches
stream.h
1
11#ifndef ASRTC_STREAM_H
12#define ASRTC_STREAM_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include "../asrtl/allocator.h"
19#include "../asrtl/chann.h"
20#include "../asrtl/stream_proto.h"
21
22#include <stdint.h>
23
24#define ASRT_STREAM_MAX_SCHEMAS 255
25
28{
29 uint8_t schema_id;
30 uint8_t field_count;
31 uint16_t record_size;
32 enum asrt_strm_field_type_e* fields;
35 uint32_t count;
36};
37
40{
41 struct asrt_stream_record* next;
42 uint8_t* data;
43};
44
48{
50 uint32_t schema_count;
52};
53
66{
67 struct asrt_node node;
68 struct asrt_u8d2msg err_msg;
69 struct asrt_allocator alloc;
70
71 struct asrt_stream_schema* lookup[ASRT_STREAM_MAX_SCHEMAS];
72};
73
75enum asrt_status asrt_stream_server_init(
76 struct asrt_stream_server* server,
77 struct asrt_node* prev,
78 struct asrt_allocator alloc );
79
86struct asrt_stream_schemas asrt_stream_server_take( struct asrt_stream_server* server );
87
89void asrt_stream_schemas_free( struct asrt_stream_schemas* schemas );
90
92void asrt_stream_server_clear( struct asrt_stream_server* server );
93
95void asrt_stream_server_deinit( struct asrt_stream_server* server );
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif // ASRT_STREAM_H
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
A single stored record with a separately allocated data buffer.
Definition: stream.h:40
uint8_t * data
record_size bytes of raw field data.
Definition: stream.h:42
Descriptor for a defined schema.
Definition: stream.h:28
uint8_t schema_id
Schema ID as defined by the reactor.
Definition: stream.h:29
struct asrt_stream_record * last
Tail of record linked list.
Definition: stream.h:34
uint16_t record_size
Sum of field wire sizes.
Definition: stream.h:31
struct asrt_stream_record * first
Head of record linked list.
Definition: stream.h:33
uint32_t count
Number of records in the list.
Definition: stream.h:35
enum asrt_strm_field_type_e * fields
Allocated array of field type tags.
Definition: stream.h:32
uint8_t field_count
Number of fields.
Definition: stream.h:30
Collection of stream schemas — used both internally by the server and as the return value of take().
Definition: stream.h:48
struct asrt_stream_schema * schemas
Allocated array of schemas.
Definition: stream.h:49
uint32_t schema_count
Number of schemas in the array.
Definition: stream.h:50
struct asrt_allocator alloc
Allocator used for all contained memory.
Definition: stream.h:51
Controller-side stream server (ASRT_STRM channel).
Definition: stream.h:66
struct asrt_stream_schema * lookup[ASRT_STREAM_MAX_SCHEMAS]
Internal lookup by ID.
Definition: stream.h:71
Definition: chann.h:196