RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_EXAMPLEDATATASK_BUSINESSLOGIC_HPP
13#define RTCTK_EXAMPLEDATATASK_BUSINESSLOGIC_HPP
14
15#include "computation.hpp"
16
21
22namespace rtctk::exampleDataTask {
23
24using namespace rtctk::componentFramework;
25
27
28class BusinessLogic : public LifeCycle::BizLogicIf, public Computation::ResultIf {
29public:
31
32 BusinessLogic(const std::string& name, ServiceContainer& services);
33
34 // activities
35 void ActivityStarting(StopToken st) override;
37 void ActivityEnabling(StopToken st) override;
38 void ActivityDisabling(StopToken st) override;
40 void ActivityGoingIdle(StopToken st) override;
41 void ActivityRunning(StopToken st) override;
42 void ActivityRecovering(StopToken st) override;
43 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
44
45private:
46 void OnResultAvailable(const Computation::Result& result) override;
47
48 std::string m_name;
49 ServiceContainer& m_services;
50 RuntimeRepoIf& m_rtr;
51 EventServiceIf& m_esv;
52
53 // event publisher for all kinds of configuration events
54 std::unique_ptr<EventPublisherIf> m_ev_pub;
55
56 // rtr datapoints (inputs)
57 DataPointPath m_dp_queue_name;
58 DataPointPath m_dp_thread_policies;
59 DataPointPath m_dp_samples_to_read;
60 DataPointPath m_dp_samples_to_skip;
61 DataPointPath m_dp_sample_timeout;
62 DataPointPath m_dp_slopes;
63 DataPointPath m_dp_modes;
64 DataPointPath m_dp_s2m;
65
66 // rtr datapoints (outputs)
67 DataPointPath m_dp_avg_slopes;
68 DataPointPath m_dp_avg_modes;
69
70 std::unique_ptr<Computation> m_computation;
71};
72
73} // namespace rtctk::exampleDataTask
74
75#endif // RTCTK_EXAMPLEDATATASK_BUSINESSLOGIC_HPP
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:76
Interface class for providing pub/sub facilities for JSON events.
Definition eventServiceIf.hpp:28
Base interface for all Runtime Configuration Repository adapters.
Definition runtimeRepoIf.hpp:26
Container class that holds services of any type.
Definition serviceContainer.hpp:38
Definition businessLogic.hpp:28
void ActivityEnabling(StopToken st) override
void ActivityGoingIdle(StopToken st) override
void ActivityStarting(StopToken st) override
void ActivityRunning(StopToken st) override
void ActivityInitialising(StopToken st) override
void ActivityGoingRunning(StopToken st) override
LifeCycle ComponentType
Definition businessLogic.hpp:30
void ActivityDisabling(StopToken st) override
void ActivityRecovering(StopToken st) override
void ActivityUpdating(StopToken st, const JsonPayload &args) override
BusinessLogic(const std::string &name, ServiceContainer &services)
Low-level interface of the event service.
rad::StopToken StopToken
Definition stopToken.hpp:19
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:24
Definition businessLogic.cpp:26
Runnable< RtcComponent > LifeCycle
Definition businessLogic.hpp:26
Lifecycle of a basic 'RtcComponent'.
Lifecycle Extension that makes an RTC Component 'Runnable'.
Header file for RuntimeRepoIf, which defines the API for RuntimeRepoAdapters.
Life cycle extension to make RtcComponent Runnable.
Definition runnable.hpp:30
Definition computation.hpp:42
Computation class of the example data task.