![]() |
HydroCouple
2.0.0
HydroCouple Interface Definitions
|
HydroCouple is a header-only C++20 library that defines the core interface specifications for component-based, integrated water-resources modeling. It provides pure-virtual (I-prefixed) abstract interfaces for model components, exchange items, spatial/temporal data, and geospatial geometry — analogous to and extending the Open Modeling Interface (OpenMI) standard.
HydroCouple version 2.0.0 defines five header files — each targeting a distinct modeling concern — that together describe a full component coupling framework:
| Header | Namespace | Concern |
|---|---|---|
hydrocouple.h | HydroCouple | Core model component lifecycle, exchange items, signals/slots, value types |
hydrocoupletemporal.h | HydroCouple::Temporal | Time representation, time-marching components, time-series data items |
hydrocouplespatial.h | HydroCouple::Spatial | OGC Simple Features geometry, mesh, network, raster, regular grid |
hydrocouplespatialwkb.h | *(global)* | C-compatible OGC WKB binary geometry structures |
hydrocouplespatiotemporal.h | HydroCouple::SpatioTemporal | Combined spatio-temporal component data items |
All interfaces use pure-virtual destructors and are designed to be implemented by concrete model components, with a name convention of I prefix (e.g., IModelComponent, IOutput).
HydroCouple::HydroCouple as a CMake INTERFACE target.std::variant, std::span, std::any, std::unique_ptr, and [[nodiscard]] throughout.HydroCouple::HYDROCOUPLE_ABI_VERSION = 2.ISignal<Args...> / ISlot<Args...>) built into the interface hierarchy, replacing Qt/OpenMI dependencies.HydroCoupleConfig.cmake and HydroCoupleConfigVersion.cmake with SameMajorVersion compatibility.hydrocouple..nupkg files per platform via GitHub Packages.| Tool | Minimum Version |
|---|---|
| CMake | 3.19 |
| C++ Compiler | C++20-capable (GCC 11+, Clang 13+, MSVC 19.29+) |
| vcpkg *(optional)* | any recent version |
| GoogleTest *(tests only)* | any version compatible with vcpkg gtest port |
No runtime library dependencies are required — all headers use only the C++ standard library.
Three platform presets are provided in CMakePresets.json. All inherit from the default (Ninja) preset which sets CMAKE_TOOLCHAIN_FILE to $VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake.
| Configure Preset | Generator | Condition |
|---|---|---|
default | Ninja | any host |
windows | Visual Studio 17 2022 (x64) | hostSystemName == Windows |
linux | Unix Makefiles | hostSystemName == Linux |
macos | Xcode | hostSystemName == Darwin |
| Option | Default | Description |
|---|---|---|
HYDROCOUPLE_BUILD_TESTS | OFF | Build the GoogleTest unit test suite. Requires the gtest vcpkg port. |
This installs:
hydrocouple.h, hydrocouplespatial.h, hydrocouplespatialwkb.h, hydrocouplespatiotemporal.h, hydrocoupletemporal.h, generated version.h) → ${prefix}/include/HydroCoupleConfig.cmake, HydroCoupleConfigVersion.cmake, HydroCoupleTargets.cmake) → ${prefix}/lib/cmake/HydroCouple/${prefix}/share/HydroCouple/Generates:
HydroCouple-2.0.0-win64.zip + HydroCouple.x64.windows.2.0.0.nupkgHydroCouple-2.0.0-linux.tar.gz + HydroCouple.x64.linux.2.0.0.nupkgHydroCouple-2.0.0-macos.tar.gz + HydroCouple.arm64.osx.2.0.0.nupkgNuGet packages are published to the HydroCouple GitHub Packages feed.
After installation or using a vcpkg-integrated build:
The HydroCouple::HydroCouple target is an INTERFACE library. Linking it propagates:
HYDROCOUPLE_LIBRARY compile definitioncxx_std_20 compile feature requirementAdd HydroCouple as a dependency in your vcpkg.json:
To include unit tests:
The vcpkg manifest (vcpkg.json) declares the following:
| Field | Value |
|---|---|
name | hydrocouple |
version-semver | 2.0.0 |
license | MIT |
homepage | https://hydrocouple.org |
| Host dependencies | vcpkg-cmake, vcpkg-cmake-config |
Optional feature tests | adds gtest |
| Default features | tests |
The registry is configured to the official Microsoft vcpkg registry at baseline 13bde2ff13192e1b2fdd37bd9b475c7665ae6ae5.
HydroCouple version 2.0.0 provides five header files defining interfaces for component-based integrated modeling:
| Header | Namespace | Purpose |
|---|---|---|
**hydrocouple.h** | HydroCouple | Core component lifecycle (IModelComponent), exchange items (IInput/IOutput), signal/slot pattern, units, value definitions, and component metadata |
**hydrocoupletemporal.h** | HydroCouple::Temporal | Time representation (IDateTime, ITimeSpan), time-marching components (ITimeModelComponent), and time-series data items |
**hydrocouplespatial.h** | HydroCouple::Spatial | OGC Simple Features geometry hierarchy (IGeometry, IPoint, IPolygon, etc.), spatial reference systems, networks, rasters, and regular grids |
**hydrocouplespatialwkb.h** | *(global)* | C-compatible OGC WKB (Well-Known Binary) geometry structures for serialization |
**hydrocouplespatiotemporal.h** | HydroCouple::SpatioTemporal | Combined spatio-temporal data items (e.g., ITimeGeometryComponentDataItem, ITimeSeriesRasterComponentDataItem) |
All interfaces are pure-virtual with an I prefix (e.g., IModelComponent) and designed for implementation by concrete model components. The library uses C++20 features (std::variant, std::span, std::any) and provides a lightweight signal/slot mechanism for inter-component communication.
For detailed API documentation, see https://www.hydrocouple.org/hydrocoupledocs/html/index.html
Unit tests are built when HYDROCOUPLE_BUILD_TESTS=ON. The test executable is hydrocouple_tests, linked against the HydroCouple, GTest::gtest, and GTest::gtest_main targets, and uses gtest_discover_tests() for CTest integration.
Test file test_hydrocouple.cpp covers:
ByteOrder enum class values and implicit-conversion behaviourhydrocouple_variant: all signed/unsigned numeric types, std::string, std::anyTest file test_spatial_wkb.cpp covers:
WKBByteOrder enum class values, underlying type (uint8_t)WKBGeometryType enum class: 2D, Z, M, and ZM type codesPoint, PointZ, PointM, PointZM struct sizes, trivially_copyable, standard_layout, trivially_default_constructibleThree GitHub Actions workflows run on every push and pull request to master and dev:
| Workflow file | Name | What it does | Platforms |
|---|---|---|---|
build_and_unit_test.yml | Build and Unit Test | Configures with HYDROCOUPLE_BUILD_TESTS=ON, builds, and runs ctest | ubuntu-latest (x64-linux), macos-latest (arm64-osx), windows-latest (x64-windows) |
build_and_package.yml | Build and Package | Configures with HYDROCOUPLE_BUILD_TESTS=OFF, runs CPack to produce .tar.gz/.zip/.nupkg, pushes NuGet packages to GitHub Packages | ubuntu-latest, macos-latest, windows-latest |
build_docs.yml | Build Documentation | Installs Doxygen + Graphviz, builds HTML docs, deploys to GitHub Pages, uploads hydrocouple_docs.tar.gz artifact | ubuntu-latest |
All workflows use vcpkg at ref 2025.02.14 and cache packages via the GitHub NuGet feed (https://nuget.pkg.github.com/HydroCouple/index.json).
Full Doxygen API documentation is available at: https://www.hydrocouple.org/hydrocoupledocs/html/index.html
If you use HydroCouple in your research, please cite:
BibTeX:
ORCID: 0000-0002-9859-2264
HydroCouple is released under the [MIT License](License).
Copyright © 2025 HydroCouple / Caleb Buahin.