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

64 lines
1.6 KiB
C++

#ifndef DEVICEMANAGER_H
#define DEVICEMANAGER_H
#include <vector>
#include <string>
#include <memory>
#include <opts.h>
#include <utility>
#include <iostream>
class DeviceManager
{
public:
struct SensorDeviceSpec
{
char sensorType;
std::string implexor;
std::string api;
std::vector<std::string> apiParams;
std::string provider;
std::vector<std::string> providerParams;
std::string deviceSelector;
friend std::ostream& operator<<(
std::ostream& os, const SensorDeviceSpec& spec);
};
struct InteroceptorDeviceSpec : public SensorDeviceSpec
{
};
struct ExtrospectorDeviceSpec : public SensorDeviceSpec
{
};
static DeviceManager& getInstance()
{
static DeviceManager instance;
return instance;
}
std::string readDeviceFile(const std::string& filename);
void collateAllDeviceSpecs(const OptionParser& options);
void parseAllDeviceSpecs(void);
static const std::string printDeviceSpecs();
private:
DeviceManager() = default;
~DeviceManager() = default;
DeviceManager(const DeviceManager&) = delete;
DeviceManager& operator=(const DeviceManager&) = delete;
public:
std::string allDeviceSpecs;
static std::vector<std::unique_ptr<InteroceptorDeviceSpec>>
interoceptorDeviceSpecs;
static std::vector<std::unique_ptr<ExtrospectorDeviceSpec>>
extrospectorDeviceSpecs;
static std::vector<std::reference_wrapper<SensorDeviceSpec>>
sensorDeviceSpecs;
};
#endif // DEVICEMANAGER_H