ddt 1.4.0
 
Loading...
Searching...
No Matches
ddtRemoteControl.hpp
Go to the documentation of this file.
1
9
10#ifndef DATAVISUALISATION_REMOTECONTROL_SRC_INCLUDE_DDT_DDTREMOTECONTROL_HPP_
11#define DATAVISUALISATION_REMOTECONTROL_SRC_INCLUDE_DDT_DDTREMOTECONTROL_HPP_
12
13#include <Ddtremotecontrolicd.hpp>
14#include <boost/signals2/signal.hpp>
15#include <future>
16#include <iostream>
17#include <mal/Cii.hpp>
18#include <mal/rr/ServerAmi.hpp>
19#include <mal/rr/ServerContextProvider.hpp>
20#include <mal/rr/qos/ReplyTime.hpp>
21#include <mal/utility/LoadMal.hpp>
22#include <string>
23
24#include "ddt/ddtConstants.hpp"
25#include "ddt/ddtLogger.hpp"
26
27namespace mal = ::elt::mal;
28namespace remotecontrol = ::elt::ddt::remotecontrol;
29
33typedef boost::signals2::signal<void(const std::string&, const std::string&,
34 const std::vector<std::string>&)>
36
40typedef signal_remote::slot_type slot_remote;
41
42namespace ddt {
43
45 : public virtual remotecontrol::AsyncRemoteControlRegistration {
46 public:
52 explicit DdtRemoteControl(const std::string server_uri,
53 DdtLogger* ddt_logger);
54
58 virtual ~DdtRemoteControl();
59
64
72 mal::future<std::string> HandleRemoteCommand(
73 const std::string& image_widget_name, const std::string& command_name,
74 const std::vector<std::string>& command_arguments) override;
75
80 void ProcessResponse(const std::string& response);
81
86
87 protected:
92
93 private:
99 void Init(const std::string server_uri, DdtLogger* ddt_logger);
100
106 const std::string ListCommands();
107
111 void ServerThread();
112
113 std::string uri_string;
114 std::unique_ptr<::elt::mal::rr::Server> server;
115
116 const std::string SERVICE = "RemoteControl";
117 const std::string URI_PATH = "/viewer";
118
119 boost::promise<std::string>* promise;
120 std::atomic<bool> server_busy;
121};
122
123} // namespace ddt
124
125#endif /* DATAVISUALISATION_REMOTECONTROL_SRC_INCLUDE_DDT_DDTREMOTECONTROL_HPP_ \
126 */
Definition ddtLogger.hpp:43
mal::future< std::string > HandleRemoteCommand(const std::string &image_widget_name, const std::string &command_name, const std::vector< std::string > &command_arguments) override
Definition ddtRemoteControl.cpp:79
DdtRemoteControl(const std::string server_uri, DdtLogger *ddt_logger)
Definition ddtRemoteControl.cpp:14
signal_remote remote_command_signal
Definition ddtRemoteControl.hpp:85
virtual ~DdtRemoteControl()
Definition ddtRemoteControl.cpp:19
void ProcessResponse(const std::string &response)
Definition ddtRemoteControl.cpp:119
void StartRemoteControlServer()
Definition ddtRemoteControl.cpp:43
DdtLogger * logger
Definition ddtRemoteControl.hpp:91
Contains common used constants. This file shall contain constants that can be used by all application...
Class to wrap the usage of log4cplus as logging utility. This file provides a wrapper class for the u...
signal_remote::slot_type slot_remote
Definition ddtRemoteControl.hpp:40
boost::signals2::signal< void(const std::string &, const std::string &, const std::vector< std::string > &)> signal_remote
Definition ddtRemoteControl.hpp:35
Definition ddtClient.hpp:32