![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
Interface for federated target extensions. More...
Inherited by org.lflang.federated.extensions.CExtension, and org.lflang.federated.extensions.TSExtension.
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) throws IOException |
| 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) throws IOException |
| 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. | |
Interface for federated target extensions.
| void org.lflang.federated.extensions.FedTargetExtension.addSenderIndexParameter | ( | Reactor | sender | ) |
Generate code for the parameter that specifies the sender index.
Implemented in org.lflang.federated.extensions.CExtension, and org.lflang.federated.extensions.TSExtension.
| default void org.lflang.federated.extensions.FedTargetExtension.annotateReaction | ( | Reaction | reaction | ) |
Optionally apply additional annotations to the reaction.
Implemented in org.lflang.federated.extensions.PythonExtension.
| String org.lflang.federated.extensions.FedTargetExtension.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. |
Implemented in org.lflang.federated.extensions.CExtension, org.lflang.federated.extensions.PythonExtension, and org.lflang.federated.extensions.TSExtension.
| String org.lflang.federated.extensions.FedTargetExtension.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. |
Implemented in org.lflang.federated.extensions.CExtension, org.lflang.federated.extensions.PythonExtension, and org.lflang.federated.extensions.TSExtension.
| String org.lflang.federated.extensions.FedTargetExtension.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. |
Implemented in org.lflang.federated.extensions.CExtension, and org.lflang.federated.extensions.TSExtension.
| String org.lflang.federated.extensions.FedTargetExtension.generatePreamble | ( | FederateInstance | federate, |
| FederationFileConfig | fileConfig, | ||
| RtiConfig | rtiConfig, | ||
| MessageReporter | messageReporter ) throws IOException |
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. |
Implemented in org.lflang.federated.extensions.CExtension, org.lflang.federated.extensions.PythonExtension, and org.lflang.federated.extensions.TSExtension.
| String org.lflang.federated.extensions.FedTargetExtension.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.
Implemented in org.lflang.federated.extensions.CExtension, org.lflang.federated.extensions.PythonExtension, and org.lflang.federated.extensions.TSExtension.
| void org.lflang.federated.extensions.FedTargetExtension.initializeTargetConfig | ( | LFGeneratorContext | context, |
| List< String > | federateNames, | ||
| FederateInstance | federate, | ||
| FederationFileConfig | fileConfig, | ||
| MessageReporter | messageReporter, | ||
| RtiConfig | rtiConfig ) throws IOException |
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. |
Implemented in org.lflang.federated.extensions.CExtension, and org.lflang.federated.extensions.TSExtension.
| String org.lflang.federated.extensions.FedTargetExtension.outputInitializationBody | ( | ) |
Generate code for initializing a network output reactor from its startup reaction.
Implemented in org.lflang.federated.extensions.CExtension, and org.lflang.federated.extensions.TSExtension.
| void org.lflang.federated.extensions.FedTargetExtension.supplySenderIndexParameter | ( | Instantiation | inst, |
| int | idx ) |
Generate code for the sender index argument of instantiation.
Implemented in org.lflang.federated.extensions.CExtension, and org.lflang.federated.extensions.TSExtension.