2025-01-05 14:19:53 -04:00
|
|
|
#ifndef DEVICEMANAGER_H
|
|
|
|
|
#define DEVICEMANAGER_H
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <opts.h>
|
2025-01-07 14:11:51 -04:00
|
|
|
#include <utility>
|
|
|
|
|
#include <iostream>
|
2025-01-05 14:19:53 -04:00
|
|
|
|
|
|
|
|
class DeviceManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
2025-01-07 14:11:51 -04:00
|
|
|
struct SensorDeviceSpec
|
|
|
|
|
{
|
|
|
|
|
char sensorType;
|
|
|
|
|
std::string implexor;
|
|
|
|
|
std::string api;
|
|
|
|
|
std::vector<std::string> apiParams;
|
2025-01-07 20:03:03 -04:00
|
|
|
std::string provider;
|
|
|
|
|
std::vector<std::string> providerParams;
|
2025-01-07 14:11:51 -04:00
|
|
|
std::string deviceSelector;
|
|
|
|
|
|
|
|
|
|
friend std::ostream& operator<<(
|
|
|
|
|
std::ostream& os, const SensorDeviceSpec& spec);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct InteroceptorDeviceSpec : public SensorDeviceSpec
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ExtrospectorDeviceSpec : public SensorDeviceSpec
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
|
2025-01-05 14:19:53 -04:00
|
|
|
static DeviceManager& getInstance()
|
|
|
|
|
{
|
|
|
|
|
static DeviceManager instance;
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-07 14:11:51 -04:00
|
|
|
std::string readDeviceFile(const std::string& filename);
|
|
|
|
|
void collateAllDeviceSpecs(const OptionParser& options);
|
|
|
|
|
void parseAllDeviceSpecs(void);
|
|
|
|
|
static const std::string printDeviceSpecs();
|
2025-01-05 14:19:53 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DeviceManager() = default;
|
|
|
|
|
~DeviceManager() = default;
|
|
|
|
|
DeviceManager(const DeviceManager&) = delete;
|
|
|
|
|
DeviceManager& operator=(const DeviceManager&) = delete;
|
2025-01-07 14:11:51 -04:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
std::string allDeviceSpecs;
|
|
|
|
|
static std::vector<InteroceptorDeviceSpec> interoceptorDeviceSpecs;
|
|
|
|
|
static std::vector<ExtrospectorDeviceSpec> extrospectorDeviceSpecs;
|
2025-01-05 14:19:53 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // DEVICEMANAGER_H
|