RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
12
13#ifndef RTCTK_TELEMETRYRECORDER_BUSINESSLOGIC_HPP
14#define RTCTK_TELEMETRYRECORDER_BUSINESSLOGIC_HPP
15
17#include <chrono>
24
26
27using namespace rtctk::componentFramework;
28
30
36class BusinessLogic : public LifeCycle::BizLogicIf {
37public:
39 BusinessLogic(const std::string& name, ServiceContainer& services, RecUnitFactoryType factory);
40 virtual ~BusinessLogic() = default;
41
42 // activities
43 void ActivityStarting(StopToken st) override;
44 void ActivityInitialising(StopToken st) override;
45 void ActivityGoingRunning(StopToken st) override;
46 void ActivityGoingIdle(StopToken st) override;
47 void ActivityRunning(StopToken st) override;
48 void ActivityRecovering(StopToken st) override;
49 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
50
51private:
56 void WaitForStart(StopToken st);
57
58 log4cplus::Logger& m_logger;
59 std::string m_name;
60 ServiceContainer& m_services;
61 OldbIf& m_oldb;
62 ComponentMetricsIf& m_metrics;
63 RecUnitFactoryType m_rec_unit_factory;
64 RecUnitListType m_rec_units;
65
66 std::string m_session_id;
67 std::chrono::utc_clock::time_point m_start_time{};
68 std::filesystem::path m_fs_path;
69
70 DataPointPath m_dpp_session_id;
71 DataPointPath m_dpp_session_files;
72 DataPointPath m_dpp_session_files_size;
73 DataPointPath m_dpp_session_total_size;
74 DataPointPath m_dpp_session_space_info_cap;
75 DataPointPath m_dpp_session_space_info_free;
76 DataPointPath m_dpp_session_space_info_avail;
77};
78
79} // namespace rtctk::telemetryRecorder
80
81#endif // RTCTK_TELEMETRYRECORDER_BUSINESSLOGIC_HPP
Component metrics interface.
Definition componentMetricsIf.hpp:164
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:77
Base interface for all OLDB adapters.
Definition oldbIf.hpp:25
Container class that holds services of any type.
Definition serviceContainer.hpp:39
void ActivityGoingIdle(StopToken st) override
Definition businessLogic.cpp:157
LifeCycle ComponentType
Definition businessLogic.hpp:38
void ActivityUpdating(StopToken st, const JsonPayload &args) override
Definition businessLogic.cpp:204
BusinessLogic(const std::string &name, ServiceContainer &services, RecUnitFactoryType factory)
Definition businessLogic.cpp:40
void ActivityInitialising(StopToken st) override
Definition businessLogic.cpp:63
void ActivityRecovering(StopToken st) override
Definition businessLogic.cpp:188
void ActivityRunning(StopToken st) override
Definition businessLogic.cpp:130
void ActivityStarting(StopToken st) override
Definition businessLogic.cpp:59
void ActivityGoingRunning(StopToken st) override
Definition businessLogic.cpp:90
Header file for ComponentMetricsIf.
Logging Support Library based on log4cplus.
std::list< std::unique_ptr< RecordingUnit > > RecUnitListType
Definition recordingUnit.hpp:34
rad::StopToken StopToken
Definition stopToken.hpp:20
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:25
std::function< RecUnitListType(const std::string &, ServiceContainer &)> RecUnitFactoryType
Definition recordingUnit.hpp:35
Definition businessLogic.cpp:38
Runnable< RtcComponent > LifeCycle
Definition businessLogic.hpp:29
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:31