Files
salmanoff/hcore/deviceManager/deviceManager.cpp
T
hayodea 0a36f7d370 Build: Add XCB_LIBS; Skeleton: mlo_initializeInd, mlo_attachDeviceReq
* Renamed some of the Sense API lib classes
  (CSensorDeviceDesc=>CSenseDeviceDesc,
  SensorDeviceDesc=>SenseDeviceDesc).
* Moved SenseApiDesc into /include/user/senseApiDesc.
* Add conversion constructor to convert from SenseDeviceDesc
  to
* Wireframe mlo_initializeInd to call xcb_connect().
* Add $(XCB_LIBS) to libxcbXorg_LDFLAGS.
* Wireframe mlo_attachDeviceReq().
2025-01-12 14:31:33 -04:00

49 lines
1.5 KiB
C++

#include <iostream>
#include <fstream>
#include <stdexcept>
#include <string>
#include <vector>
#include <sstream>
#include <memory>
#include <opts.h>
#include <deviceManager/deviceManager.h>
std::vector<std::unique_ptr<InteroceptorDeviceSpec>>
DeviceManager::interoceptorDeviceSpecs;
std::vector<std::unique_ptr<ExtrospectorDeviceSpec>>
DeviceManager::extrospectorDeviceSpecs;
std::vector<std::reference_wrapper<SenseDeviceSpec>>
DeviceManager::senseDeviceSpecs;
std::ostream& operator<<(
std::ostream& os, const SenseDeviceSpec& 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::stringifyDeviceSpecs(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();
}