09caf314f1
We decided to get rid of the C FFI for libs. It was becoming too intricate and complicated. It was becoming a technical burden and expanding into too much extra code. It's unfortunate, but we'll have to give up on getting out-of-tree hot-loadable libraries the easy way. It's possible to still do it with cross compilation or by keeping track of the libstdc++ version that the running harikoff binary was compiled against. Then we can ensure that our loadable lib code is linked against that same libstdc++ code and this should ensure ABI stability.
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
#ifndef DEVICEMANAGER_H
|
|
#define DEVICEMANAGER_H
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <memory>
|
|
#include <opts.h>
|
|
#include <utility>
|
|
#include <iostream>
|
|
#include <user/senseDeviceSpec.h>
|
|
|
|
namespace hk {
|
|
namespace device {
|
|
|
|
class DeviceManager
|
|
{
|
|
public:
|
|
static DeviceManager& getInstance()
|
|
{
|
|
static DeviceManager instance;
|
|
return instance;
|
|
}
|
|
|
|
std::string readDeviceFile(const std::string& filename);
|
|
void collateAllDeviceSpecs(void);
|
|
void parseAllDeviceSpecs(void);
|
|
static const std::string stringifyDeviceSpecs(void);
|
|
|
|
private:
|
|
DeviceManager() = default;
|
|
~DeviceManager() = default;
|
|
DeviceManager(const DeviceManager&) = delete;
|
|
DeviceManager& operator=(const DeviceManager&) = delete;
|
|
|
|
public:
|
|
std::string allDeviceSpecs;
|
|
static std::vector<std::shared_ptr<InteroceptorDeviceSpec>>
|
|
interoceptorDeviceSpecs;
|
|
static std::vector<std::shared_ptr<ExtrospectorDeviceSpec>>
|
|
extrospectorDeviceSpecs;
|
|
static std::vector<std::shared_ptr<SenseDeviceSpec>>
|
|
senseDeviceSpecs;
|
|
};
|
|
|
|
} // namespace device
|
|
} // namespace hk
|
|
|
|
#endif // DEVICEMANAGER_H
|