ddt  0.1
ddtPublisher.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file ddtPublisher.hpp
8 // @brief MAL Publisher.
9 //
10 // This class provides the functionality to create MAL Publishers used for
11 // publishing data packets or for notifying other components that new data is
12 // available.
13 //
14 // @author Matthias Grimm, CGI
15 // @since 2020/01/16
16 //
17 
18 #ifndef DDTPUBLISHER_HPP_
19 #define DDTPUBLISHER_HPP_
20 
21 #include <Ddtdatatransfericd.hpp>
22 #include <chrono>
23 #include <cstring>
24 #include <iostream>
25 #include <mal/Cii.hpp>
26 #include <mal/ps/qos/Deadline.hpp>
27 #include <mal/ps/qos/Latency.hpp>
28 #include <mal/utility/LoadMal.hpp>
29 #include <map>
30 #include <memory>
31 #include <stdexcept>
32 #include <thread>
33 
34 #include "ddt/ddtLogger.hpp"
35 
36 namespace mal = ::elt::mal;
37 namespace datatransfer = ::elt::ddt::datatransfer;
38 
39 namespace ddt {
40 
46 class DdtPublisher {
47  public:
52 
56  virtual ~DdtPublisher();
57 
61  static std::unique_ptr<mal::ps::InstancePublisher<datatransfer::DataPacket>,
62  std::default_delete<mal::ps::InstancePublisher<
63  datatransfer::DataPacket> > >
64  CreatePublisher(const std::string& data_stream_identifier,
65  const std::string& publishing_uri, const int32_t latency,
66  const int32_t deadline, DdtLogger* logger);
67 
71  static std::unique_ptr<
72  mal::ps::InstancePublisher<datatransfer::NotificationSample>,
73  std::default_delete<
74  mal::ps::InstancePublisher<datatransfer::NotificationSample> > >
75  CreateNotifier(const std::string& data_stream_identifier,
76  const int32_t latency, const int32_t deadline,
77  const int32_t notification_port, DdtLogger* logger);
78 };
79 
80 } // namespace ddt
81 
82 #endif /* DDTPUBLISHER_HPP_ */
ddt::DdtPublisher::DdtPublisher
DdtPublisher()
ddt::DdtLogger
Definition: ddtLogger.hpp:48
ddt
Definition: ddtClient.hpp:36
ddt::DdtPublisher::CreateNotifier
static std::unique_ptr< mal::ps::InstancePublisher< datatransfer::NotificationSample >, std::default_delete< mal::ps::InstancePublisher< datatransfer::NotificationSample > > > CreateNotifier(const std::string &data_stream_identifier, const int32_t latency, const int32_t deadline, const int32_t notification_port, DdtLogger *logger)
Definition: ddtPublisher.cpp:72
ddt::DdtPublisher
Definition: ddtPublisher.hpp:46
ddt::DdtPublisher::~DdtPublisher
virtual ~DdtPublisher()
ddtLogger.hpp
ddt::DdtPublisher::CreatePublisher
static std::unique_ptr< mal::ps::InstancePublisher< datatransfer::DataPacket >, std::default_delete< mal::ps::InstancePublisher< datatransfer::DataPacket > > > CreatePublisher(const std::string &data_stream_identifier, const std::string &publishing_uri, const int32_t latency, const int32_t deadline, DdtLogger *logger)
Definition: ddtPublisher.cpp:31