48#ifndef OPENSWMM_RDII_INTERFACE_HPP
49#define OPENSWMM_RDII_INTERFACE_HPP
61static const char RDII_FILE_STAMP[] =
"SWMM5-RDII";
94 int openForWrite(
const std::string& path,
int rdii_step,
const std::vector<int>& node_idx);
115 void saveFlows(
double current_date,
const std::vector<double>& node_flows);
124 bool isOpen()
const {
return fp_ !=
nullptr; }
131 int step()
const {
return rdii_step_; }
134 std::FILE* fp_ =
nullptr;
135 bool writing_ =
false;
140 std::vector<int> node_idx_;
141 std::vector<float> flows_;
142 double start_date_ = 0.0;
143 double end_date_ = 0.0;
144 bool have_record_ =
false;
168 bool readNextRecord();
RDII interface file manager (USE = read/override, SAVE = export).
Definition RdiiInterface.hpp:69
bool isWriting() const
Read the current mode flag without checking stream/error state.
Definition RdiiInterface.hpp:127
int openForRead(SimulationContext &ctx, const std::string &path)
Replace the owned stream with a binary or text RDII input and prime a record.
Definition RdiiInterface.cpp:55
bool isOpen() const
Test stream ownership without checking EOF or error state.
Definition RdiiInterface.hpp:124
~RdiiInterfaceFile()
Close the owned stream, ignoring flush/close failure. Caller first ends active access; does not publi...
Definition RdiiInterface.hpp:73
void applyFlows(SimulationContext &ctx, double current_date)
Add the bracketing record's RDII flow into the context node accumulators.
Definition RdiiInterface.cpp:243
int openForWrite(const std::string &path, int rdii_step, const std::vector< int > &node_idx)
Close prior IO, truncate a binary RDII destination and write its header.
Definition RdiiInterface.cpp:274
int step() const
Read the last stored record-validity duration.
Definition RdiiInterface.hpp:131
void close()
Close owned IO and clear writing/have-record flags. Ignores fclose status; retains step,...
Definition RdiiInterface.cpp:320
void saveFlows(double current_date, const std::vector< double > &node_flows)
Append a native double date and float cfs values for selected node indices.
Definition RdiiInterface.cpp:304
Definition RdiiInterface.cpp:44
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390