Files
salmanoff/smocore/include/deviceManager/deviceManager.h
T

70 lines
1.7 KiB
C++
Raw Normal View History

#ifndef DEVICEMANAGER_H
#define DEVICEMANAGER_H
#include <vector>
#include <string>
#include <memory>
#include <opts.h>
#include <utility>
#include <iostream>
2025-09-20 18:23:03 -04:00
#include <functional>
#include <user/deviceAttachmentSpec.h>
2025-08-29 17:42:13 -04:00
#include <deviceManager/device.h>
2025-07-22 06:48:04 -04:00
namespace smo {
namespace device {
class DeviceManager
{
public:
static DeviceManager& getInstance()
{
static DeviceManager instance;
return instance;
}
void initialize(void)
{};
void finalize(void)
{};
2025-08-29 16:12:30 -04:00
std::string readDapSpecFile(const std::string& filename);
void collateAllDapSpecs(void);
void parseAllDapSpecs(void);
static const std::string stringifyDeviceSpecs(void);
2025-08-29 17:42:13 -04:00
// New async function for device attachment
typedef std::function<void(
bool success, std::shared_ptr<Device> device,
std::shared_ptr<DeviceAttachmentSpec> deviceSpec)>
newDeviceAttachmentSpecIndCbFn;
void newDeviceAttachmentSpecInd(
2025-08-29 17:42:13 -04:00
std::shared_ptr<DeviceAttachmentSpec> spec,
newDeviceAttachmentSpecIndCbFn callback);
2025-08-29 17:42:13 -04:00
private:
DeviceManager() = default;
~DeviceManager() = default;
DeviceManager(const DeviceManager&) = delete;
DeviceManager& operator=(const DeviceManager&) = delete;
public:
2025-08-29 16:12:30 -04:00
std::string allDapSpecs;
static std::vector<std::shared_ptr<InteroceptorDevAttachmentSpec>>
interoceptorDeviceSpecs;
static std::vector<std::shared_ptr<ExtrospectorDevAttachmentSpec>>
extrospectorDeviceSpecs;
static std::vector<std::shared_ptr<DeviceAttachmentSpec>>
deviceAttachmentSpecs;
2025-08-29 17:42:13 -04:00
static std::vector<std::shared_ptr<Device>> devices;
private:
class NewDeviceAttachmentSpecInd;
};
} // namespace device
2025-07-22 06:48:04 -04:00
} // namespace smo
#endif // DEVICEMANAGER_H