13#ifndef RTCTK_COMPONENTFRAMEWORK_MALDDSEVENTSERVICE_HPP
14#define RTCTK_COMPONENTFRAMEWORK_MALDDSEVENTSERVICE_HPP
22#include <mal/utility/LoadMal.hpp>
43 std::unique_ptr<EventPublisherIf>
MakePublisher(
const std::string& topic)
override;
48 std::unique_ptr<EventSubscriberIf>
MakeSubscriber(
const std::string& topic)
override;
51 elt::mal::Mal::Properties GetMalProperties();
56 const elt::mal::Mal::Properties m_props;
57 std::shared_ptr<elt::mal::Mal> m_mal;
58 elt::mal::CiiFactory& m_factory;
81 const std::string& topic,
82 const elt::mal::Mal::Properties&
props);
84 std::unique_ptr<elt::mal::ps::Publisher<rtctkif::GenericEvent>> m_publisher;
110 inline static const std::string
QOS_FILE =
"config/rtctk/dds/eventServiceDdsQos.xml";
114 const std::string& topic,
115 const elt::mal::Mal::Properties&
props);
117 std::unique_ptr<elt::mal::ps::Subscriber<rtctkif::GenericEvent>> m_subscriber;
118 std::unique_ptr<elt::mal::ps::Subscription> m_subscription;
Interface class for publishing JSON events.
Definition eventServiceIf.hpp:52
Interface class for providing pub/sub facilities for JSON events.
Definition eventServiceIf.hpp:29
Interface class for subscribing to JSON events.
Definition eventServiceIf.hpp:68
Implementation of event publisher.
Definition malDdsEventService.hpp:69
void Publish(const JsonPayload &sample) override
Publishes a new data sample.
Definition malDdsEventService.cpp:101
friend MalDdsEventService
Definition malDdsEventService.hpp:72
Implementation of low-level event service using CII MAL DDS as middleware.
Definition malDdsEventService.hpp:36
MalDdsEventService()
Definition malDdsEventService.cpp:31
std::unique_ptr< EventSubscriberIf > MakeSubscriber(const std::string &topic) override
Factory method to create a new subscriber object.
Definition malDdsEventService.cpp:86
std::unique_ptr< EventPublisherIf > MakePublisher(const std::string &topic) override
Factory method to create a new publisher object.
Definition malDdsEventService.cpp:81
Implementation of event subscriber.
Definition malDdsEventService.hpp:94
void Subscribe(std::function< void(const JsonPayload &)> cb) override
Subscribes to the topic.
Definition malDdsEventService.cpp:126
friend MalDdsEventService
Definition malDdsEventService.hpp:97
void Unsubscribe() override
Unsubscribes from the topic.
Definition malDdsEventService.cpp:141
static const std::string QOS_FILE
Definition malDdsEventService.hpp:110
Low-level interface of the event service.
Defines the JSON payload type JsonPayload.
Definition commandReplier.cpp:22
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:25
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23