70 lines
1.7 KiB
C++
70 lines
1.7 KiB
C++
#ifndef DEVICEMANAGER_H
|
|
#define DEVICEMANAGER_H
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <memory>
|
|
#include <opts.h>
|
|
#include <utility>
|
|
#include <iostream>
|
|
#include <functional>
|
|
#include <user/deviceAttachmentSpec.h>
|
|
#include <deviceManager/device.h>
|
|
|
|
namespace smo {
|
|
namespace device {
|
|
|
|
class DeviceManager
|
|
{
|
|
public:
|
|
static DeviceManager& getInstance()
|
|
{
|
|
static DeviceManager instance;
|
|
return instance;
|
|
}
|
|
|
|
void initialize(void)
|
|
{};
|
|
void finalize(void)
|
|
{};
|
|
|
|
std::string readDapSpecFile(const std::string& filename);
|
|
void collateAllDapSpecs(void);
|
|
void parseAllDapSpecs(void);
|
|
|
|
static const std::string stringifyDeviceSpecs(void);
|
|
|
|
// 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(
|
|
std::shared_ptr<DeviceAttachmentSpec> spec,
|
|
newDeviceAttachmentSpecIndCbFn callback);
|
|
|
|
private:
|
|
DeviceManager() = default;
|
|
~DeviceManager() = default;
|
|
DeviceManager(const DeviceManager&) = delete;
|
|
DeviceManager& operator=(const DeviceManager&) = delete;
|
|
|
|
public:
|
|
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;
|
|
static std::vector<std::shared_ptr<Device>> devices;
|
|
|
|
private:
|
|
class NewDeviceAttachmentSpecInd;
|
|
};
|
|
|
|
} // namespace device
|
|
} // namespace smo
|
|
|
|
#endif // DEVICEMANAGER_H
|