OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
GeoPackageInputPlugin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2//
3// Copyright 2026 Caleb Buahin
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
31
32#ifndef OPENSWMM_GEOPACKAGE_INPUT_PLUGIN_HPP
33#define OPENSWMM_GEOPACKAGE_INPUT_PLUGIN_HPP
34
36#include <string>
37#include <vector>
38
39namespace openswmm::gpkg {
40
49public:
54
59 PluginState state() const noexcept override { return state_; }
60
74 int initialize(const std::vector<std::string>& init_args,
75 const IPluginComponentInfo* info) override;
76
83 int validate(const SimulationContext& ctx) override;
84
97 int read(const std::string& path, SimulationContext& ctx) override;
98
112 int write(const std::string& path, const SimulationContext& ctx) override;
113
118 std::vector<std::string> skipped_sections() const override { return {}; }
119
126 int finalize(const SimulationContext& ctx) override;
127
135 const char* last_error_message() const noexcept override { return error_msg_.c_str(); }
136
137private:
139 std::string error_msg_;
140 std::string simulation_id_ = "default";
141 int srs_id_ = 0;
142};
143
144} // namespace openswmm::gpkg
145
146#endif // OPENSWMM_GEOPACKAGE_INPUT_PLUGIN_HPP
Interface for input file reader/writer plugins.
Interface for input file reader/writer plugins.
Definition IInputPlugin.hpp:61
Describes a plugin component: metadata, capabilities, and factory methods.
Definition IPluginComponentInfo.hpp:201
PluginState state() const noexcept override
Read the stored adapter lifecycle marker.
Definition GeoPackageInputPlugin.hpp:59
std::vector< std::string > skipped_sections() const override
Return the adapter's unsupported-section listing.
Definition GeoPackageInputPlugin.hpp:118
int finalize(const SimulationContext &ctx) override
Mark the input adapter finalized.
Definition GeoPackageInputPlugin.cpp:104
const char * last_error_message() const noexcept override
Borrow the most recently stored failure diagnostic.
Definition GeoPackageInputPlugin.hpp:135
int write(const std::string &path, const SimulationContext &ctx) override
Write the model into the configured simulation of a GeoPackage.
Definition GeoPackageInputPlugin.cpp:75
int read(const std::string &path, SimulationContext &ctx) override
Read one simulation from a read-only GeoPackage connection.
Definition GeoPackageInputPlugin.cpp:43
int validate(const SimulationContext &ctx) override
Mark the adapter validated without inspecting the model.
Definition GeoPackageInputPlugin.cpp:38
int initialize(const std::vector< std::string > &init_args, const IPluginComponentInfo *info) override
Copy input adapter configuration without opening the database.
Definition GeoPackageInputPlugin.cpp:22
GeoPackageInputPlugin()=default
Create an unloaded input adapter with no open database.
PluginState
Plugin lifecycle states.
Definition PluginState.hpp:86
@ UNLOADED
Library not yet loaded (or was closed).
Definition PluginState.hpp:87
Definition ExternalContentReader.cpp:50
Central, reentrant simulation context.
Definition SimulationContext.hpp:390