OpenCOVER
deviceDiscovery.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8/*
9 * inputsource.h
10 *
11 * Created on: Dec 5, 2014
12 * Author: svnvlad
13 */
14
15#ifndef DEVICEDISCOVERY_H
16#define DEVICEDISCOVERY_H
17
18#include <util/coExport.h>
19#include <string>
20#include <vector>
21#include <OpenThreads/Thread>
22#include <OpenThreads/Mutex>
23#include <util/UDPComm.h>
24
25
26namespace opencover
27{
28
29
30 class COVEREXPORT deviceInfo
31 {
32 public:
33 deviceInfo(const char *buf,std::string addr);
34 virtual ~deviceInfo();
35
36 std::string deviceName;
37 std::string pluginName;
38 std::string address;
39
40 protected:
41
42
43 private:
44 };
45
46 class COVEREXPORT deviceDiscovery : public OpenThreads::Thread
47 {
48 public:
51 void init();
52 void update(); //< called by Input::update()
53 void run(); //regularly check for new devices
54
55 std::vector<deviceInfo*> devices;
56 std::vector<deviceInfo*> toAdd;
57
58 private:
59 bool running = true;
60 std::string broadcastAddress;
61 int port;
62 UDPComm * dComm=nullptr;
63 OpenThreads::Mutex mutex;
64 };
65
66}
67#endif
Definition: ARToolKit.h:33
Definition: deviceDiscovery.h:31
std::string deviceName
Definition: deviceDiscovery.h:36
std::string address
Definition: deviceDiscovery.h:38
deviceInfo(const char *buf, std::string addr)
std::string pluginName
Definition: deviceDiscovery.h:37
Definition: deviceDiscovery.h:47
std::vector< deviceInfo * > toAdd
Definition: deviceDiscovery.h:56
std::vector< deviceInfo * > devices
Definition: deviceDiscovery.h:55