Instrument Neutral Distributed Interface INDI 2.2.5
hotplugcapabledevice.h
Go to the documentation of this file.
1/*
2 Hot Plug Capable Device Class Header File
3
4 Copyright (C) 2026 Jasem Mutlaq ([email protected])
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19*/
20
21#pragma once
22
23#include "defaultdevice.h"
24#include <memory>
25#include <string>
26#include <vector>
27#include <map>
28
29namespace INDI
30{
31
33{
34 public:
36 virtual ~HotPlugCapableDevice() = default;
37
41 static const char* getDeviceName()
42 {
43 return "HotPlugCapableDevice";
44 }
45
50 virtual std::vector<std::string> discoverConnectedDeviceIdentifiers() = 0;
51
57 virtual std::shared_ptr<DefaultDevice> createDevice(const std::string& identifier) = 0;
58
63 virtual void destroyDevice(std::shared_ptr<DefaultDevice> device) = 0;
64
69 virtual const std::map<std::string, std::shared_ptr<DefaultDevice>>& getManagedDevices() const = 0;
70};
71
72} // namespace INDI
hid_device * device
virtual void destroyDevice(std::shared_ptr< DefaultDevice > device)=0
Destroys a device instance and performs driver-specific cleanup.
virtual std::shared_ptr< DefaultDevice > createDevice(const std::string &identifier)=0
Factory method to create a new device instance.
virtual ~HotPlugCapableDevice()=default
static const char * getDeviceName()
Static name used for LOGGING purposes.
virtual const std::map< std::string, std::shared_ptr< DefaultDevice > > & getManagedDevices() const =0
Provides a unified map view of currently managed devices.
virtual std::vector< std::string > discoverConnectedDeviceIdentifiers()=0
Discovers currently connected devices of this driver's type.
Namespace to encapsulate INDI client, drivers, and mediator classes.