DevMgr: Implement a wrapper around the yacc parser.
This wrapper reads the -d <devfile> arguments, collates them into one big string and then feeds them into yacc.
This commit is contained in:
@@ -4,23 +4,55 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#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 server;
|
||||
std::vector<std::string> serverParams;
|
||||
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;
|
||||
}
|
||||
|
||||
void handleDeviceSpecifiers(const OptionParser& options);
|
||||
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<InteroceptorDeviceSpec> interoceptorDeviceSpecs;
|
||||
static std::vector<ExtrospectorDeviceSpec> extrospectorDeviceSpecs;
|
||||
};
|
||||
|
||||
#endif // DEVICEMANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user