Skip to content

Redesign Health Monitor C++ API with abstract interfaces#341

Draft
eduard-moskalchuk wants to merge 1 commit into
eclipse-score:mainfrom
eduard-moskalchuk:edmo_health_monitor_api_redesign
Draft

Redesign Health Monitor C++ API with abstract interfaces#341
eduard-moskalchuk wants to merge 1 commit into
eclipse-score:mainfrom
eduard-moskalchuk:edmo_health_monitor_api_redesign

Conversation

@eduard-moskalchuk

Copy link
Copy Markdown
Contributor

Replace concrete class hierarchy with abstract interface design to decouple user code from the Rust FFI implementation:

  • Extract pure virtual interfaces: HealthMonitor, HealthMonitorBuilder, DeadlineMonitor, Deadline, HeartbeatMonitor, LogicMonitor
  • Move FFI-backed implementations into details/ namespace (*Impl classes)
  • Introduce HealthMonitorBuilder::Create() factory method returning std::unique_ptr for polymorphic construction
  • Add GMock-based mock classes (health_monitor_mocks.h) enabling unit testing without the Rust FFI library
  • Flatten per-monitor subdirectories (deadline/, heartbeat/, logic/) into top-level headers with details/ impl split
  • Remove obsolete tag.h, thread.h/cpp in favor of common.h Tag class and ThreadParameters struct in builder header
  • Update example app and integration tests to new API

Replace concrete class hierarchy with abstract interface design to decouple
user code from the Rust FFI implementation:

- Extract pure virtual interfaces: HealthMonitor, HealthMonitorBuilder,
  DeadlineMonitor, Deadline, HeartbeatMonitor, LogicMonitor
- Move FFI-backed implementations into details/ namespace (*Impl classes)
- Introduce HealthMonitorBuilder::Create() factory method returning
  std::unique_ptr<HealthMonitorBuilder> for polymorphic construction
- Add GMock-based mock classes (health_monitor_mocks.h) enabling unit
  testing without the Rust FFI library
- Flatten per-monitor subdirectories (deadline/, heartbeat/, logic/)
  into top-level headers with details/ impl split
- Remove obsolete tag.h, thread.h/cpp in favor of common.h Tag class
  and ThreadParameters struct in builder header
- Update example app and integration tests to new API
@github-actions

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 99243779-4a73-40fb-bee2-cd03f0da7c78
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (31 packages loaded, 10 targets configured)

Analyzing: target //:license-check (81 packages loaded, 10 targets configured)

Analyzing: target //:license-check (86 packages loaded, 10 targets configured)

Analyzing: target //:license-check (143 packages loaded, 2556 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5482 targets configured)

Analyzing: target //:license-check (157 packages loaded, 7674 targets configured)

Analyzing: target //:license-check (158 packages loaded, 8236 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (166 packages loaded, 9022 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10279 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[1 / 1] no actions running
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 26.657s, Critical Path: 2.65s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@pawelrutkaq pawelrutkaq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have a look overall, but my first look tells me i dont like need of allocations -> let me look into it closer ;)

@pawelrutkaq

pawelrutkaq commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@eduard-moskalchuk this is what i meant (no skip need of allocations and virtual calls in production code) -> https://github.com/qorix-group/inc_lifecycle/pull/12/changes#diff-f3c426bacc8936a54221d843f347b0e592ce56aad4df991e1e514c0caf78cabe You can find me on slack as Pawel Rutka and we can dicuss if this would also fill your needs (i directly used your example, now kind of fast & maybe dirty but shows the idea)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants