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:
|
Replace concrete class hierarchy with abstract interface design to decouple user code from the Rust FFI implementation: