RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_EXAMPLEDATATASK_GPU_BUSINESSLOGIC_HPP
14#define RTCTK_EXAMPLEDATATASK_GPU_BUSINESSLOGIC_HPP
15
16#include "computation.hpp"
17
22
23namespace rtctk::exampleDataTask {
24
25using namespace rtctk::componentFramework;
26
28
30public:
32
33 BusinessLogic(const std::string& name, ServiceContainer& services);
34
35 // activities
36 void ActivityStarting(StopToken st) override;
37 void ActivityInitialising(StopToken st) override;
38 void ActivityEnabling(StopToken st) override;
39 void ActivityDisabling(StopToken st) override;
40 void ActivityGoingRunning(StopToken st) override;
41 void ActivityGoingIdle(StopToken st) override;
42 void ActivityRunning(StopToken st) override;
43 void ActivityRecovering(StopToken st) override;
44 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
45
46private:
47 void OnResultAvailable(const Computation::Result& result) override;
48
49 std::string m_name;
50 ServiceContainer& m_services;
51 RuntimeRepoIf& m_rtr;
52 EventServiceIf& m_esv;
53
54 // event publisher for all kinds of configuration events
55 std::unique_ptr<EventPublisherIf> m_ev_pub;
56
57 // rtr datapoints (inputs)
58 DataPointPath m_dp_queue_name;
59 DataPointPath m_dp_thread_policies;
60 DataPointPath m_dp_samples_to_read;
61 DataPointPath m_dp_samples_to_skip;
62 DataPointPath m_dp_sample_timeout;
63 DataPointPath m_dp_gpu;
64 DataPointPath m_dp_slopes;
65 DataPointPath m_dp_modes;
66 DataPointPath m_dp_s2m;
67
68 // rtr datapoints (outputs)
69 DataPointPath m_dp_avg_slopes;
70 DataPointPath m_dp_avg_modes;
71
72 std::unique_ptr<Computation> m_computation;
73};
74
75} // namespace rtctk::exampleDataTask
76
77#endif // RTCTK_EXAMPLEDATATASK_GPU_BUSINESSLOGIC_HPP
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
Interface class for providing pub/sub facilities for JSON events.
Definition eventServiceIf.hpp:29
Base interface for all Runtime Configuration Repository adapters.
Definition runtimeRepoIf.hpp:27
Container class that holds services of any type.
Definition serviceContainer.hpp:39
Definition businessLogic.hpp:29
void ActivityGoingIdle(StopToken st) override
Definition businessLogic.cpp:92
void ActivityUpdating(StopToken st, const JsonPayload &args) override
Definition businessLogic.cpp:108
void ActivityEnabling(StopToken st) override
Definition businessLogic.cpp:80
void ActivityInitialising(StopToken st) override
Definition businessLogic.cpp:54
void ActivityRecovering(StopToken st) override
Definition businessLogic.cpp:103
void ActivityRunning(StopToken st) override
Definition businessLogic.cpp:96
void ActivityDisabling(StopToken st) override
Definition businessLogic.cpp:84
void ActivityStarting(StopToken st) override
Definition businessLogic.cpp:50
BusinessLogic(const std::string &name, ServiceContainer &services)
Definition businessLogic.cpp:29
void ActivityGoingRunning(StopToken st) override
Definition businessLogic.cpp:88
Low-level interface of the event service.
Computation class of the example data task.
Definition commandReplier.cpp:22
rad::StopToken StopToken
Definition stopToken.hpp:20
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:25
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Definition businessLogic.cpp:27
Runnable< RtcComponent > LifeCycle
Definition businessLogic.hpp:27
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:31
Definition computation.hpp:43