Prepare the new score::time API#18
Draft
lavrovvalera wants to merge 4 commits intoeclipse-score:mainfrom
Draft
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
efabbd2 to
def162d
Compare
def162d to
64adae9
Compare
64adae9 to
ea3b132
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
score::time — Unified Clock API (new
Clock<Tag>framework)Ref: #9
Summary
Introduces
score::time— a unified, tag-based clock API that replaces theSynchronizedVehicleTimeandHighPrecisionLocalSteadyClockclass hierarchies with asingle, scalable template wrapper
Clock<Tag>. All four clock domains (vehicle time,HPLS, steady, system) are accessible through the same call pattern. Legacy packages are
marked deprecated and will be removed once
TimeDaemonconsumers have migrated.Motivation
The existing API had several pain points across
safe-posix-platformandddadconsumers:SynchronizedVehicleTime::FactoryImplandHighPrecisionLocalSteadyClock::FactoryImplhad completely different construction patterns.requiring test-specific constructor signatures.
TimeStatussnapshot — public data members, raw-uint64_tconstructors, andnon-const accessors triggered Coverity
M11-0-1suppressions.Set*/Unset*for each PTP event type; no genericsubscription pattern.
steady_clock/system_clockunification — callers mixedstd::chronoclocks andBMW-specific clocks with incompatible APIs.
Changes
New framework —
score/time/clock/clock.hClock<Tag>value wrapper —Now(),Subscribe<E>(),IsAvailable(),GetInstance()clock_traits.hClockTraits<Tag>primary template +std::chronospecialisationsclock_override_guard.hClockOverrideGuard<Tag>RAII guard for test mock injectionclock_snapshot.hClockSnapshot<TimepointT, StatusT>immutable two-field snapshotclock_status.hClockStatus<FlagEnumT>bit-flag status utilityno_status.hNoStatusempty placeholder for always-ready clockssubscription_hook.hSubscriptionHook<Tag, E>extension point for PTP callbacksavailability_hook.hAvailabilityHook<Tag>extension point for async readinessNew clock domains
score/time/vehicle_time/:vehicle_time/:vehicle_time_mock/:interfacescore/time/hpls_time/:hpls_time/:hpls_time_mock/:interfacescore/time/steady_time/:steady_time/:steady_time_mock/:interfacestd::chrono::steady_clockwrapperscore/time/system_time/:system_time/:system_time_mock/:interfacestd::chrono::system_clockwrapperscore/time/ptp/:ptp_typesTimeSlaveSyncData<Tag>,PDelayMeasurementData<Tag>Visibility hardening
*_clock,*_clock_iface,*_clock_impl,*_clock_mock,clock_core) restricted to//score/time:__subpackages__.:vehicle_time(prod),:vehicle_time_mock(test),
:interface(header-only).examples/time/aggregation moved to its own//examples/time:unit_test_suite; no longerreferenced from
//score/time:unit_test_suite.Examples —
examples/time/Four self-contained examples (one per domain) demonstrating polling, status checks, and
callback registration. Handler filenames match class names
(
vehicle_time_handler.h/VehicleTimeHandler, etc.).Legacy deprecation
score/time/SynchronizedVehicleTime/BUILDandscore/time/HighPrecisionLocalSteadyClock/BUILDretain a
DEPRECATEDcomment block and carrydeprecation = "..."on their alias targetsso any target that still depends on them receives a Bazel analysis-time warning. Both packages
are kept until
score/TimeDaemon/consumers complete migration.Documentation —
docs/time/New Sphinx RST documentation for the
score::timeAPI, with six use-case sections and fivePlantUML sequence/class diagrams. The former
docs/time/(TimeDaemon architecture) isrenamed to
docs/TimeDaemon/.API example