API Documentation
Loading...
Searching...
No Matches
DeviceManager.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Device.h>
4#include <QObject>
5namespace NDEVR
6{
7 /**--------------------------------------------------------------------------------------------------
8 \brief Container for all active Devices connected to the software.
9 **/
10 class HARDWARE_API DeviceManager : public QObject
11 {
12 Q_OBJECT
13 public:
15 bool hasDevice(const UUID& id) const
16 {
17 return m_device_lookup.hasKey(id);
18 }
19 Device* device(const UUID& id)
20 {
21 return m_device_lookup.get(id);
22 }
23 void addDevice(Device* device);
24 void removeDevice(const UUID& id);
25 void update();
27 signals:
29 void deviceRemovedSignal(const UUID& id);
30
31 protected:
34 };
35}
#define HARDWARE_API
Definition DLLInfo.h:56
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A root class which describes some physical object, such as a Motor, Sensor, or Connection....
Definition Device.h:52
Container for all active Devices connected to the software.
Definition DeviceManager.h:11
static DeviceManager & DefaultManager()
Buffer< UUID > m_added_objects
Definition DeviceManager.h:32
void removeDevice(const UUID &id)
void deviceRemovedSignal(const UUID &id)
Device * device(const UUID &id)
Definition DeviceManager.h:19
bool hasDevice(const UUID &id) const
Definition DeviceManager.h:15
void addDevice(Device *device)
Dictionary< UUID, Device * > m_device_lookup
Definition DeviceManager.h:33
void devicesAddedSignal(const Buffer< UUID > &ids)
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37