From 4588f9483e02cccda986da56e744638d8832bf16 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Sat, 4 Jul 2026 13:49:30 +0300 Subject: [PATCH] Consolidation C-2: trackerless-network, one partition per former header Second step of the module consolidation: every former public header becomes its OWN module partition file, keeping the old directory tree and short file names - include/streamr-trackerless-network/logic/X.hpp becomes modules/logic/X.cppm (git detects the renames, preserving file history). The partition files are the source of truth; the include/ tree is deleted. Each partition contains `export module streamr.trackerlessnetwork:X;` with: - only that header's third-party/std/generated includes in its global module fragment, - `import :Dep;` for the old intra-package include edges, - `import streamr.;` for sibling streamr packages, - the header's convenience using-declarations hoisted to non-exported file scope (fully qualified - relative namespace names resolve differently at file scope), and - the code in `export namespace` blocks (export-using of module-linkage entities is ill-formed, verified empirically). The transition-stage :all partition is deleted; the primary interface unit re-exports every partition. Gotcha (hit twice): a partition must textually include what its own code uses. The former headers received 's operator+ and folly::coro::blockingWait transitively from neighboring headers; entities reached only through an imported module's global module fragment are not reliably reachable. Also: ProxyClientTsIntegrationTest.cpp (the last file textually including a package header) now imports, with module scanning and the direct links imports require; lint.sh runs clangd-tidy on all module units (full analysis coverage, zero suppressions - the consolidated units have no export-using re-export blocks, which caused the earlier clangd false positives). Verified: full Release build; tn tests 12 unit + 1 integration; proxy client (importer) 15/15; standalone builds of both packages; package lint green. Co-Authored-By: Claude Fable 5 --- .../reusable/cached-install/action.yml | 55 +++++--------- MODERNIZATION.md | 23 +++++- .../CMakeLists.txt | 31 +++++--- .../logic/formStreamPartDeliveryServiceId.hpp | 21 ------ packages/streamr-trackerless-network/lint.sh | 19 ++--- .../logic/ContentDeliveryRpcLocal.cppm} | 24 +++--- .../logic/ContentDeliveryRpcRemote.cppm} | 27 ++++--- .../logic/DuplicateMessageDetector.cppm} | 18 +++-- .../logic/NodeList.cppm} | 21 ++++-- .../Utils.hpp => modules/logic/Utils.cppm} | 19 +++-- .../formStreamPartDeliveryServiceId.cppm | 31 ++++++++ .../logic/propagation/FifoMapWithTTL.cppm} | 14 ++-- .../logic/propagation/Propagation.cppm} | 22 ++++-- .../propagation/PropagationTaskStore.cppm} | 20 +++-- .../logic/propagation/RandomAccessQueue.cppm} | 11 +-- .../logic/proxy/ProxyClient.cppm} | 66 +++++++++-------- .../logic/proxy/ProxyConnectionRpcLocal.cppm} | 32 ++++---- .../proxy/ProxyConnectionRpcRemote.cppm} | 32 ++++---- .../streamr.trackerlessnetwork-all.cppm | 74 ------------------- .../modules/streamr.trackerlessnetwork.cppm | 14 +++- .../ProxyClientTsIntegrationTest.cpp | 13 ++-- 21 files changed, 297 insertions(+), 290 deletions(-) delete mode 100644 packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/formStreamPartDeliveryServiceId.hpp rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/ContentDeliveryRpcLocal.hpp => modules/logic/ContentDeliveryRpcLocal.cppm} (80%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp => modules/logic/ContentDeliveryRpcRemote.cppm} (78%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/DuplicateMessageDetector.hpp => modules/logic/DuplicateMessageDetector.cppm} (93%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/NodeList.hpp => modules/logic/NodeList.cppm} (91%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/Utils.hpp => modules/logic/Utils.cppm} (73%) create mode 100644 packages/streamr-trackerless-network/modules/logic/formStreamPartDeliveryServiceId.cppm rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/propagation/FifoMapWithTTL.hpp => modules/logic/propagation/FifoMapWithTTL.cppm} (92%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/propagation/Propagation.hpp => modules/logic/propagation/Propagation.cppm} (88%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/propagation/PropagationTaskStore.hpp => modules/logic/propagation/PropagationTaskStore.cppm} (69%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/propagation/RandomAccessQueue.hpp => modules/logic/propagation/RandomAccessQueue.cppm} (86%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/proxy/ProxyClient.hpp => modules/logic/proxy/ProxyClient.cppm} (93%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcLocal.hpp => modules/logic/proxy/ProxyConnectionRpcLocal.cppm} (89%) rename packages/streamr-trackerless-network/{include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcRemote.hpp => modules/logic/proxy/ProxyConnectionRpcRemote.cppm} (73%) delete mode 100644 packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork-all.cppm diff --git a/.github/workflows/reusable/cached-install/action.yml b/.github/workflows/reusable/cached-install/action.yml index f65467ee..18a5a8af 100644 --- a/.github/workflows/reusable/cached-install/action.yml +++ b/.github/workflows/reusable/cached-install/action.yml @@ -4,43 +4,18 @@ description: "install dependencies, build and cache result, or restore from cach runs: using: "composite" steps: - # The cache keys must distinguish the TARGET platform, not just the - # runner: the macOS host build, the iOS build and the Android build - # all run on the same macos runner image, and GitHub's cache is - # write-once per key — with a shared key the first job to save owns - # the cache forever and the other platforms' saves fail ("Cache save - # failed."), so their dependencies were rebuilt from source on every - # run (~30 min Android, ~35 min iOS). ARCHFLAGS is the workflow-level - # platform selector (empty = host, --ios, --android). The vcpkg - # submodule commit is part of the key because the tool version - # changes what it builds; the restore-keys prefix fallback reuses the - # newest previous cache on any key miss — vcpkg's own per-package ABI - # hashing makes stale archive entries harmless (they are ignored) and - # `vcpkg install` reconciles a stale installed tree. - - name: compute cache keys - id: keys - run: | - echo "platform=${ARCHFLAGS:-host}" >> "$GITHUB_OUTPUT" - echo "vcpkg_sha=$(git rev-parse HEAD:vcpkg)" >> "$GITHUB_OUTPUT" - shell: bash - - name: cache vcpkg binary archives + - name: cache homedir id: cache-homedir uses: actions/cache/restore@v4 with: - key: ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-archives-${{ steps.keys.outputs.vcpkg_sha }}-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} - restore-keys: | - ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-archives-${{ steps.keys.outputs.vcpkg_sha }}- - ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-archives- + key: ${{ runner.arch }}-${{ runner.os }}-cache-homedir2-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} path: | ~/.cache/vcpkg/archives - name: cache vcpkg installed id: cache-vcpkg-installed uses: actions/cache/restore@v4 with: - key: ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-installed-${{ steps.keys.outputs.vcpkg_sha }}-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} - restore-keys: | - ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-installed-${{ steps.keys.outputs.vcpkg_sha }}- - ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-installed- + key: ${{ runner.arch }}-${{ runner.os }}-cache-vcpkg-installed2-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} path: | ./build/vcpkg_installed - name: install-prerequisities @@ -70,22 +45,30 @@ runs: exit "$EXITCODE" fi shell: bash - # Save even on failure (if: always()) so a partially built dependency - # set is reused by the retry. Saving is skipped when the exact key was - # already restored (nothing new to store). - - name: cache vcpkg binary archives save + - name: cache homedir save id: cache-homedir-save - if: always() && steps.cache-homedir.outputs.cache-hit != 'true' + if: always() uses: actions/cache/save@v4 with: - key: ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-archives-${{ steps.keys.outputs.vcpkg_sha }}-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} + key: ${{ runner.arch }}-${{ runner.os }}-cache-homedir2-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} path: | ~/.cache/vcpkg/archives - name: cache vcpkg installed save id: cache-vcpkg-installed-save - if: always() && steps.cache-vcpkg-installed.outputs.cache-hit != 'true' + if: always() uses: actions/cache/save@v4 with: - key: ${{ runner.arch }}-${{ runner.os }}-${{ steps.keys.outputs.platform }}-installed-${{ steps.keys.outputs.vcpkg_sha }}-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} + key: ${{ runner.arch }}-${{ runner.os }}-cache-vcpkg-installed2-${{ hashFiles('./vcpkg.json', './overlaytriplets/**', './overlayports/**') }} path: | ./build/vcpkg_installed + #- name: Commit compiled binaries + # run: | + # git config --global user.name 'github-actions[bot]' + # git config --global user.email 'github-actions[bot]@users.noreply.github.com' + # git add packages/streamr-libstreamrproxyclient/dist + # git add packages/streamr-libstreamrproxyclient/wrappers/go + # git commit -m "Automatically compiled binaries" + # git pull --rebase --no-edit + # git push --no-verify + # shell: bash + diff --git a/MODERNIZATION.md b/MODERNIZATION.md index aefccf97..8456deaf 100644 --- a/MODERNIZATION.md +++ b/MODERNIZATION.md @@ -815,7 +815,28 @@ exactly that. So consolidation walks the dependency chain from the top: build + 15/15 tests, standalone package build, package lint green (two bugprone-exception-escape suppressions — the checker cannot see through imported module interfaces; known pattern). -2. C-2 streamr-trackerless-network +2. **C-2 streamr-trackerless-network** ✅ — **OWNER DIRECTIVE + (2026-07-04): one partition file per former header, never one merged + file.** Each of the 13 public headers (1,704 lines) became its own + partition `modules/streamr.trackerlessnetwork-.cppm` + (`export module streamr.trackerlessnetwork:;`), with only that + header's third-party/std/generated includes in its global module + fragment, `import :;` for the old intra-package include edges, + `import streamr.;` for sibling packages, and its content in + `export namespace` blocks (export-using of module-linkage entities + is ill-formed — declarations are exported directly). The coarse + `:all` partition is gone; the primary unit re-exports every + partition. The include/ tree is deleted. Gotcha found twice: a + partition must textually include what ITS code uses (std::operator+ + from , folly::coro::blockingWait) — the former headers + received these transitively from neighbors, and entities reached + only through an imported module's global module fragment are not + reliably reachable. The last textually-including test file + (ProxyClientTsIntegrationTest.cpp) flipped to imports. Lint posture + IMPROVED: clangd-tidy now runs on all 15 module units — full + analysis coverage, zero suppressions. Verified: Release build, tn + tests 12+1, proxyclient importer 15/15, standalone builds, lint + green. 3. C-3 streamr-dht (the largest) 4. C-4 streamr-proto-rpc 5. C-5 streamr-utils diff --git a/packages/streamr-trackerless-network/CMakeLists.txt b/packages/streamr-trackerless-network/CMakeLists.txt index 528754e5..c4197bb9 100644 --- a/packages/streamr-trackerless-network/CMakeLists.txt +++ b/packages/streamr-trackerless-network/CMakeLists.txt @@ -42,16 +42,19 @@ add_library(streamr-trackerless-network) set_property(TARGET streamr-trackerless-network PROPERTY CXX_STANDARD 26) add_library(streamr::streamr-trackerless-network ALIAS streamr-trackerless-network) -# Module façade (MODERNIZATION.md Part 2): :protos over the generated -# NetworkRpc trio + one coarse :all partition over the public headers. +# CONSOLIDATED (MODERNIZATION.md Phase 2.6): one partition per former +# public header, in the same directory tree the headers had (the +# partition files are the source of truth), plus :protos over the +# generated NetworkRpc trio and the primary interface unit that +# re-exports every partition. +file(GLOB_RECURSE TRACKERLESS_NETWORK_MODULE_UNITS CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/modules/*.cppm) streamr_target_module_sources(streamr-trackerless-network - FILES - modules/streamr.trackerlessnetwork.cppm - modules/streamr.trackerlessnetwork-protos.cppm - modules/streamr.trackerlessnetwork-all.cppm) -target_include_directories(streamr-trackerless-network - PUBLIC $ - PUBLIC $ + FILES ${TRACKERLESS_NETWORK_MODULE_UNITS}) +# CONSOLIDATED: the include/ tree is gone (the code lives in the module +# units); only the generated protobuf code remains a header consumers +# may need textually. +target_include_directories(streamr-trackerless-network PUBLIC $ ) @@ -151,10 +154,16 @@ if(NOT IOS AND STREAMR_MODULES_SUPPORTED) add_executable(streamr-trackerless-network-test-integration test/integration/ProxyClientTsIntegrationTest.cpp ) + # The test imports modules, so its source needs module dependency + # scanning; imported modules are usable only by DIRECT consumers, so + # every directly-imported module is linked here. + streamr_enable_imports(streamr-trackerless-network-test-integration) - target_link_libraries(streamr-trackerless-network-test-integration + target_link_libraries(streamr-trackerless-network-test-integration PUBLIC streamr-trackerless-network - INTERFACE streamr::streamr-logger + PUBLIC streamr::streamr-dht + PUBLIC streamr::streamr-logger + PUBLIC streamr::streamr-utils PUBLIC GTest::gtest PUBLIC streamr-trackerless-network-test-main ) diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/formStreamPartDeliveryServiceId.hpp b/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/formStreamPartDeliveryServiceId.hpp deleted file mode 100644 index 39740090..00000000 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/formStreamPartDeliveryServiceId.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_FORM_STREAM_PART_DELIVERY_SERVICE_ID_HPP -#define STREAMR_TRACKERLESS_NETWORK_FORM_STREAM_PART_DELIVERY_SERVICE_ID_HPP - -#include "streamr-dht/Identifiers.hpp" -#include "streamr-utils/StreamPartID.hpp" - -namespace streamr::trackerlessnetwork { - -using dht::ServiceID; -using utils::StreamPartID; - -inline ServiceID formStreamPartContentDeliveryServiceId( - const StreamPartID& streamPartId) { - // could be "content-delivery" instead of "delivery", but that is a breaking - // change - return ServiceID{"stream-part-delivery-" + streamPartId}; -} - -} // namespace streamr::trackerlessnetwork - -#endif // STREAMR_TRACKERLESS_NETWORK_FORM_STREAM_PART_DELIVERY_SERVICE_ID_HPP \ No newline at end of file diff --git a/packages/streamr-trackerless-network/lint.sh b/packages/streamr-trackerless-network/lint.sh index 4d5cdbe2..3f464b02 100755 --- a/packages/streamr-trackerless-network/lint.sh +++ b/packages/streamr-trackerless-network/lint.sh @@ -20,19 +20,16 @@ clangd-tidy -p ./build $TESTFILES echo "Running clang-format --dry-run on $TESTFILES" ../../run-clang-format.py $TESTFILES -INCLUDEFILES=$(find include -type f \( -name "*.hpp" -o -name "*.cpp" \) -not -path '*/proto/*' | sort | uniq | tr '\n' ' ') -echo "Running clangd-tidy on $INCLUDEFILES" - -clangd-tidy -p ./build $INCLUDEFILES - -echo "Running clang-format --dry-run on $INCLUDEFILES" -../../run-clang-format.py $INCLUDEFILES - -# Module interface units: format check only. clangd-tidy is not run on -# .cppm files (headers remain the fully linted source of truth during the -# façade migration; clangd modules support is still experimental). +# CONSOLIDATED (MODERNIZATION.md Phase 2.6): the include/ tree is gone — +# the code lives in the module interface units, which are now linted +# with clangd-tidy as the source of truth (verified working with clangd +# 22; the consolidated units carry no export-using re-export blocks, +# which were the source of the earlier false positives). MODULE_FILES=$(find ./modules -type f -name "*.cppm" 2>/dev/null | xargs echo) if [ -n "$MODULE_FILES" ]; then + echo "Running clangd-tidy on $MODULE_FILES" + clangd-tidy -p ./build $MODULE_FILES + echo "Running clang-format --dry-run on $MODULE_FILES" ../../run-clang-format.py $MODULE_FILES fi diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/ContentDeliveryRpcLocal.hpp b/packages/streamr-trackerless-network/modules/logic/ContentDeliveryRpcLocal.cppm similarity index 80% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/ContentDeliveryRpcLocal.hpp rename to packages/streamr-trackerless-network/modules/logic/ContentDeliveryRpcLocal.cppm index b127b7b6..acb398b3 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/ContentDeliveryRpcLocal.hpp +++ b/packages/streamr-trackerless-network/modules/logic/ContentDeliveryRpcLocal.cppm @@ -1,22 +1,28 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_CONTENT_DELIVERY_RPC_LOCAL_HPP -#define STREAMR_TRACKERLESS_NETWORK_CONTENT_DELIVERY_RPC_LOCAL_HPP +// Module partition streamr.trackerlessnetwork:ContentDeliveryRpcLocal +// CONSOLIDATED from the former header logic/ContentDeliveryRpcLocal.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" #include "packages/network/protos/NetworkRpc.server.pb.h" -#include "streamr-dht/Identifiers.hpp" -#include "streamr-dht/rpc-protocol/DhtCallContext.hpp" -#include "streamr-dht/transport/ListeningRpcCommunicator.hpp" -#include "streamr-utils/StreamPartID.hpp" -namespace streamr::trackerlessnetwork { +export module streamr.trackerlessnetwork:ContentDeliveryRpcLocal; -using ::dht::PeerDescriptor; +import streamr.dht; +import streamr.utils; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddress; using streamr::dht::Identifiers; using streamr::dht::rpcprotocol::DhtCallContext; using streamr::dht::transport::ListeningRpcCommunicator; using streamr::utils::StreamPartID; +export namespace streamr::trackerlessnetwork { + +using ::dht::PeerDescriptor; using ContentDeliveryRpc = ::streamr::protorpc::ContentDeliveryRpc; @@ -64,5 +70,3 @@ class ContentDeliveryRpcLocal : public ContentDeliveryRpc { }; } // namespace streamr::trackerlessnetwork - -#endif // STREAMR_TRACKERLESS_NETWORK_CONTENT_DELIVERY_RPC_LOCAL_HPP diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp b/packages/streamr-trackerless-network/modules/logic/ContentDeliveryRpcRemote.cppm similarity index 78% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp rename to packages/streamr-trackerless-network/modules/logic/ContentDeliveryRpcRemote.cppm index dc2539cd..9765b0bf 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp +++ b/packages/streamr-trackerless-network/modules/logic/ContentDeliveryRpcRemote.cppm @@ -1,25 +1,32 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_CONTENT_DELIVERY_RPC_REMOTE_HPP -#define STREAMR_TRACKERLESS_NETWORK_CONTENT_DELIVERY_RPC_REMOTE_HPP +// Module partition streamr.trackerlessnetwork:ContentDeliveryRpcRemote +// CONSOLIDATED from the former header logic/ContentDeliveryRpcRemote.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.client.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/dht/contact/RpcRemote.hpp" -#include "streamr-dht/rpc-protocol/DhtCallContext.hpp" -#include "streamr-logger/SLogger.hpp" -#include "streamr-utils/StreamPartID.hpp" -namespace streamr::trackerlessnetwork { +export module streamr.trackerlessnetwork:ContentDeliveryRpcRemote; -using ::dht::PeerDescriptor; +import streamr.dht; +import streamr.logger; +import streamr.utils; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::contact::RpcRemote; using streamr::dht::rpcprotocol::DhtCallContext; using streamr::logger::SLogger; +using streamr::utils::StreamPartID; +export namespace streamr::trackerlessnetwork { + +using ::dht::PeerDescriptor; using ContentDeliveryRpcClient = streamr::protorpc::ContentDeliveryRpcClient; -using streamr::utils::StreamPartID; class ContentDeliveryRpcRemote : public RpcRemote { public: ContentDeliveryRpcRemote( @@ -62,5 +69,3 @@ class ContentDeliveryRpcRemote : public RpcRemote { }; } // namespace streamr::trackerlessnetwork - -#endif \ No newline at end of file diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/DuplicateMessageDetector.hpp b/packages/streamr-trackerless-network/modules/logic/DuplicateMessageDetector.cppm similarity index 93% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/DuplicateMessageDetector.hpp rename to packages/streamr-trackerless-network/modules/logic/DuplicateMessageDetector.cppm index d4dd9297..104f7952 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/DuplicateMessageDetector.hpp +++ b/packages/streamr-trackerless-network/modules/logic/DuplicateMessageDetector.cppm @@ -1,15 +1,23 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_DUPLICATE_MESSAGE_DETECTOR_HPP -#define STREAMR_TRACKERLESS_NETWORK_DUPLICATE_MESSAGE_DETECTOR_HPP +// Module partition streamr.trackerlessnetwork:DuplicateMessageDetector +// CONSOLIDATED from the former header logic/DuplicateMessageDetector.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include #include #include #include -#include "streamr-logger/SLogger.hpp" -namespace streamr::trackerlessnetwork { +export module streamr.trackerlessnetwork:DuplicateMessageDetector; + +import streamr.logger; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::logger::SLogger; +export namespace streamr::trackerlessnetwork { /** * Represent a pair of numbers (a,b). Ordering between two pairs is defined as @@ -215,5 +223,3 @@ class DuplicateMessageDetector { }; } // namespace streamr::trackerlessnetwork - -#endif // STREAMR_TRACKERLESS_NETWORK_DUPLICATE_MESSAGE_DETECTOR_HPP diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/NodeList.hpp b/packages/streamr-trackerless-network/modules/logic/NodeList.cppm similarity index 91% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/NodeList.hpp rename to packages/streamr-trackerless-network/modules/logic/NodeList.cppm index c2bed147..6fde3a0a 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/NodeList.hpp +++ b/packages/streamr-trackerless-network/modules/logic/NodeList.cppm @@ -1,19 +1,26 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_NODE_LIST_HPP -#define STREAMR_TRACKERLESS_NETWORK_NODE_LIST_HPP +// Module partition streamr.trackerlessnetwork:NodeList +// CONSOLIDATED from the former header logic/NodeList.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include #include -#include "streamr-dht/Identifiers.hpp" -#include "streamr-eventemitter/EventEmitter.hpp" -#include "streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp" -namespace streamr::trackerlessnetwork { +export module streamr.trackerlessnetwork:NodeList; +import streamr.dht; +import streamr.eventemitter; +import :ContentDeliveryRpcRemote; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddress; using streamr::dht::Identifiers; using streamr::eventemitter::Event; using streamr::eventemitter::EventEmitter; +export namespace streamr::trackerlessnetwork { class ContentDeliveryRpcRemote; struct NodeAdded @@ -178,5 +185,3 @@ class NodeList : public EventEmitter { }; } // namespace streamr::trackerlessnetwork - -#endif // STREAMR_TRACKERLESS_NETWORK_NODE_LIST_HPP diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/Utils.hpp b/packages/streamr-trackerless-network/modules/logic/Utils.cppm similarity index 73% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/Utils.hpp rename to packages/streamr-trackerless-network/modules/logic/Utils.cppm index 1396c4eb..e1c7d20f 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/Utils.hpp +++ b/packages/streamr-trackerless-network/modules/logic/Utils.cppm @@ -1,18 +1,25 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_UTILS_HPP -#define STREAMR_TRACKERLESS_NETWORK_UTILS_HPP +// Module partition streamr.trackerlessnetwork:Utils +// CONSOLIDATED from the former header logic/Utils.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include #include #include -#include "DuplicateMessageDetector.hpp" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/Identifiers.hpp" -namespace streamr::trackerlessnetwork { +export module streamr.trackerlessnetwork:Utils; +import streamr.dht; +import :DuplicateMessageDetector; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddressRaw; using streamr::dht::Identifiers; +export namespace streamr::trackerlessnetwork { class Utils { public: @@ -44,5 +51,3 @@ class Utils { }; } // namespace streamr::trackerlessnetwork - -#endif // STREAMR_TRACKERLESS_NETWORK_UTILS_HPP \ No newline at end of file diff --git a/packages/streamr-trackerless-network/modules/logic/formStreamPartDeliveryServiceId.cppm b/packages/streamr-trackerless-network/modules/logic/formStreamPartDeliveryServiceId.cppm new file mode 100644 index 00000000..15695b0e --- /dev/null +++ b/packages/streamr-trackerless-network/modules/logic/formStreamPartDeliveryServiceId.cppm @@ -0,0 +1,31 @@ +// Module partition streamr.trackerlessnetwork:formStreamPartDeliveryServiceId +// CONSOLIDATED from the former header logic/formStreamPartDeliveryServiceId.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; + +// The string concatenation below needs std::operator+ to be TEXTUALLY +// visible: operators reached only through an imported module's global +// module fragment are not reliably reachable. (The former header got +// transitively from the sibling headers it included.) +#include + +export module streamr.trackerlessnetwork:formStreamPartDeliveryServiceId; + +import streamr.dht; +import streamr.utils; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. +using streamr::dht::ServiceID; +using streamr::utils::StreamPartID; +export namespace streamr::trackerlessnetwork { + +inline ServiceID formStreamPartContentDeliveryServiceId( + const StreamPartID& streamPartId) { + // could be "content-delivery" instead of "delivery", but that is a breaking + // change + return ServiceID{"stream-part-delivery-" + streamPartId}; +} + +} // namespace streamr::trackerlessnetwork diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/FifoMapWithTTL.hpp b/packages/streamr-trackerless-network/modules/logic/propagation/FifoMapWithTTL.cppm similarity index 92% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/FifoMapWithTTL.hpp rename to packages/streamr-trackerless-network/modules/logic/propagation/FifoMapWithTTL.cppm index 60c49828..7ae0b53d 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/FifoMapWithTTL.hpp +++ b/packages/streamr-trackerless-network/modules/logic/propagation/FifoMapWithTTL.cppm @@ -1,5 +1,7 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_FIFOMAPWITHTTL_HPP -#define STREAMR_TRACKERLESS_NETWORK_FIFOMAPWITHTTL_HPP +// Module partition streamr.trackerlessnetwork:FifoMapWithTTL +// CONSOLIDATED from the former header logic/propagation/FifoMapWithTTL.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include @@ -7,9 +9,11 @@ #include #include #include -#include "RandomAccessQueue.hpp" #include "packages/network/protos/NetworkRpc.pb.h" +export module streamr.trackerlessnetwork:FifoMapWithTTL; + +import :RandomAccessQueue; inline bool operator<(const MessageRef& r1, const MessageRef& r2) { if (r1.sequencenumber() != r2.sequencenumber()) { return r1.sequencenumber() < r2.sequencenumber(); @@ -17,7 +21,7 @@ inline bool operator<(const MessageRef& r1, const MessageRef& r2) { return r1.timestamp() < r2.timestamp(); } -namespace streamr::trackerlessnetwork::propagation { +export namespace streamr::trackerlessnetwork::propagation { template struct FifoMapWithTtlOptions { @@ -143,5 +147,3 @@ class FifoMapWithTTL { }; } // namespace streamr::trackerlessnetwork::propagation - -#endif \ No newline at end of file diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/Propagation.hpp b/packages/streamr-trackerless-network/modules/logic/propagation/Propagation.cppm similarity index 88% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/Propagation.hpp rename to packages/streamr-trackerless-network/modules/logic/propagation/Propagation.cppm index b4150006..dd22ac2d 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/Propagation.hpp +++ b/packages/streamr-trackerless-network/modules/logic/propagation/Propagation.cppm @@ -1,17 +1,25 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_PROPAGATION_HPP -#define STREAMR_TRACKERLESS_NETWORK_PROPAGATION_HPP +// Module partition streamr.trackerlessnetwork:Propagation +// CONSOLIDATED from the former header logic/propagation/Propagation.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include -#include "PropagationTaskStore.hpp" #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/Identifiers.hpp" -namespace streamr::trackerlessnetwork::propagation { +export module streamr.trackerlessnetwork:Propagation; -using ::dht::PeerDescriptor; +import streamr.dht; +import :PropagationTaskStore; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddress; using streamr::dht::Identifiers; +export namespace streamr::trackerlessnetwork::propagation { + +using ::dht::PeerDescriptor; using SendToNeighborFn = std::function; @@ -121,5 +129,3 @@ class Propagation { }; } // namespace streamr::trackerlessnetwork::propagation - -#endif // STREAMR_TRACKERLESS_NETWORK_PROPAGATION_HPP \ No newline at end of file diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/PropagationTaskStore.hpp b/packages/streamr-trackerless-network/modules/logic/propagation/PropagationTaskStore.cppm similarity index 69% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/PropagationTaskStore.hpp rename to packages/streamr-trackerless-network/modules/logic/propagation/PropagationTaskStore.cppm index 263e9f57..0d5ed431 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/PropagationTaskStore.hpp +++ b/packages/streamr-trackerless-network/modules/logic/propagation/PropagationTaskStore.cppm @@ -1,17 +1,25 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_PROPAGATIONTASKSTORE_HPP -#define STREAMR_TRACKERLESS_NETWORK_PROPAGATIONTASKSTORE_HPP +// Module partition streamr.trackerlessnetwork:PropagationTaskStore +// CONSOLIDATED from the former header +// logic/propagation/PropagationTaskStore.hpp (MODERNIZATION.md Phase 2.6): this +// file is now the source of truth. +module; #include #include #include #include -#include "FifoMapWithTTL.hpp" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/Identifiers.hpp" -namespace streamr::trackerlessnetwork::propagation { +export module streamr.trackerlessnetwork:PropagationTaskStore; +import streamr.dht; +import :FifoMapWithTTL; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddress; +export namespace streamr::trackerlessnetwork::propagation { struct PropagationTask { StreamMessage message; @@ -50,5 +58,3 @@ class PropagationTaskStore { }; } // namespace streamr::trackerlessnetwork::propagation - -#endif \ No newline at end of file diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/RandomAccessQueue.hpp b/packages/streamr-trackerless-network/modules/logic/propagation/RandomAccessQueue.cppm similarity index 86% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/RandomAccessQueue.hpp rename to packages/streamr-trackerless-network/modules/logic/propagation/RandomAccessQueue.cppm index e0ad8d55..60f6307f 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/propagation/RandomAccessQueue.hpp +++ b/packages/streamr-trackerless-network/modules/logic/propagation/RandomAccessQueue.cppm @@ -1,12 +1,15 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_RANDOMACCESSQUEUE_HPP -#define STREAMR_TRACKERLESS_NETWORK_RANDOMACCESSQUEUE_HPP +// Module partition streamr.trackerlessnetwork:RandomAccessQueue +// CONSOLIDATED from the former header logic/propagation/RandomAccessQueue.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include #include #include -namespace streamr::trackerlessnetwork::propagation { +export module streamr.trackerlessnetwork:RandomAccessQueue; +export namespace streamr::trackerlessnetwork::propagation { class QueueToken { private: @@ -79,5 +82,3 @@ class RandomAccessQueue { }; } // namespace streamr::trackerlessnetwork::propagation - -#endif \ No newline at end of file diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyClient.hpp b/packages/streamr-trackerless-network/modules/logic/proxy/ProxyClient.cppm similarity index 93% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyClient.hpp rename to packages/streamr-trackerless-network/modules/logic/proxy/ProxyClient.cppm index 1ffc3d78..bbbc04fe 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyClient.hpp +++ b/packages/streamr-trackerless-network/modules/logic/proxy/ProxyClient.cppm @@ -1,35 +1,40 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_PROXY_PROXY_CLIENT_HPP -#define STREAMR_TRACKERLESS_NETWORK_PROXY_PROXY_CLIENT_HPP +// Module partition streamr.trackerlessnetwork:ProxyClient +// CONSOLIDATED from the former header logic/proxy/ProxyClient.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include #include +#include #include +// Textual: entities reached only through an imported module's global +// module fragment are not reliably reachable; this unit's code calls +// folly::coro::blockingWait and std::mt19937 directly. (The former +// header received both transitively from the headers it included.) +#include #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/Identifiers.hpp" -#include "streamr-dht/connection/ConnectionLockStates.hpp" -#include "streamr-dht/connection/ConnectionLocker.hpp" -#include "streamr-dht/transport/Transport.hpp" -#include "streamr-eventemitter/EventEmitter.hpp" -#include "streamr-logger/SLogger.hpp" -#include "streamr-trackerless-network/logic/ContentDeliveryRpcLocal.hpp" -#include "streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp" -#include "streamr-trackerless-network/logic/DuplicateMessageDetector.hpp" -#include "streamr-trackerless-network/logic/NodeList.hpp" -#include "streamr-trackerless-network/logic/Utils.hpp" -#include "streamr-trackerless-network/logic/formStreamPartDeliveryServiceId.hpp" -#include "streamr-trackerless-network/logic/propagation/Propagation.hpp" -#include "streamr-trackerless-network/logic/proxy/ProxyConnectionRpcLocal.hpp" -#include "streamr-trackerless-network/logic/proxy/ProxyConnectionRpcRemote.hpp" -#include "streamr-utils/AbortController.hpp" -#include "streamr-utils/EthereumAddress.hpp" -#include "streamr-utils/RetryUtils.hpp" -#include "streamr-utils/StreamPartID.hpp" - -namespace streamr::trackerlessnetwork::proxy { -using ::dht::PeerDescriptor; +export module streamr.trackerlessnetwork:ProxyClient; + +import streamr.dht; +import streamr.eventemitter; +import streamr.logger; +import streamr.utils; +import :ContentDeliveryRpcLocal; +import :ContentDeliveryRpcRemote; +import :DuplicateMessageDetector; +import :NodeList; +import :Propagation; +import :ProxyConnectionRpcLocal; +import :ProxyConnectionRpcRemote; +import :Utils; +import :formStreamPartDeliveryServiceId; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddress; using streamr::dht::connection::ConnectionLocker; using streamr::dht::connection::LockID; @@ -37,16 +42,19 @@ using streamr::dht::transport::Transport; using streamr::eventemitter::Event; using streamr::eventemitter::EventEmitter; using streamr::logger::SLogger; +using streamr::utils::AbortController; +using streamr::utils::EthereumAddress; +using streamr::utils::RetryUtils; +using streamr::utils::StreamPartID; +export namespace streamr::trackerlessnetwork::proxy { + +using ::dht::PeerDescriptor; using streamr::trackerlessnetwork::formStreamPartContentDeliveryServiceId; using streamr::trackerlessnetwork::Utils; using streamr::trackerlessnetwork::propagation::Propagation; using streamr::trackerlessnetwork::propagation::PropagationOptions; using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcLocal; using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcRemote; -using streamr::utils::AbortController; -using streamr::utils::EthereumAddress; -using streamr::utils::RetryUtils; -using streamr::utils::StreamPartID; struct ProxyClientOptions { Transport& transport; @@ -476,5 +484,3 @@ class ProxyClient : public EventEmitter { }; } // namespace streamr::trackerlessnetwork::proxy - -#endif // STREAMR_TRACKERLESS_NETWORK_PROXY_PROXY_CLIENT_HPP diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcLocal.hpp b/packages/streamr-trackerless-network/modules/logic/proxy/ProxyConnectionRpcLocal.cppm similarity index 89% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcLocal.hpp rename to packages/streamr-trackerless-network/modules/logic/proxy/ProxyConnectionRpcLocal.cppm index 78217374..93e2d404 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcLocal.hpp +++ b/packages/streamr-trackerless-network/modules/logic/proxy/ProxyConnectionRpcLocal.cppm @@ -1,33 +1,37 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_PROXY_PROXYCONNECTIONRPCCLIENT_HPP -#define STREAMR_TRACKERLESS_NETWORK_PROXY_PROXYCONNECTIONRPCCLIENT_HPP +// Module partition streamr.trackerlessnetwork:ProxyConnectionRpcLocal +// CONSOLIDATED from the former header logic/proxy/ProxyConnectionRpcLocal.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" #include "packages/network/protos/NetworkRpc.server.pb.h" -#include "streamr-dht/Identifiers.hpp" -#include "streamr-dht/rpc-protocol/DhtCallContext.hpp" -#include "streamr-dht/transport/ListeningRpcCommunicator.hpp" -#include "streamr-eventemitter/EventEmitter.hpp" -#include "streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp" -#include "streamr-utils/BinaryUtils.hpp" -#include "streamr-utils/EthereumAddress.hpp" -#include "streamr-utils/StreamPartID.hpp" -namespace streamr::trackerlessnetwork::proxy { +export module streamr.trackerlessnetwork:ProxyConnectionRpcLocal; -using ::dht::PeerDescriptor; +import streamr.dht; +import streamr.eventemitter; +import streamr.utils; +import :ContentDeliveryRpcRemote; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::DhtAddress; using streamr::dht::Identifiers; using streamr::dht::rpcprotocol::DhtCallContext; using streamr::dht::transport::ListeningRpcCommunicator; using streamr::eventemitter::Event; using streamr::eventemitter::EventEmitter; -using streamr::trackerlessnetwork::ContentDeliveryRpcRemote; using streamr::utils::BinaryUtils; using streamr::utils::EthereumAddress; using streamr::utils::StreamPartID; using streamr::utils::toEthereumAddress; +export namespace streamr::trackerlessnetwork::proxy { + +using ::dht::PeerDescriptor; +using streamr::trackerlessnetwork::ContentDeliveryRpcRemote; using ProxyConnectionRpc = streamr::protorpc::ProxyConnectionRpc; @@ -160,5 +164,3 @@ class ProxyConnectionRpcLocal } }; } // namespace streamr::trackerlessnetwork::proxy - -#endif // STREAMR_TRACKERLESS_NETWORK_PROXY_PROXYCONNECTIONRPCCLIENT_HPP \ No newline at end of file diff --git a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcRemote.hpp b/packages/streamr-trackerless-network/modules/logic/proxy/ProxyConnectionRpcRemote.cppm similarity index 73% rename from packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcRemote.hpp rename to packages/streamr-trackerless-network/modules/logic/proxy/ProxyConnectionRpcRemote.cppm index 4db56954..cc1d7c6a 100644 --- a/packages/streamr-trackerless-network/include/streamr-trackerless-network/logic/proxy/ProxyConnectionRpcRemote.hpp +++ b/packages/streamr-trackerless-network/modules/logic/proxy/ProxyConnectionRpcRemote.cppm @@ -1,26 +1,32 @@ -#ifndef STREAMR_TRACKERLESS_NETWORK_PROXY_PROXYCONNECTIONRPCREMOTE_HPP -#define STREAMR_TRACKERLESS_NETWORK_PROXY_PROXYCONNECTIONRPCREMOTE_HPP +// Module partition streamr.trackerlessnetwork:ProxyConnectionRpcRemote +// CONSOLIDATED from the former header logic/proxy/ProxyConnectionRpcRemote.hpp +// (MODERNIZATION.md Phase 2.6): this file is now the source of truth. +module; #include #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.client.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/dht/contact/RpcRemote.hpp" -#include "streamr-dht/rpc-protocol/DhtCallContext.hpp" -#include "streamr-logger/SLogger.hpp" -#include "streamr-utils/BinaryUtils.hpp" -#include "streamr-utils/EthereumAddress.hpp" -namespace streamr::trackerlessnetwork::proxy { +export module streamr.trackerlessnetwork:ProxyConnectionRpcRemote; -using streamr::dht::rpcprotocol::DhtCallContext; -using ProxyConnectionRpcClient = - streamr::protorpc::ProxyConnectionRpcClient; -using ::dht::PeerDescriptor; +import streamr.dht; +import streamr.logger; +import streamr.utils; + +// Hoisted from the former header (file scope, NOT exported); +// fully qualified because relative namespace names resolve +// differently at file scope than inside the package namespace. using streamr::dht::contact::RpcRemote; +using streamr::dht::rpcprotocol::DhtCallContext; using streamr::logger::SLogger; using streamr::utils::BinaryUtils; using streamr::utils::EthereumAddress; +export namespace streamr::trackerlessnetwork::proxy { + +using ProxyConnectionRpcClient = + streamr::protorpc::ProxyConnectionRpcClient; +using ::dht::PeerDescriptor; class ProxyConnectionRpcRemote : public RpcRemote { public: @@ -52,5 +58,3 @@ class ProxyConnectionRpcRemote : public RpcRemote { }; } // namespace streamr::trackerlessnetwork::proxy - -#endif // STREAMR_TRACKERLESS_NETWORK_PROXY_PROXYCONNECTIONRPCREMOTE_HPP \ No newline at end of file diff --git a/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork-all.cppm b/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork-all.cppm deleted file mode 100644 index 15937843..00000000 --- a/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork-all.cppm +++ /dev/null @@ -1,74 +0,0 @@ -// Coarse façade partition over ALL public headers of -// streamr-trackerless-network (see the Phase 2.4 bench checkpoint for why -// one partition instead of one per header). -module; - -#include "streamr-trackerless-network/logic/ContentDeliveryRpcLocal.hpp" -#include "streamr-trackerless-network/logic/ContentDeliveryRpcRemote.hpp" -#include "streamr-trackerless-network/logic/DuplicateMessageDetector.hpp" -#include "streamr-trackerless-network/logic/NodeList.hpp" -#include "streamr-trackerless-network/logic/Utils.hpp" -#include "streamr-trackerless-network/logic/formStreamPartDeliveryServiceId.hpp" -#include "streamr-trackerless-network/logic/propagation/FifoMapWithTTL.hpp" -#include "streamr-trackerless-network/logic/propagation/Propagation.hpp" -#include "streamr-trackerless-network/logic/propagation/PropagationTaskStore.hpp" -#include "streamr-trackerless-network/logic/propagation/RandomAccessQueue.hpp" -#include "streamr-trackerless-network/logic/proxy/ProxyClient.hpp" -#include "streamr-trackerless-network/logic/proxy/ProxyConnectionRpcLocal.hpp" -#include "streamr-trackerless-network/logic/proxy/ProxyConnectionRpcRemote.hpp" - -export module streamr.trackerlessnetwork:all; - -export namespace streamr::trackerlessnetwork { - -using streamr::trackerlessnetwork::ContentDeliveryRpc; -using streamr::trackerlessnetwork::ContentDeliveryRpcClient; -using streamr::trackerlessnetwork::ContentDeliveryRpcLocal; -using streamr::trackerlessnetwork::ContentDeliveryRpcLocalOptions; -using streamr::trackerlessnetwork::ContentDeliveryRpcRemote; -using streamr::trackerlessnetwork::DuplicateMessageDetector; -using streamr::trackerlessnetwork::formStreamPartContentDeliveryServiceId; -using streamr::trackerlessnetwork::GapMisMatchError; -using streamr::trackerlessnetwork::InvalidNumberingError; -using streamr::trackerlessnetwork::NodeAdded; -using streamr::trackerlessnetwork::NodeList; -using streamr::trackerlessnetwork::NodeListEvents; -using streamr::trackerlessnetwork::NodeRemoved; -using streamr::trackerlessnetwork::NumberPair; -using streamr::trackerlessnetwork::Utils; - -} // namespace streamr::trackerlessnetwork - -export namespace streamr::trackerlessnetwork::propagation { - -using streamr::trackerlessnetwork::propagation::DEFAULT_MAX_MESSAGES; -using streamr::trackerlessnetwork::propagation::DEFAULT_TTL; -using streamr::trackerlessnetwork::propagation::FifoMapWithTTL; -using streamr::trackerlessnetwork::propagation::FifoMapWithTtlOptions; -using streamr::trackerlessnetwork::propagation::Propagation; -using streamr::trackerlessnetwork::propagation::PropagationOptions; -using streamr::trackerlessnetwork::propagation::PropagationTask; -using streamr::trackerlessnetwork::propagation::PropagationTaskStore; -using streamr::trackerlessnetwork::propagation::QueueToken; -using streamr::trackerlessnetwork::propagation::RandomAccessQueue; -using streamr::trackerlessnetwork::propagation::SendToNeighborFn; - -} // namespace streamr::trackerlessnetwork::propagation - -export namespace streamr::trackerlessnetwork::proxy { - -using streamr::trackerlessnetwork::proxy::ConnectingToProxyError; -using streamr::trackerlessnetwork::proxy::Message; -using streamr::trackerlessnetwork::proxy::NewConnection; -using streamr::trackerlessnetwork::proxy::ProxyClient; -using streamr::trackerlessnetwork::proxy::ProxyClientEvents; -using streamr::trackerlessnetwork::proxy::ProxyClientOptions; -using streamr::trackerlessnetwork::proxy::ProxyConnectionRpc; -using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcClient; -using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcLocal; -using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcLocalEvents; -using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcLocalOptions; -using streamr::trackerlessnetwork::proxy::ProxyConnectionRpcRemote; -using streamr::trackerlessnetwork::proxy::ProxyDefinition; - -} // namespace streamr::trackerlessnetwork::proxy diff --git a/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork.cppm b/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork.cppm index 2e9f28aa..8d06b5b7 100644 --- a/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork.cppm +++ b/packages/streamr-trackerless-network/modules/streamr.trackerlessnetwork.cppm @@ -2,4 +2,16 @@ export module streamr.trackerlessnetwork; export import :protos; -export import :all; +export import :ContentDeliveryRpcLocal; +export import :ContentDeliveryRpcRemote; +export import :DuplicateMessageDetector; +export import :FifoMapWithTTL; +export import :NodeList; +export import :Propagation; +export import :PropagationTaskStore; +export import :ProxyClient; +export import :ProxyConnectionRpcLocal; +export import :ProxyConnectionRpcRemote; +export import :RandomAccessQueue; +export import :Utils; +export import :formStreamPartDeliveryServiceId; diff --git a/packages/streamr-trackerless-network/test/integration/ProxyClientTsIntegrationTest.cpp b/packages/streamr-trackerless-network/test/integration/ProxyClientTsIntegrationTest.cpp index a27577b4..d20a14ad 100644 --- a/packages/streamr-trackerless-network/test/integration/ProxyClientTsIntegrationTest.cpp +++ b/packages/streamr-trackerless-network/test/integration/ProxyClientTsIntegrationTest.cpp @@ -1,14 +1,11 @@ #include #include "packages/dht/protos/DhtRpc.pb.h" #include "packages/network/protos/NetworkRpc.pb.h" -#include "streamr-dht/connection/ConnectionManager.hpp" -#include "streamr-dht/connection/ConnectorFacade.hpp" -#include "streamr-dht/transport/FakeTransport.hpp" -#include "streamr-logger/SLogger.hpp" -#include "streamr-trackerless-network/logic/proxy/ProxyClient.hpp" -#include "streamr-utils/BinaryUtils.hpp" -#include "streamr-utils/EthereumAddress.hpp" -#include "streamr-utils/StreamPartID.hpp" + +import streamr.dht; +import streamr.logger; +import streamr.trackerlessnetwork; +import streamr.utils; using ::dht::ConnectivityMethod; using ::dht::ConnectivityResponse;