Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_state_field_t Struct Reference

#include <rte_state_transfer.h>

Data Fields

const char * name
void * data
size_t size
rte_state_field_encode_fn encode_fn
rte_state_field_decode_fn decode_fn

Detailed Description

One piece of application state to carry across a promotion.

Definition at line 75 of file rte_state_transfer.h.

Field Documentation

◆ name

const char* rte_state_field_t::name

Diagnostic/logging name only (e.g. "sessions", "db") - not part of the encoded wire form, never compared on decode. Caller-owned pointer (a string literal is the common case); not copied.

Definition at line 79 of file rte_state_transfer.h.

◆ data

void* rte_state_field_t::data

Pointer to the live data. Caller-owned; must remain valid for the registry's whole lifetime (this module never allocates its own copy). Passed to encode_fn/decode_fn as-is when either is set - this module never dereferences it directly in that case.

Definition at line 84 of file rte_state_transfer.h.

◆ size

size_t rte_state_field_t::size

The exact number of bytes this field occupies in the encoded form. For a plain field (encode_fn/decode_fn both NULL) this is also sizeof(*data), and encode/decode is a raw memcpy. For a custom field it is whatever encode_fn/decode_fn's own wire format needs - may differ from sizeof(*data) (e.g. a struct with padding, or a wire form narrower than its live representation). Must be > 0.

Definition at line 91 of file rte_state_transfer.h.

◆ encode_fn

rte_state_field_encode_fn rte_state_field_t::encode_fn

NULL for a plain (raw memcpy) field. See rte_state_field_encode_fn.

Definition at line 93 of file rte_state_transfer.h.

◆ decode_fn

rte_state_field_decode_fn rte_state_field_t::decode_fn

NULL for a plain (raw memcpy) field. See rte_state_field_decode_fn. Must be NULL iff encode_fn is NULL (both-or-neither, checked by rte_state_transfer_register_field_ex()).

Definition at line 97 of file rte_state_transfer.h.


The documentation for this struct was generated from the following file: