Udipe 1.0
Solving the riddle of high-throughput UDP
Loading...
Searching...
No Matches
result.h
Go to the documentation of this file.
1#pragma once
2
9
10#include "connect.h"
11
12#include <limits.h>
13#include <stdalign.h>
14#include <stddef.h>
15
16
17// TODO: Extract to a dedicated operation.h header and fill in the blanks
18typedef int udipe_send_result_t;
19typedef int udipe_recv_result_t;
20
32 udipe_connect_result_t connect;
33 udipe_disconnect_result_t disconnect;
34 udipe_send_result_t send;
35 udipe_recv_result_t recv;
37
52typedef struct udipe_custom_payload_s {
57 alignas(void*) char bytes[2*sizeof(void*)];
59
60// Forward declaration of \ref udipe_future_t
61typedef struct udipe_future_s udipe_future_t;
62
73 size_t ready_idx;
74
83 udipe_future_t* next;
85
106
131
155
166
173
174 // You will notice that there is no `UDIPE_FAILURE_INTERNAL` or
175 // `UDIPE_FAILURE_SELF` result type for errors that originate from the
176 // operation itself. That is because such errors are not reported via the
177 // result type code, but instead encoded within a normal result payload.
178 //
179 // This way, error types do not need to be generic over all operation types
180 // supported by udipe, they can be specific to each individual operation
181 // type and only cover the error categories that are actually relevant to
182 // the operation of interest.
184
189typedef struct udipe_result_s {
194 union {
195 // TODO doc
197 // TODO doc
199 // TODO doc
201 // TODO doc
202 udipe_timer_repeat_payload_t timer_repeat;
204
Connection-related definitions.
struct udipe_future_s udipe_future_t
Definition future.h:313
struct udipe_timer_repeat_payload_s udipe_timer_repeat_payload_t
udipe_result_type_e
Definition result.h:121
@ UDIPE_CUSTOM
Payload is in payload.custom
Definition result.h:126
@ UDIPE_TIMER_REPEAT
udipe_start_timer_repeat()
Definition result.h:130
@ UDIPE_FAILURE_DEPENDENCY
Definition result.h:165
@ UDIPE_CONNECT
Payload is in payload.network.connect
Definition result.h:122
@ UDIPE_RESULT_INVALID
Definition result.h:154
@ UDIPE_DISCONNECT
Payload is in payload.network.disconnect
Definition result.h:123
@ UDIPE_TIMER_ONCE
udipe_start_timer_once()
Definition result.h:129
@ UDIPE_FAILURE_CANCELED
Definition result.h:172
@ UDIPE_SEND
Payload is in payload.network.send
Definition result.h:124
@ UDIPE_JOIN
No payload for this result type.
Definition result.h:127
@ UDIPE_UNORDERED
udipe_start_unordered()
Definition result.h:128
@ UDIPE_RECV
Payload is in payload.network.recv
Definition result.h:125
struct udipe_unordered_payload_s udipe_unordered_payload_t
struct udipe_custom_payload_s udipe_custom_payload_t
union udipe_network_payload_u udipe_network_payload_t
enum udipe_result_type_e udipe_result_type_t
struct udipe_result_s udipe_result_t
Definition result.h:52
char bytes[2 *sizeof(void *)]
Definition result.h:57
Definition result.h:189
union udipe_result_s::@0 payload
udipe_result_type_t type
Definition result.h:212
Definition result.h:94
udipe_future_t * next
Definition result.h:104
size_t missed_ticks
Definition result.h:98
Definition result.h:70
size_t ready_idx
Definition result.h:73
udipe_future_t * next
Definition result.h:83
Definition result.h:31
udipe_send_result_t send
Result of udipe_send()
Definition result.h:34
udipe_disconnect_result_t disconnect
Result of udipe_disconnect()
Definition result.h:33
udipe_recv_result_t recv
Result of udipe_recv()
Definition result.h:35
udipe_connect_result_t connect
Result of udipe_connect()
Definition result.h:32