Repository navigation
Add a generic timebase handler to TimeDaemon - #244
florianfueller wants to merge 2 commits into
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
Quality pack traceability report for this pull request: Status: PASS (workflow run) |
|
Documentation preview for this pull request is available at: |
665e84a to
bca6aef
Compare
bca6aef to
421c457
Compare
6242ad5 to
b23ca0b
Compare
b23ca0b to
f7e2a49
Compare
f7e2a49 to
1f74064
Compare
1f74064 to
e2316e4
Compare
e2316e4 to
d4330e3
Compare
ef85ca2 to
f086710
Compare
f086710 to
7378db6
Compare
7378db6 to
6229b80
Compare
6229b80 to
c71e31b
Compare
c71e31b to
2fc7c4d
Compare
2fc7c4d to
788e7e6
Compare
- Move common setup, messaging, and lifecycle code out of SvtHandler - Allow TimeDaemon to run multiple handlers through a custom factory - Expose public Bazel targets for custom handlers Refs eclipse-score#265 Signed-off-by: Florian Füller <5454068+florianfueller@users.noreply.github.com>
788e7e6 to
fd9e47c
Compare
| /// A timeout makes the handler fail. | ||
| /// \return The machine passed to Add(). | ||
| template <typename M> | ||
| std::shared_ptr<M> Add(std::shared_ptr<M> machine, std::chrono::seconds init_timeout = std::chrono::seconds{20}); |
There was a problem hiding this comment.
I'm not sure it is a good approach to have the default value here.
would beleave it might be forbidden by misra even
| @@ -0,0 +1,103 @@ | |||
| /******************************************************************************** | |||
There was a problem hiding this comment.
is it the timebase_handler_factory_test.*?
| /// The JobRunner initializes the machines on a worker thread. Once all machines are ready, proactive machines | ||
| /// start in Add() order and stop in reverse order. Add machines that must run first before their data sources. | ||
| /// | ||
| /// param T Type of messages sent through the MessageBroker. |
There was a problem hiding this comment.
| /// param T Type of messages sent through the MessageBroker. | |
| /// param T Type of messages sent through the MessageBroker. |
| /// Keeps the machines alive. The MessageBroker holds only weak references. | ||
| std::vector<std::shared_ptr<BaseMachine>> machines_; | ||
| std::vector<std::shared_ptr<ProactiveMachine>> start_order_; // in Add() order | ||
| std::string name_; |
| bool is_initialized_; | ||
| }; | ||
|
|
||
| template <typename T> |
There was a problem hiding this comment.
| template <typename T> | |
| template <typename T, typename M> |
| ) | ||
|
|
||
| alias( | ||
| name = "generic_timebase_handler", |
There was a problem hiding this comment.
shall all these be combined to time_daemon_core?
or, if you ant to split the time daemon, then
- core
- main
- time_handlers
| actual = "//score/time_daemon/src/msg_broker", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
There was a problem hiding this comment.
I would also somehow encrease the readability here
group the aliases with
- the core types and targets, whcih provide the possibility to add any new timebase
- the svt -related targets
- the tiem daemon bricks
|
|
||
| config/configuration_guide | ||
|
|
||
| Choosing Handlers |
There was a problem hiding this comment.
is it really a choosing?
| Handler Lifecycle | ||
| ================= | ||
|
|
||
| ``TimeDaemon`` owns the handlers. ``Initialize()`` fails if the list is empty or any handler is null. |
There was a problem hiding this comment.
shall we describe here a small state machine or it wil be too much?
|
|
||
| During initialization, the ``Application`` uses a factory pattern to create components in specific order: | ||
| ``TimeDaemon`` owns the handlers. Its default constructor calls ``CreateTimebaseHandlers()``. | ||
| Exactly one linked factory must define this function (see :ref:`time_daemon_user_manual`). |
There was a problem hiding this comment.
I would find that a bit starange, that the detailed design, which is (or should be) way more deatialed and tehcnically filled refernce here the user manual ..
closes #265