reactor-c
C Runtime for Lingua Franca
|
#include <lf_token.h>
Data Fields | |
void * | value |
size_t | length |
token_type_t * | type |
size_t | ref_count |
struct lf_token_t * | next |
Token type for dynamically allocated arrays and structs sent as messages.
This struct is the wrapper around the dynamically allocated memory that carries the message. The message can be an array of values, where the size of each value is element_size (in bytes). If it is not an array, or is not to be treated as an array, the length == 1.
In the C LF target, a type for an output that ends in '' or '[]' is treated specially. The value carried by the output is assumed to be in dynamically allocated memory, and, using reference counting, after the last downstream reader of the value has finished, the memory will be freed. To prevent this freeing from occurring, the output type can be specified using the syntax {= type =}; this will not be treated as dynamically allocated memory. Alternatively, the programmer can give a typedef in the preamble that masks the trailing *.
size_t lf_token_t::length |
Length of the array or 1 for a non-array.
struct lf_token_t* lf_token_t::next |
Convenience for constructing a temporary list of tokens.
size_t lf_token_t::ref_count |
The number of times this token is on the event queue.
token_type_t* lf_token_t::type |
Pointer to the port or action defining the type of the data carried.
void* lf_token_t::value |
Pointer to dynamically allocated memory containing a message.