![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
An extension class to the TSGenerator that enables certain federated functionalities. More...
Inherits org.lflang.federated.extensions.FedTargetExtension.
Public Member Functions | |
| void | addSenderIndexParameter (Reactor sender) |
| Generate code for the parameter that specifies the sender index. | |
| default void | annotateReaction (Reaction reaction) |
| Optionally apply additional annotations to the reaction. | |
| String | generateNetworkReceiverBody (Action action, VarRef sendingPort, VarRef receivingPort, FedConnectionInstance connection, InferredType type, CoordinationMode coordinationMode, MessageReporter messageReporter) |
| Generate code for the body of a reaction that handles the action that is triggered by receiving a message from a remote federate. | |
| String | generateNetworkSenderBody (VarRef sendingPort, VarRef receivingPort, FedConnectionInstance connection, InferredType type, CoordinationMode coordinationMode, MessageReporter messageReporter) |
| Generate code for the body of a reaction that handles an output that is to be sent over the network. | |
| String | generatePortAbsentReactionBody (VarRef srcOutputPort, FedConnectionInstance connection) |
| Generate code for the body of a reaction that sends a port status message for the given port if it is absent. | |
| String | generatePreamble (FederateInstance federate, FederationFileConfig fileConfig, RtiConfig rtiConfig, MessageReporter messageReporter) |
| Add preamble to the source to set up federated execution. | |
| String | getNetworkBufferType () |
| Return the type for the raw network buffer in the target language (e.g., uint_8 in C). | |
| void | initializeTargetConfig (LFGeneratorContext context, List< String > federateNames, FederateInstance federate, FederationFileConfig fileConfig, MessageReporter messageReporter, RtiConfig rtiConfig) |
| Perform necessary actions to initialize the target config. | |
| String | outputInitializationBody () |
| Generate code for initializing a network output reactor from its startup reaction. | |
| void | supplySenderIndexParameter (Instantiation inst, int idx) |
| Generate code for the sender index argument of instantiation. | |
An extension class to the TSGenerator that enables certain federated functionalities.
| void org.lflang.federated.extensions.TSExtension.addSenderIndexParameter | ( | Reactor | sender | ) |
Generate code for the parameter that specifies the sender index.
Implements org.lflang.federated.extensions.FedTargetExtension.
|
inherited |
Optionally apply additional annotations to the reaction.
Implemented in org.lflang.federated.extensions.PythonExtension.
| String org.lflang.federated.extensions.TSExtension.generateNetworkReceiverBody | ( | Action | action, |
| VarRef | sendingPort, | ||
| VarRef | receivingPort, | ||
| FedConnectionInstance | connection, | ||
| InferredType | type, | ||
| CoordinationMode | coordinationMode, | ||
| MessageReporter | messageReporter ) |
Generate code for the body of a reaction that handles the action that is triggered by receiving a message from a remote federate.
| action | The action. |
| sendingPort | The output port providing the data to send. |
| receivingPort | The ID of the destination port. |
| connection | The federated connection being lowered. |
| type | The type of the data being sent over the connection. |
| coordinationMode | The coordination type |
| messageReporter | Used to report errors and warnings. |
Implements org.lflang.federated.extensions.FedTargetExtension.
| String org.lflang.federated.extensions.TSExtension.generateNetworkSenderBody | ( | VarRef | sendingPort, |
| VarRef | receivingPort, | ||
| FedConnectionInstance | connection, | ||
| InferredType | type, | ||
| CoordinationMode | coordinationMode, | ||
| MessageReporter | messageReporter ) |
Generate code for the body of a reaction that handles an output that is to be sent over the network.
| sendingPort | The output port providing the data to send. |
| receivingPort | The variable reference to the destination port. |
| connection | The federated connection being lowered. |
| type | The type of the data being sent over the connection. |
| coordinationMode | Whether the federated program is centralized or decentralized. |
| messageReporter | Used to report errors and warnings. |
Implements org.lflang.federated.extensions.FedTargetExtension.
| String org.lflang.federated.extensions.TSExtension.generatePortAbsentReactionBody | ( | VarRef | srcOutputPort, |
| FedConnectionInstance | connection ) |
Generate code for the body of a reaction that sends a port status message for the given port if it is absent.
| srcOutputPort | A reference to the output port of the federate instance. |
| connection | The federated connection being lowered. |
Implements org.lflang.federated.extensions.FedTargetExtension.
| String org.lflang.federated.extensions.TSExtension.generatePreamble | ( | FederateInstance | federate, |
| FederationFileConfig | fileConfig, | ||
| RtiConfig | rtiConfig, | ||
| MessageReporter | messageReporter ) |
Add preamble to the source to set up federated execution.
| federate | The federate to which the generated setup code will correspond. |
| fileConfig | The federation file configuration. |
| rtiConfig | The settings of the RTI. |
| messageReporter | Used to report errors and warnings. |
Implements org.lflang.federated.extensions.FedTargetExtension.
| String org.lflang.federated.extensions.TSExtension.getNetworkBufferType | ( | ) |
Return the type for the raw network buffer in the target language (e.g., uint_8 in C).
This would be the type of the network messages after serialization and before deserialization. It is primarily used to determine the type for the network action at the receiver.
Implements org.lflang.federated.extensions.FedTargetExtension.
| void org.lflang.federated.extensions.TSExtension.initializeTargetConfig | ( | LFGeneratorContext | context, |
| List< String > | federateNames, | ||
| FederateInstance | federate, | ||
| FederationFileConfig | fileConfig, | ||
| MessageReporter | messageReporter, | ||
| RtiConfig | rtiConfig ) |
Perform necessary actions to initialize the target config.
| context | The context of the original code generation process. |
| federateNames | The names of all the federates in the program. |
| federate | The federate instance. |
| fileConfig | An instance of FedFileConfig. |
| messageReporter | Used to report errors. |
| rtiConfig | The RTI configuration settings. |
Implements org.lflang.federated.extensions.FedTargetExtension.
| String org.lflang.federated.extensions.TSExtension.outputInitializationBody | ( | ) |
Generate code for initializing a network output reactor from its startup reaction.
Implements org.lflang.federated.extensions.FedTargetExtension.
| void org.lflang.federated.extensions.TSExtension.supplySenderIndexParameter | ( | Instantiation | inst, |
| int | idx ) |
Generate code for the sender index argument of instantiation.
Implements org.lflang.federated.extensions.FedTargetExtension.