41#ifndef OPENSWMM_ENGINE_DEFAULT_STATE_IO_PLUGIN_HPP
42#define OPENSWMM_ENGINE_DEFAULT_STATE_IO_PLUGIN_HPP
62 int initialize(
const std::vector<std::string>& init_args,
67 bool can_read(
const std::string& path)
const override;
73 std::vector<std::string>
warnings()
const override {
return warnings_; }
78 return last_error_.c_str();
83 std::string last_error_;
84 std::vector<std::string> warnings_;
Interface for state / hot-start IO plugins.
DefaultStateIOPlugin()=default
PluginState state() const noexcept override
Query the current plugin state.
Definition DefaultStateIOPlugin.hpp:60
int validate(const SimulationContext &ctx) override
Validate configuration against the loaded model.
Definition DefaultStateIOPlugin.cpp:77
int write_state(const std::string &path, const SimulationContext &ctx) override
Write the current simulation state to a file.
Definition DefaultStateIOPlugin.cpp:137
std::vector< std::string > warnings() const override
Non-fatal warnings accumulated during the last call.
Definition DefaultStateIOPlugin.hpp:73
bool can_read(const std::string &path) const override
Cheap format sniff used to dispatch a path to the right plugin.
Definition DefaultStateIOPlugin.cpp:91
int finalize(const SimulationContext &ctx) override
Finalize and release resources.
Definition DefaultStateIOPlugin.cpp:82
int initialize(const std::vector< std::string > &init_args, const IPluginComponentInfo *info) override
Initialize from [PLUGINS] arguments.
Definition DefaultStateIOPlugin.cpp:68
const char * last_error_message() const noexcept override
Get the last error message.
Definition DefaultStateIOPlugin.hpp:77
int read_state(const std::string &path, SimulationContext &ctx) override
Read state from a file and apply it to the simulation context.
Definition DefaultStateIOPlugin.cpp:110
Describes a plugin component: metadata, capabilities, and factory methods.
Definition IPluginComponentInfo.hpp:195
Interface for state / hot-start IO plugins.
Definition IStateIOPlugin.hpp:69
PluginState
Plugin lifecycle states.
Definition PluginState.hpp:83
@ UNLOADED
Library not yet loaded (or was closed).
Definition PluginState.hpp:84
Definition NodeCoupling.cpp:16
Central, reentrant simulation context.
Definition SimulationContext.hpp:353