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 associated documentation files(the
5 "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
6 merge, publish, distribute, sublicense, and / or sell copies("Use") of the Software, and to permit persons to whom the
7 Software is furnished to do so. The above copyright notice and this permission notice shall be included in all copies or
8 substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
10 NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
11 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
12 OR OTHER DEALINGS IN THE SOFTWARE.
13 */
14 #pragma once
15 
16 #include <QUdpSocket>
17 #include <QtPlugin>
18 #include <thread>
21 
22 using namespace PJ;
23 
25 {
26  Q_OBJECT
27  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.DataStreamer")
28  Q_INTERFACES(PJ::DataStreamer)
29 
30 public:
31  UDP_Server();
32 
33  virtual bool start(QStringList*) override;
34 
35  virtual void shutdown() override;
36 
37  virtual bool isRunning() const override
38  {
39  return _running;
40  }
41 
42  virtual ~UDP_Server() override;
43 
44  virtual const char* name() const override
45  {
46  return "UDP Server";
47  }
48 
49  virtual bool isDebugPlugin() override
50  {
51  return false;
52  }
53 
54 private:
55  bool _running;
56  QUdpSocket* _udp_socket;
58 
59 private slots:
60 
61  void processMessage();
62 };
63 
64 
virtual bool isDebugPlugin() override
Definition: udp_server.h:49
The DataStreamer base class to create your own plugin.
std::shared_ptr< MessageParser > MessageParserPtr
bool _running
Definition: udp_server.h:55
virtual bool isRunning() const override
Definition: udp_server.h:37
QUdpSocket * _udp_socket
Definition: udp_server.h:56
virtual const char * name() const override
Definition: udp_server.h:44
PJ::MessageParserPtr _parser
Definition: udp_server.h:57


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:48