reactor-c
C Runtime for Lingua Franca
|
#include <federate.h>
Structure that a federate instance uses to keep track of its own state.
bool federate_instance_t::has_downstream |
Indicator of whether this federate has downstream federates. The default value of false may be overridden in _lf_initialize_trigger_objects.
bool federate_instance_t::has_upstream |
Indicator of whether this federate has upstream federates. The default value of false may be overridden in _lf_initialize_trigger_objects.
lf_thread_t federate_instance_t::inbound_p2p_handling_thread_id |
Thread ID for a thread that accepts sockets and then supervises listening to those sockets for incoming P2P (physical) connections.
lf_thread_t* federate_instance_t::inbound_socket_listeners |
Array of thread IDs for threads that listen for incoming messages. This is NULL if there are none and otherwise has size given by number_of_inbound_p2p_connections.
bool federate_instance_t::is_last_TAG_provisional |
Indicates whether the last TAG received is provisional or an ordinary TAG. If the last TAG has been provisional, network port absent reactions must be inserted. This variable should only be accessed while holding the mutex lock.
tag_t federate_instance_t::last_sent_LTC |
A record of the most recently sent LTC (latest tag confirmed) message. In some situations, federates can send logical_tag_complete for the same tag twice or more in-a-row to the RTI. For example, when _lf_next() returns without advancing tag. To prevent overwhelming the RTI with extra messages, record the last sent logical tag complete message and check against it in lf_latest_tag_confirmed().
tag_t federate_instance_t::last_sent_NET |
A record of the most recently sent NET (next event tag) message.
tag_t federate_instance_t::last_TAG |
Most recent tag advance grant (TAG) received from the RTI, or NEVER if none has been received. This variable should only be accessed while holding the mutex lock on the top-level environment.
instant_t federate_instance_t::min_delay_from_physical_action_to_federate_output |
For use in federates with centralized coordination, the minimum time delay between a physical action within this federate and an output from this federate. This is NEVER if there is causal path from a physical action to any output.
size_t federate_instance_t::number_of_inbound_p2p_connections |
Number of inbound physical connections to the federate. This can be either physical connections, or logical connections in the decentralized coordination, or both.
size_t federate_instance_t::number_of_outbound_p2p_connections |
Number of outbound peer-to-peer connections from the federate. This can be either physical connections, or logical connections in the decentralized coordination, or both.
bool federate_instance_t::received_stop_request_from_rti |
Used to prevent the federate from sending a REQUEST_STOP message if it has already received a stop request from the RTI. This variable should only be accessed while holding a mutex lock.
lf_thread_t federate_instance_t::RTI_socket_listener |
Thread listening for incoming TCP messages from the RTI.
int federate_instance_t::server_port |
The port used for the server socket to listen for messages from other federates. The federate informs the RTI of this port once it has created its socket server by sending an ADDRESS_AD message (
int federate_instance_t::server_socket |
A socket descriptor for the socket server of the federate. This is assigned in lf_create_server(). This socket is used to listen to incoming physical connections from remote federates. Once an incoming connection is accepted, the opened socket will be stored in federate_sockets_for_inbound_p2p_connections.
int federate_instance_t::socket_TCP_RTI |
The TCP socket descriptor for this federate to communicate with the RTI. This is set by lf_connect_to_rti(), which must be called before other functions that communicate with the rti are called.
int federate_instance_t::sockets_for_inbound_p2p_connections[NUMBER_OF_FEDERATES] |
An array that holds the socket descriptors for inbound connections from each federate. The index will be the federate ID of the remote sending federate. This is initialized at startup to -1 and is set to a socket ID by lf_handle_p2p_connections_from_federates() when the socket is opened.
int federate_instance_t::sockets_for_outbound_p2p_connections[NUMBER_OF_FEDERATES] |
An array that holds the socket descriptors for outbound direct connections to each remote federate. The index will be the federate ID of the remote receiving federate. This is initialized at startup to -1 and is set to a socket ID by lf_connect_to_federate() when the socket is opened.