reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
python_capsule_extension.h
Go to the documentation of this file.
1
34#ifndef PYTHON_CAPSULE_EXTENSION_H
35#define PYTHON_CAPSULE_EXTENSION_H
36
37#ifdef FEDERATED
38#ifdef FEDERATED_DECENTRALIZED
39#define FEDERATED_GENERIC_EXTENSION \
40 tag_t intended_tag; \
41 instant_t physical_time_of_arrival;
42
43#define FEDERATED_CAPSULE_EXTENSION \
44 py_tag_t* intended_tag; \
45 instant_t physical_time_of_arrival;
46
47#define FEDERATED_CAPSULE_MEMBER \
48 {"intended_tag", T_OBJECT, offsetof(generic_port_capsule_struct, intended_tag), READONLY, \
49 "Original intended tag of the event."}, \
50 {"physical_time_of_arrival", T_LONG, offsetof(generic_port_capsule_struct, physical_time_of_arrival), READONLY, \
51 "Physical time of arrival of the original message."},
52
53#define FEDERATED_ASSIGN_FIELDS(py_port, c_port) \
54 do { \
55 py_port->intended_tag = convert_C_tag_to_py(c_port->intended_tag); \
56 py_port->physical_time_of_arrival = c_port->physical_time_of_arrival; \
57 } while (0)
58
59#else // FEDERATED_CENTRALIZED
60#define FEDERATED_GENERIC_EXTENSION instant_t physical_time_of_arrival;
61
62#define FEDERATED_CAPSULE_EXTENSION FEDERATED_GENERIC_EXTENSION
63
64#define FEDERATED_CAPSULE_MEMBER \
65 {"physical_time_of_arrival", T_INT, offsetof(generic_port_capsule_struct, physical_time_of_arrival), READONLY, \
66 "Physical time of arrival of the original message."},
67
68#define FEDERATED_ASSIGN_FIELDS(py_port, c_port) \
69 do { \
70 py_port->physical_time_of_arrival = c_port->physical_time_of_arrival; \
71 } while (0)
72#endif // FEDERATED_DECENTRALIZED
73#else // not FEDERATED
74#define FEDERATED_GENERIC_EXTENSION // Empty
75#define FEDERATED_CAPSULE_EXTENSION // Empty
76#define FEDERATED_CAPSULE_MEMBER // Empty
77#define FEDERATED_ASSIGN_FIELDS(py_port, c_port) // Empty
78#define FEDERATED_COPY_FIELDS(py_port1, py_port2) // Empty
79#endif // FEDERATED
80
81#endif