OMCompiler/SimulationRuntime/c/simulation/results/simulation_result.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file belongs to the OpenModelica Run-Time System | ||
| 3 | * | ||
| 4 | * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), c/o Linköpings | ||
| 5 | * universitet, Department of Computer and Information Science, SE-58183 Linköping, Sweden. All rights | ||
| 6 | * reserved. | ||
| 7 | * | ||
| 8 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE | ||
| 9 | * AGPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. ANY | ||
| 10 | * USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S | ||
| 11 | * ACCEPTANCE OF THE BSD NEW LICENSE OR THE OSMC PUBLIC LICENSE OR THE AGPL | ||
| 12 | * VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
| 13 | * | ||
| 14 | * The OpenModelica software and the OSMC (Open Source Modelica Consortium) Public License | ||
| 15 | * (OSMC-PL) are obtained from OSMC, either from the above address, from the URLs: | ||
| 16 | * http://www.openmodelica.org or https://github.com/OpenModelica/ or | ||
| 17 | * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica distribution. GNU | ||
| 18 | * AGPL version 3 is obtained from: https://www.gnu.org/licenses/licenses.html#GPL. The BSD NEW | ||
| 19 | * License is obtained from: http://www.opensource.org/licenses/BSD-3-Clause. | ||
| 20 | * | ||
| 21 | * This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY | ||
| 23 | * SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF | ||
| 24 | * OSMC-PL. | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include "simulation_result.h" | ||
| 29 | |||
| 30 | #include <stdlib.h> | ||
| 31 | |||
| 32 | extern "C" { | ||
| 33 | |||
| 34 | ✗ | static void sim_result_doNothing(simulation_result* self, DATA *data, threadData_t *threadData) | |
| 35 | { | ||
| 36 | /* Do nothing */ | ||
| 37 | ✗ | } | |
| 38 | |||
| 39 | simulation_result sim_result = { | ||
| 40 | NULL, /* filename */ | ||
| 41 | 0, /* numpoints */ | ||
| 42 | 0, /* cpuTime */ | ||
| 43 | NULL, /* extra data */ | ||
| 44 | sim_result_doNothing, /* init */ | ||
| 45 | sim_result_doNothing, /* emit */ | ||
| 46 | sim_result_doNothing, /* writeParam */ | ||
| 47 | sim_result_doNothing, /* free */ | ||
| 48 | }; | ||
| 49 | |||
| 50 | 1 | void deinitializeResultData(DATA *data, threadData_t *threadData) | |
| 51 | { | ||
| 52 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (sim_result.free) { |
| 53 | 1 | sim_result.free(&sim_result, data, threadData); | |
| 54 | } | ||
| 55 | 1 | free((void*) sim_result.filename); | |
| 56 | 1 | sim_result.filename = NULL; | |
| 57 | 1 | sim_result.numpoints = 0; | |
| 58 | 1 | sim_result.cpuTime = 0; | |
| 59 | 1 | sim_result.storage = NULL; | |
| 60 | 1 | sim_result.init = sim_result_doNothing; | |
| 61 | 1 | sim_result.emit = sim_result_doNothing; | |
| 62 | 1 | sim_result.writeParameterData = sim_result_doNothing; | |
| 63 | 1 | sim_result.free = sim_result_doNothing; | |
| 64 | 1 | } | |
| 65 | |||
| 66 | } | ||
| 67 |