![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| class | Handle |
| Owns an hid_t and closes it with the right H5*close on scope exit. More... | |
| class | Hdf5InputPlugin |
| class | Hdf5PluginInfo |
| Singleton describing the HDF5 I/O plugin. More... | |
Functions | |
| int | write_model (const std::string &path, const SimulationContext &ctx, std::vector< std::string > *warnings=nullptr) |
| Write a complete native model and analysis columns to HDF5. | |
| Handle | open_file_readonly (const std::string &path) |
| Open an existing HDF5 file for read-only access. | |
| std::string | column_units (hid_t group, const std::string &column) |
A column's units attribute, or "" when it has none. | |
| Handle | make_string_type () |
| A variable-length UTF-8 string type, for name columns. | |
| Handle | make_group (hid_t loc, const std::string &name) |
| Create (or open) a group, creating intermediate groups as needed. | |
| Handle | open_group (hid_t loc, const std::string &name) |
| Open an existing HDF5 group. | |
| bool | has_link (hid_t loc, const std::string &name) |
True when loc contains name. | |
| bool | write_attr (hid_t loc, const std::string &name, const std::string &value) |
| Create or replace a scalar std::string attribute. | |
| bool | write_attr (hid_t loc, const std::string &name, double value) |
| Create or replace a scalar double attribute. | |
| bool | write_attr (hid_t loc, const std::string &name, int value) |
| Create or replace a scalar int attribute. | |
| bool | read_attr (hid_t loc, const std::string &name, std::string &out) |
| Read a scalar attribute as std::string. | |
| bool | read_attr (hid_t loc, const std::string &name, double &out) |
| Read a scalar attribute as double. | |
| bool | read_attr (hid_t loc, const std::string &name, int &out) |
| Read a scalar attribute as int. | |
| bool | write_column (hid_t group, const std::string &name, const std::vector< double > &values, const std::string &units="", const std::string &description="", int compression=4) |
| Create a one-dimensional double column with optional metadata. | |
| bool | write_column (hid_t group, const std::string &name, const std::vector< int > &values, const std::string &units="", const std::string &description="", int compression=4) |
| Create a one-dimensional int column with optional metadata. | |
| bool | write_column (hid_t group, const std::string &name, const std::vector< std::string > &values, const std::string &description="", int compression=4) |
| Create a one-dimensional std::string column with optional metadata. | |
| bool | read_column (hid_t group, const std::string &name, std::vector< double > &out) |
| Read a one-dimensional column into a double vector. | |
| bool | read_column (hid_t group, const std::string &name, std::vector< int > &out) |
| Read a one-dimensional column into a int vector. | |
| bool | read_column (hid_t group, const std::string &name, std::vector< std::string > &out) |
| Read a one-dimensional column into a std::string vector. | |
| std::size_t | column_length (hid_t group, const std::string &probe) |
Row count of a group's columns — the length of probe, or 0 if absent. | |
Variables | |
| constexpr int | kSchemaVersionMajor = 1 |
| constexpr int | kSchemaVersionMinor = 0 |
| constexpr const char * | kSchemaVersion = "1.0" |
| std::size_t openswmm::h5io::column_length | ( | hid_t | group, |
| const std::string & | probe ) |
Row count of a group's columns — the length of probe, or 0 if absent.
Inspect the number of rows in a one-dimensional probe column.
| [in] | group | Borrowed source group from this HDF5 instance. |
| [in] | probe | Dataset name relative to group. |
| std::string openswmm::h5io::column_units | ( | hid_t | group, |
| const std::string & | column ) |
A column's units attribute, or "" when it has none.
Read a dataset's units attribute.
| [in] | group | Borrowed file/group identifier from this HDF5 instance. |
| [in] | column | Dataset name relative to group. |
| bool openswmm::h5io::has_link | ( | hid_t | loc, |
| const std::string & | name ) |
True when loc contains name.
Test a path's links while checking each nonempty ancestor component.
| [in] | loc | Borrowed file/group identifier from this HDF5 instance. |
| [in] | name | Link path; empty components and leading slashes are skipped. |
| Handle openswmm::h5io::make_group | ( | hid_t | loc, |
| const std::string & | name ) |
Create (or open) a group, creating intermediate groups as needed.
Open a group or create it with any missing parent groups.
| [in] | loc | Borrowed file/group identifier from this HDF5 instance. |
| [in] | name | Group path relative to loc; must denote a group if it exists. |
| Handle openswmm::h5io::make_string_type | ( | ) |
A variable-length UTF-8 string type, for name columns.
Allocate a variable-length UTF-8 HDF5 string datatype.
| Handle openswmm::h5io::open_file_readonly | ( | const std::string & | path | ) |
Open an existing HDF5 file for read-only access.
Open an existing model file read-only. Callers use this rather than H5Fopen so that every HDF5 call stays inside the engine's instance.
| [in] | path | Borrowed filename passed to H5Fopen; must identify a readable file. |
| Handle openswmm::h5io::open_group | ( | hid_t | loc, |
| const std::string & | name ) |
Open an existing HDF5 group.
| [in] | loc | Borrowed file/group identifier from this HDF5 instance. |
| [in] | name | Group path relative to loc. |
| bool openswmm::h5io::read_attr | ( | hid_t | loc, |
| const std::string & | name, | ||
| double & | out ) |
Read a scalar attribute as double.
| [in] | loc | Borrowed object or file identifier; a file targets its root group. |
| [in] | name | Attribute name to find. |
| [out] | out | Caller-owned value assigned on success. On HDF5 read failure its value is unspecified; a missing attribute leaves it unchanged. |
| bool openswmm::h5io::read_attr | ( | hid_t | loc, |
| const std::string & | name, | ||
| int & | out ) |
Read a scalar attribute as int.
| [in] | loc | Borrowed object or file identifier; a file targets its root group. |
| [in] | name | Attribute name to find. |
| [out] | out | Caller-owned value assigned on success. On HDF5 read failure its value is unspecified; a missing attribute leaves it unchanged. |
| bool openswmm::h5io::read_attr | ( | hid_t | loc, |
| const std::string & | name, | ||
| std::string & | out ) |
Read a scalar attribute as std::string.
| [in] | loc | Borrowed object or file identifier; a file targets its root group. |
| [in] | name | Attribute name to find. |
| [out] | out | Caller-owned value assigned on success. On HDF5 read failure its value is unspecified; a missing attribute leaves it unchanged. |
| bool openswmm::h5io::read_column | ( | hid_t | group, |
| const std::string & | name, | ||
| std::vector< double > & | out ) |
Read a one-dimensional column into a double vector.
| [in] | group | Borrowed source group from this HDF5 instance. |
| [in] | name | Existing dataset name relative to group. |
| [out] | out | Caller-owned vector resized to the stored length and filled on success. Missing/open failures leave it unchanged; later failures may leave it resized or partly filled. |
| bool openswmm::h5io::read_column | ( | hid_t | group, |
| const std::string & | name, | ||
| std::vector< int > & | out ) |
Read a one-dimensional column into a int vector.
| [in] | group | Borrowed source group from this HDF5 instance. |
| [in] | name | Existing dataset name relative to group. |
| [out] | out | Caller-owned vector resized to the stored length and filled on success. Missing/open failures leave it unchanged; later failures may leave it resized or partly filled. |
| bool openswmm::h5io::read_column | ( | hid_t | group, |
| const std::string & | name, | ||
| std::vector< std::string > & | out ) |
Read a one-dimensional column into a std::string vector.
| [in] | group | Borrowed source group from this HDF5 instance. |
| [in] | name | Existing dataset name relative to group. |
| [out] | out | Caller-owned vector resized to the stored length and filled on success. Missing/open failures leave it unchanged; later failures may leave it resized or partly filled. |
| bool openswmm::h5io::write_attr | ( | hid_t | loc, |
| const std::string & | name, | ||
| const std::string & | value ) |
Create or replace a scalar std::string attribute.
| [in] | loc | Borrowed object or file identifier; a file targets its root group. |
| [in] | name | Attribute name, borrowed for this call. |
| [in] | value | Value to store; numeric units are caller-defined. |
| bool openswmm::h5io::write_attr | ( | hid_t | loc, |
| const std::string & | name, | ||
| double | value ) |
Create or replace a scalar double attribute.
| [in] | loc | Borrowed object or file identifier; a file targets its root group. |
| [in] | name | Attribute name, borrowed for this call. |
| [in] | value | Value to store; numeric units are caller-defined. |
| bool openswmm::h5io::write_attr | ( | hid_t | loc, |
| const std::string & | name, | ||
| int | value ) |
Create or replace a scalar int attribute.
| [in] | loc | Borrowed object or file identifier; a file targets its root group. |
| [in] | name | Attribute name, borrowed for this call. |
| [in] | value | Value to store; numeric units are caller-defined. |
| bool openswmm::h5io::write_column | ( | hid_t | group, |
| const std::string & | name, | ||
| const std::vector< double > & | values, | ||
| const std::string & | units = "", | ||
| const std::string & | description = "", | ||
| int | compression = 4 ) |
Create a one-dimensional double column with optional metadata.
| [in] | group | Borrowed destination group from this HDF5 instance. |
| [in] | name | New dataset name; an existing link is not replaced. |
| [in] | values | Borrowed column data; empty creates an explicit zero-length dataset. |
| [in] | units | Optional units attribute; empty omits it. |
| [in] | description | Optional description attribute; empty omits it. |
| [in] | compression | Deflate level 1..9; <= 0 disables compression. Empty columns are uncompressed; positive levels request chunks of up to 1024 rows. |
| bool openswmm::h5io::write_column | ( | hid_t | group, |
| const std::string & | name, | ||
| const std::vector< int > & | values, | ||
| const std::string & | units = "", | ||
| const std::string & | description = "", | ||
| int | compression = 4 ) |
Create a one-dimensional int column with optional metadata.
| [in] | group | Borrowed destination group from this HDF5 instance. |
| [in] | name | New dataset name; an existing link is not replaced. |
| [in] | values | Borrowed column data; empty creates an explicit zero-length dataset. |
| [in] | units | Optional units attribute; empty omits it. |
| [in] | description | Optional description attribute; empty omits it. |
| [in] | compression | Deflate level 1..9; <= 0 disables compression. Empty columns are uncompressed; positive levels request chunks of up to 1024 rows. |
| bool openswmm::h5io::write_column | ( | hid_t | group, |
| const std::string & | name, | ||
| const std::vector< std::string > & | values, | ||
| const std::string & | description = "", | ||
| int | compression = 4 ) |
Create a one-dimensional std::string column with optional metadata.
| [in] | group | Borrowed destination group from this HDF5 instance. |
| [in] | name | New dataset name; an existing link is not replaced. |
| [in] | values | Borrowed column data; empty creates an explicit zero-length dataset. |
| [in] | description | Optional description attribute; empty omits it. |
| [in] | compression | Deflate level 1..9; <= 0 disables compression. Empty columns are uncompressed; positive levels request chunks of up to 1024 rows. |
| int openswmm::h5io::write_model | ( | const std::string & | path, |
| const SimulationContext & | ctx, | ||
| std::vector< std::string > * | warnings = nullptr ) |
Write a complete native model and analysis columns to HDF5.
| path | Destination filename, created or truncated. |
| ctx | Model in engine internal units; not modified. |
| warnings | Optional diagnostics sink, preserved and appended to. |
|
inlineconstexpr |
|
inlineconstexpr |
Bumped on any layout change. The reader refuses a major it does not know rather than silently misreading a file written by a newer engine.
|
inlineconstexpr |