63#ifndef OPENSWMM_RUNOFF_INTERFACE_HPP
64#define OPENSWMM_RUNOFF_INTERFACE_HPP
76static constexpr int N_FIXED_RESULTS = 8;
77static const char FILE_STAMP[] =
"SWMM5-RUNOFF";
101 int openForWrite(
const std::string& path,
int n_subcatch,
int n_pollut,
int flow_units);
114 int openForRead(
const std::string& path,
int n_subcatch,
int n_pollut,
int flow_units);
150 bool isOpen()
const {
return fp_ !=
nullptr; }
153 std::FILE* fp_ =
nullptr;
154 bool writing_ =
false;
159 int unit_system_ = 0;
161 long max_steps_pos_ = 0;
162 std::vector<float> buf_;
Runoff interface file manager.
Definition RunoffInterface.hpp:86
~RunoffInterfaceFile()
Finalize a SAVE header and close any owned stream through close(). Close/write errors are ignored; ca...
Definition RunoffInterface.hpp:90
int openForWrite(const std::string &path, int n_subcatch, int n_pollut, int flow_units)
Open/truncate a binary runoff output and write a placeholder header.
Definition RunoffInterface.cpp:50
bool readResults(SimulationContext &ctx, double *dt_out=nullptr)
Restore one timestep's native runoff record with legacy unit conversions.
Definition RunoffInterface.cpp:194
void close()
Backpatch SAVE maxSteps then close the owned stream. Safe when closed; ignores seek/write/close failu...
Definition RunoffInterface.cpp:241
int openForRead(const std::string &path, int n_subcatch, int n_pollut, int flow_units)
Open a compatible native runoff file and position at its first record.
Definition RunoffInterface.cpp:89
bool isOpen() const
Test owned stream presence.
Definition RunoffInterface.hpp:150
void saveResults(const SimulationContext &ctx, double dt)
Append one native timestep and project-unit subcatchment result record.
Definition RunoffInterface.cpp:136
Definition RunoffInterface.cpp:38
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390