RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_EXAMPLEDATATASK_MEASURETEL_BUSINESSLOGIC_HPP
13#define RTCTK_EXAMPLEDATATASK_MEASURETEL_BUSINESSLOGIC_HPP
14
15#include "computation.hpp"
16
20
21namespace rtctk::exampleDataTask {
22
23using namespace rtctk::componentFramework;
24
26
27class BusinessLogic : public LifeCycle::BizLogicIf, public Computation::ResultIf {
28public:
30
31 BusinessLogic(const std::string& name, ServiceContainer& services);
32
34 void ActivityEnabling(StopToken st) override;
35 void ActivityDisabling(StopToken st) override;
36 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
37 JsonPayload ActivityMeasuring(StopToken st, const JsonPayload& arg) override;
38
39private:
40 void OnResultAvailable(const Computation::Result& result) override;
41 Computation::Algorithm ParseAlgorithm(const JsonPayload& arg);
42
43 // used services
44 ServiceContainer& m_services;
45 RuntimeRepoIf& m_rtr;
46
47 // rtr datapoints
48 DataPointPath m_dp_queue_name;
49 DataPointPath m_dp_thread_policies;
50 DataPointPath m_dp_samples_to_read;
51 DataPointPath m_dp_sample_timeout;
52 DataPointPath m_dp_result;
53
54 std::unique_ptr<Computation> m_computation;
55};
56
57} // namespace rtctk::exampleDataTask
58
59#endif // RTCTK_EXAMPLEDATATASK_MEASURETEL_BUSINESSLOGIC_HPP
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:76
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 ActivityInitialising(StopToken st) override
LifeCycle ComponentType
Definition businessLogic.hpp:30
void ActivityDisabling(StopToken st) override
JsonPayload ActivityMeasuring(StopToken st, const JsonPayload &arg) override
Definition businessLogic.cpp:68
void ActivityUpdating(StopToken st, const JsonPayload &args) override
BusinessLogic(const std::string &name, ServiceContainer &services)
Algorithm
Definition computation.hpp:36
Lifecycle Extension that makes an RTC Component 'Measurable'.
Computation of the Data Task.
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'.
Header file for RuntimeRepoIf, which defines the API for RuntimeRepoAdapters.
Life cycle extension to make RtcComponent Measurable.
Definition measurable.hpp:150
Definition computation.hpp:42