47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
#include <iostream>
|
|
#include <fstream>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <sstream>
|
|
#include <opts.h>
|
|
#include <deviceManager/deviceManager.h>
|
|
|
|
|
|
std::vector<DeviceManager::InteroceptorDeviceSpec>
|
|
DeviceManager::interoceptorDeviceSpecs;
|
|
std::vector<DeviceManager::ExtrospectorDeviceSpec>
|
|
DeviceManager::extrospectorDeviceSpecs;
|
|
|
|
std::ostream& operator<<(
|
|
std::ostream& os, const DeviceManager::SensorDeviceSpec& spec)
|
|
{
|
|
os << "Device: " << spec.sensorType << ", Implexor: "
|
|
<< spec.implexor << ", API: " << spec.api
|
|
<< ", API Params: (";
|
|
for (auto it = spec.apiParams.begin(); it != spec.apiParams.end(); ++it) {
|
|
os << *it << (it + 1 == spec.apiParams.end() ? "" : " ");
|
|
}
|
|
os << "), Provider: " << spec.provider << ", Provider Params: (";
|
|
for (auto it = spec.providerParams.begin(); it != spec.providerParams.end(); ++it) {
|
|
os << *it << (it + 1 == spec.providerParams.end() ? "" : " ");
|
|
}
|
|
os << "), Device Selector: " << spec.deviceSelector << std::endl;
|
|
return os;
|
|
}
|
|
|
|
const std::string DeviceManager::printDeviceSpecs(void)
|
|
{
|
|
std::ostringstream oss;
|
|
|
|
for (const auto& spec : DeviceManager::interoceptorDeviceSpecs) {
|
|
oss << "Interoceptor " << spec;
|
|
}
|
|
|
|
for (const auto& spec : DeviceManager::extrospectorDeviceSpecs) {
|
|
oss << "Extrospector " << spec;
|
|
}
|
|
|
|
return oss.str();
|
|
}
|