RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_TELEMETRYRECORDER_BUSINESSLOGIC_HPP
13#define RTCTK_TELEMETRYRECORDER_BUSINESSLOGIC_HPP
14
16#include <chrono>
23
25
26using namespace rtctk::componentFramework;
27
29
35class BusinessLogic : public LifeCycle::BizLogicIf {
36public:
38 BusinessLogic(const std::string& name, ServiceContainer& services, RecUnitFactoryType factory);
39 virtual ~BusinessLogic() = default;
40
41 // activities
42 void ActivityStarting(StopToken st) override;
43 void ActivityInitialising(StopToken st) override;
44 void ActivityGoingRunning(StopToken st) override;
45 void ActivityGoingIdle(StopToken st) override;
46 void ActivityRunning(StopToken st) override;
47 void ActivityRecovering(StopToken st) override;
48 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
49
50private:
55 void WaitForStart(StopToken st);
56
57 log4cplus::Logger& m_logger;
58 std::string m_name;
59 ServiceContainer& m_services;
60 OldbIf& m_oldb;
61 ComponentMetricsIf& m_metrics;
62 RecUnitFactoryType m_rec_unit_factory;
63 RecUnitListType m_rec_units;
64
65 std::string m_session_id;
66 std::chrono::utc_clock::time_point m_start_time{};
67 std::filesystem::path m_fs_path;
68
69 DataPointPath m_dpp_session_id;
70 DataPointPath m_dpp_session_files;
71 DataPointPath m_dpp_session_files_size;
72 DataPointPath m_dpp_session_total_size;
73 DataPointPath m_dpp_session_space_info_cap;
74 DataPointPath m_dpp_session_space_info_free;
75 DataPointPath m_dpp_session_space_info_avail;
76};
77
78} // namespace rtctk::telemetryRecorder
79
80#endif // RTCTK_TELEMETRYRECORDER_BUSINESSLOGIC_HPP
Component metrics interface.
Definition componentMetricsIf.hpp:163
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:76
Base interface for all OLDB adapters.
Definition oldbIf.hpp:24
Container class that holds services of any type.
Definition serviceContainer.hpp:38
void ActivityGoingIdle(StopToken st) override
Definition businessLogic.cpp:156
LifeCycle ComponentType
Definition businessLogic.hpp:37
void ActivityUpdating(StopToken st, const JsonPayload &args) override
Definition businessLogic.cpp:203
BusinessLogic(const std::string &name, ServiceContainer &services, RecUnitFactoryType factory)
Definition businessLogic.cpp:39
void ActivityInitialising(StopToken st) override
Definition businessLogic.cpp:62
void ActivityRecovering(StopToken st) override
Definition businessLogic.cpp:187
void ActivityRunning(StopToken st) override
Definition businessLogic.cpp:129
void ActivityStarting(StopToken st) override
Definition businessLogic.cpp:58
void ActivityGoingRunning(StopToken st) override
Definition businessLogic.cpp:89
Header file for ComponentMetricsIf.
Logging Support Library based on log4cplus.
std::list< std::unique_ptr< RecordingUnit > > RecUnitListType
Definition recordingUnit.hpp:33
rad::StopToken StopToken
Definition stopToken.hpp:19
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:24
std::function< RecUnitListType(const std::string &, ServiceContainer &)> RecUnitFactoryType
Definition recordingUnit.hpp:34
Definition businessLogic.cpp:37
Runnable< RtcComponent > LifeCycle
Definition businessLogic.hpp:28
Header file for OldbIf, which defines the API for OldbAdapters.
Abstract base class defining functionality common to all recording units.
Lifecycle of a basic 'RtcComponent'.
Lifecycle Extension that makes an RTC Component 'Runnable'.
A simple Stop Token.
Life cycle extension to make RtcComponent Runnable.
Definition runnable.hpp:30