RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
11
12#ifndef DDT_SERVER_BUSINESSLOGIC_HPP
13#define DDT_SERVER_BUSINESSLOGIC_HPP
14
19
21
22#include <memory>
23
24namespace rtctk::ddtServer {
25
26using namespace rtctk::componentFramework;
28
36class BusinessLogic : public LifeCycle::BizLogicIf {
37public:
42
43 BusinessLogic(const std::string& name,
44 ServiceContainer& services,
46 virtual ~BusinessLogic() = default;
47
48 void ActivityStarting(StopToken st) override;
49 void ActivityInitialising(StopToken st) override;
50
51 void ActivityGoingRunning(StopToken st) override;
52 void ActivityGoingIdle(StopToken st) override;
53 void ActivityRunning(StopToken st) override;
54 void ActivityRecovering(StopToken st) override;
55
56 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
57
58private:
59 std::string m_name;
60 ServiceContainer& m_services;
61 ComponentMetricsIf& m_metrics;
62
64 DdtForwarderListType m_ddt_forwarders;
65};
66
67} // namespace rtctk::ddtServer
68
69#endif // DDT_SERVER_BUSINESSLOGIC_HPP
Component metrics interface.
Definition componentMetricsIf.hpp:163
Container class that holds services of any type.
Definition serviceContainer.hpp:38
void ActivityGoingIdle(StopToken st) override
Definition businessLogic.cpp:63
rtctk::componentFramework::JsonPayload JsonPayload
Definition businessLogic.hpp:40
rtctk::componentFramework::StopToken StopToken
Definition businessLogic.hpp:39
virtual ~BusinessLogic()=default
void ActivityUpdating(StopToken st, const JsonPayload &args) override
Definition businessLogic.cpp:77
BusinessLogic(const std::string &name, ServiceContainer &services, DdtForwarderFactoryType factory)
Definition businessLogic.cpp:25
void ActivityInitialising(StopToken st) override
Definition businessLogic.cpp:38
void ActivityRecovering(StopToken st) override
Definition businessLogic.cpp:69
void ActivityRunning(StopToken st) override
Definition businessLogic.cpp:50
LifeCycle ComponentType
Definition businessLogic.hpp:38
rtctk::componentFramework::ServiceContainer ServiceContainer
Definition businessLogic.hpp:41
void ActivityStarting(StopToken st) override
Definition businessLogic.cpp:34
void ActivityGoingRunning(StopToken st) override
Definition businessLogic.cpp:44
Header file for ComponentMetricsIf.
Base class defining common interface for all DDT forwarders.
rad::StopToken StopToken
Definition stopToken.hpp:19
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:24
Definition businessLogic.cpp:23
std::function< DdtForwarderListType( const std::string &, rtctk::componentFramework::ServiceContainer &)> DdtForwarderFactoryType
Definition ddtForwarder.hpp:34
Runnable< RtcComponent > LifeCycle
Definition businessLogic.hpp:27
std::list< std::unique_ptr< DdtForwarder > > DdtForwarderListType
Definition ddtForwarder.hpp:33
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