udp_server.h
Go to the documentation of this file.
1 /*DataStreamServer PlotJuggler Plugin license(Faircode)
2 
3 Copyright(C) 2018 Philippe Gauthier - ISIR - UPMC
4 Permission is hereby granted to any person obtaining a copy of this software and
5 associated documentation files(the "Software"), to deal in the Software without
6 restriction, including without limitation the rights to use, copy, modify, merge, publish,
7 distribute, sublicense, and / or sell copies("Use") of the Software, and to permit persons
8 to whom the Software is furnished to do so. The above copyright notice and this permission
9 notice shall be included in all copies or substantial portions of the Software. THE
10 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
11 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
12 NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
13 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
14 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
15 THE SOFTWARE.
16 */
17 #pragma once
18 
19 #include <QUdpSocket>
20 #include <QtPlugin>
21 #include <thread>
24 
25 using namespace PJ;
26 
28 {
29  Q_OBJECT
30  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.DataStreamer")
31  Q_INTERFACES(PJ::DataStreamer)
32 
33 public:
34  UDP_Server();
35 
36  virtual bool start(QStringList*) override;
37 
38  virtual void shutdown() override;
39 
40  virtual bool isRunning() const override
41  {
42  return _running;
43  }
44 
45  virtual ~UDP_Server() override;
46 
47  virtual const char* name() const override
48  {
49  return "UDP Server";
50  }
51 
52  virtual bool isDebugPlugin() override
53  {
54  return false;
55  }
56 
57 private:
58  bool _running;
59  QUdpSocket* _udp_socket;
61 
62 private slots:
63 
64  void processMessage();
65 };
PJ::MessageParserPtr
std::shared_ptr< MessageParser > MessageParserPtr
Definition: messageparser_base.h:136
UDP_Server::isDebugPlugin
virtual bool isDebugPlugin() override
Definition: udp_server.h:52
UDP_Server::_running
bool _running
Definition: udp_server.h:58
PJ::DataStreamer
The DataStreamer base classm used to read streaming of data.
Definition: datastreamer_base.h:25
shutdown
ROSCONSOLE_DECL void shutdown()
UDP_Server::isRunning
virtual bool isRunning() const override
isRunning
Definition: udp_server.h:40
start
ROSCPP_DECL void start()
UDP_Server::_udp_socket
QUdpSocket * _udp_socket
Definition: udp_server.h:59
UDP_Server::name
virtual const char * name() const override
Name of the plugin type, NOT the particular instance.
Definition: udp_server.h:47
PJ
Definition: dataloader_base.h:16
UDP_Server::_parser
PJ::MessageParserPtr _parser
Definition: udp_server.h:60
UDP_Server
Definition: udp_server.h:27
datastreamer_base.h
messageparser_base.h


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:26