Redesign Health Monitor C++ API with abstract interfaces - #341
Redesign Health Monitor C++ API with abstract interfaces#341eduard-moskalchuk wants to merge 1 commit into
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
|
@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) |
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
5c88b56 to
eab1942
Compare
|
Please consider redesigning the API now. Delaying it until users depend on concrete types will make migration far more expensive. The approach proposed in this PR offers several benefits:
|
|
We talked internally, and we agreed to move on with a virtual interface, but:
Then we can continue; hope this helps |
|
Great, thanks @pawelrutkaq ! |
|
Unless we don't align whole codebase I want to keep it consistent. So if all other components of this repo would do this HealtMon shall also do it (ie report_running)). Anyway, a separate PR shall be done only for renames. |
|
Thanks for the pull request. This thread has been quiet for 30 days, so we are marking it as stale for now. Please take a quick look and let us know whether it is still up to date, still relevant, needs review, or is ready to merge. Any new activity will remove the stale label automatically. If nothing changes in the next 10 days, we will close it to keep the backlog current. |
Replace concrete class hierarchy with abstract interface design to decouple user code from the Rust FFI implementation: