OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
GeoPackageInputPlugin.hpp
Go to the documentation of this file.
1
16#ifndef OPENSWMM_GEOPACKAGE_INPUT_PLUGIN_HPP
17#define OPENSWMM_GEOPACKAGE_INPUT_PLUGIN_HPP
18
20#include <string>
21#include <vector>
22
23namespace openswmm::gpkg {
24
26public:
28
29 PluginState state() const noexcept override { return state_; }
30
31 int initialize(const std::vector<std::string>& init_args,
32 const IPluginComponentInfo* info) override;
33
34 int validate(const SimulationContext& ctx) override;
35
46 int read(const std::string& path, SimulationContext& ctx) override;
47
55 int write(const std::string& path, const SimulationContext& ctx) override;
56
57 std::vector<std::string> skipped_sections() const override { return {}; }
58
59 int finalize(const SimulationContext& ctx) override;
60
61 const char* last_error_message() const noexcept override {
62 return error_msg_.c_str();
63 }
64
65private:
67 std::string error_msg_;
68 std::string simulation_id_ = "default";
69 int srs_id_ = 0;
70};
71
72} // namespace openswmm::gpkg
73
74#endif // OPENSWMM_GEOPACKAGE_INPUT_PLUGIN_HPP
Interface for input file reader/writer plugins.
Interface for input file reader/writer plugins.
Definition IInputPlugin.hpp:43
Describes a plugin component: metadata, capabilities, and factory methods.
Definition IPluginComponentInfo.hpp:179
Definition GeoPackageInputPlugin.hpp:25
PluginState state() const noexcept override
Query the current plugin state.
Definition GeoPackageInputPlugin.hpp:29
std::vector< std::string > skipped_sections() const override
Sections or elements that were skipped during the last read().
Definition GeoPackageInputPlugin.hpp:57
int finalize(const SimulationContext &ctx) override
Finalize and release resources.
Definition GeoPackageInputPlugin.cpp:96
const char * last_error_message() const noexcept override
Get the last error message.
Definition GeoPackageInputPlugin.hpp:61
int write(const std::string &path, const SimulationContext &ctx) override
Write a SWMM model to a GeoPackage file.
Definition GeoPackageInputPlugin.cpp:68
int read(const std::string &path, SimulationContext &ctx) override
Read a SWMM model from a GeoPackage file.
Definition GeoPackageInputPlugin.cpp:35
int validate(const SimulationContext &ctx) override
Validate configuration against the loaded model.
Definition GeoPackageInputPlugin.cpp:30
int initialize(const std::vector< std::string > &init_args, const IPluginComponentInfo *info) override
Initialize from [PLUGINS] arguments.
Definition GeoPackageInputPlugin.cpp:17
PluginState
Plugin lifecycle states.
Definition PluginState.hpp:67
@ UNLOADED
Library not yet loaded (or was closed).
Definition GeoPackageInputPlugin.cpp:15
Central, reentrant simulation context.
Definition SimulationContext.hpp:274