RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
businessLogic.hpp
Go to the documentation of this file.
1
13#ifndef DDT_SERVER_BUSINESSLOGIC_HPP
14#define DDT_SERVER_BUSINESSLOGIC_HPP
15
20
22
23#include <memory>
24
25namespace rtctk::ddtServer {
26
27using namespace rtctk::componentFramework;
29
38public:
43
44 BusinessLogic(const std::string& name,
45 ServiceContainer& services,
47 virtual ~BusinessLogic() = default;
48
49 void ActivityStarting(StopToken st) override;
50 void ActivityInitialising(StopToken st) override;
51
52 void ActivityGoingRunning(StopToken st) override;
53 void ActivityGoingIdle(StopToken st) override;
54 void ActivityRunning(StopToken st) override;
55 void ActivityRecovering(StopToken st) override;
56
57 void ActivityUpdating(StopToken st, const JsonPayload& args) override;
58
59private:
60 std::string m_name;
61 ServiceContainer& m_services;
62 ComponentMetricsIf& m_metrics;
63
65 DdtForwarderListType m_ddt_forwarders;
66};
67
68} // namespace rtctk::ddtServer
69
70#endif // DDT_SERVER_BUSINESSLOGIC_HPP
Component metrics interface.
Definition componentMetricsIf.hpp:85
Container class that holds services of any type.
Definition serviceContainer.hpp:39
Defines and implements the business logic of the DDT Server, an RTC Component that subscribes to a sh...
Definition businessLogic.hpp:37
void ActivityGoingIdle(StopToken st) override
Definition businessLogic.cpp:64
rtctk::componentFramework::JsonPayload JsonPayload
Definition businessLogic.hpp:41
rtctk::componentFramework::StopToken StopToken
Definition businessLogic.hpp:40
virtual ~BusinessLogic()=default
void ActivityUpdating(StopToken st, const JsonPayload &args) override
Definition businessLogic.cpp:78
BusinessLogic(const std::string &name, ServiceContainer &services, DdtForwarderFactoryType factory)
Definition businessLogic.cpp:26
void ActivityInitialising(StopToken st) override
Definition businessLogic.cpp:39
void ActivityRecovering(StopToken st) override
Definition businessLogic.cpp:70
void ActivityRunning(StopToken st) override
Definition businessLogic.cpp:51
void ActivityStarting(StopToken st) override
Definition businessLogic.cpp:35
void ActivityGoingRunning(StopToken st) override
Definition businessLogic.cpp:45
Header file for ComponentMetricsIf.
Base class defining common interface for all DDT forwarders.
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:24
std::function< DdtForwarderListType( const std::string &, rtctk::componentFramework::ServiceContainer &)> DdtForwarderFactoryType
Definition ddtForwarder.hpp:35
Runnable< RtcComponent > LifeCycle
Definition businessLogic.hpp:28
std::list< std::unique_ptr< DdtForwarder > > DdtForwarderListType
Definition ddtForwarder.hpp:34
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