37#ifndef OPENSWMM_ISTATE_IO_PLUGIN_HPP
38#define OPENSWMM_ISTATE_IO_PLUGIN_HPP
46struct SimulationContext;
47class IPluginComponentInfo;
68 const std::vector<std::
string>& init_args,
92 virtual
bool can_read(const std::
string& path)
const {
return false; }
135 virtual std::vector<std::string>
warnings()
const {
return {}; }
Plugin lifecycle state enumerator.
Describes a plugin component: metadata, capabilities, and factory methods.
Definition IPluginComponentInfo.hpp:179
Interface for state / hot-start IO plugins.
Definition IStateIOPlugin.hpp:53
virtual PluginState state() const noexcept=0
Query the current plugin state.
virtual int read_state(const std::string &path, SimulationContext &ctx)=0
Read state from a file and apply it to the simulation context.
virtual int write_state(const std::string &path, const SimulationContext &ctx)=0
Write the current simulation state to a file.
virtual bool can_read(const std::string &path) const
Cheap format sniff used to dispatch a path to the right plugin.
Definition IStateIOPlugin.hpp:92
virtual ~IStateIOPlugin()=default
virtual int initialize(const std::vector< std::string > &init_args, const IPluginComponentInfo *info)=0
Initialize from [PLUGINS] arguments.
virtual int validate(const SimulationContext &ctx)=0
Validate configuration against the loaded model.
virtual int finalize(const SimulationContext &ctx)=0
Finalize and release resources.
virtual std::vector< std::string > warnings() const
Non-fatal warnings accumulated during the last call.
Definition IStateIOPlugin.hpp:135
virtual const char * last_error_message() const noexcept
Get the last error message.
Definition IStateIOPlugin.hpp:146
PluginState
Plugin lifecycle states.
Definition PluginState.hpp:67
Definition NodeCoupling.cpp:15
Central, reentrant simulation context.
Definition SimulationContext.hpp:274