macro_rules! export_fmu {
($ty:ty) => { ... };
}Expand description
Main macro for exporting an FMI 3.0 model as a shared library.
This macro generates all the required C API functions for an FMI 3.0 Functional Mockup Unit (FMU). It creates the complete interface required by an FMU importer.
§Parameters
$ty: The model type that implements theModeltrait
§Requirements
The model type $ty must implement:
Modeltrait: Provides model metadata and core simulation functionalityDefault: For creating initial model instancesUserModel: For user-defined model behavior
§Static Exports
The macro also exports static symbols that can be extracted from the compiled library:
FMI3_MODEL_VARIABLES: XML description of model variablesFMI3_MODEL_STRUCTURE: XML description of model structureFMI3_INSTANTIATION_TOKEN: Unique token for model validation
§Safety
All generated functions include appropriate safety checks:
- Null pointer validation for instance parameters
- Array bounds checking for multi-value operations
- Proper error handling and status reporting
- Safe conversion between C and Rust data types