File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,6 +203,14 @@ int cosim_ecco_add_power_bond(
203203 */
204204cosim_algorithm * cosim_fixed_step_algorithm_create (cosim_duration stepSize );
205205
206+ /**
207+ * Destroys a co-simulation algorithm .
208+ *
209+ * \returns
210+ * 0 on success and -1 on error.
211+ */
212+ int cosim_algorithm_destroy (cosim_algorithm * algorithm );
213+
206214/**
207215 * Creates a new execution.
208216 *
Original file line number Diff line number Diff line change @@ -207,6 +207,19 @@ cosim_algorithm* cosim_fixed_step_algorithm_create(cosim_duration stepSize)
207207 }
208208}
209209
210+ int cosim_algorithm_destroy (cosim_algorithm* algorithm)
211+ {
212+ try {
213+ if (!algorithm) return success;
214+ const auto owned = std::unique_ptr<cosim_algorithm>(algorithm);
215+ return success;
216+ } catch (...) {
217+ handle_current_exception ();
218+ return failure;
219+ }
220+ }
221+
222+
210223struct cosim_execution_s
211224{
212225 std::unique_ptr<cosim::execution> cpp_execution;
You can’t perform that action at this time.
0 commit comments