Comments (3)
TorstenS: If you do not take a copy of the function pointers, you can run into trouble.
Andreas: "The struct contains pointers to functions provided by the environment to be used by the
FMU. It is not allowed to change these functions between fmi2Instantiate(..) and
fmi2Terminate(..) calls."
TorstenS: My question was: can one keep a pointer to the struct?
Andreas: Maybe it is not specified (I found it for strings)
TorstenS: Should we define pointers are only valid for the call?
Andreas: Anything that points into memory of the importer ... (not logging).
Andreas, TorstenS: We have to think this through more carefully. And perhaps mandate what is best practice.
from fmi-standard.
The current text makes little sense.
C does not allow a function to change - whereas function pointers are often changed, so a sensible interpretation is that when it says "It is not allowed to change these functions between fmi2Instantiate(..) and fmi2Terminate(..) calls." the intent was "It is not allowed to change these functions pointers between fmi2Instantiate(..) and fmi2Terminate(..) calls." which means that the pointed to struct cannot be changed by the caller - in that case it doesn't matter if the FMI makes a copy of the function pointers or not; as the values cannot change.
If we only wanted that the struct should be valid during the call we could have sent in a struct instead of a pointer to struct (the overhead of sending a struct by value during instantiation is minimal).
from fmi-standard.
Fixed with #1931
from fmi-standard.
Related Issues (20)
- Define legal values for currentCommunicationPoint after t = startTime HOT 1
- FMI 2.0.4 PDF displays version 2.0.3 in header HOT 1
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" HOT 4
- fmi2_import_get_variable_has_start(fmi2_import_variable_t*) API is returning zero (0) for Outputs and Global Block Outputs HOT 2
- Define allowed call sequence when terminateSimulation = true HOT 3
- Handling of file access and pathname parameters HOT 1
- Clarify allowed call sequence after fmi3Error has been returned HOT 1
- Bump Reference FMUs submodule to latest version prior to release
- Clarify meaning of DefaultExperiment.stepSize for Model Exchange HOT 1
- Define matching rule "none" in the base FMI standard HOT 1
- Recommend or demand reverse domain notation for TerminalKinds and VariableKinds?
- Backport #1940 to FMI 2.0
- Backport #1941 to FMI 2.0
- Add section on when (not) to use Scheduled Execution
- Clarify what to do if a tool cannot do init iteration, the tool should report that correctly in the modelDescription.xml
- Allow setFloat64() for continuous states in Event Mode if reinit = false
- Clarify which variables can be set in Continuous Time Mode HOT 1
- Clarify naming convention for variable names introduced by layered standards HOT 11
- Formalize naming and capitalization conventions for variables, attributes, elements, and functions HOT 1
- Add statement to forbid changing the modelDescription.xml in v2.0.x Word/PDF document HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmi-standard.