Files
salmanoff/include/user/senseDeviceSpec.h
T
hayodea 09caf314f1 Eliminate the C FFI; Namespace lib API and DeviceManager
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.
2025-01-13 21:57:11 -04:00

70 lines
1.5 KiB
C++

#ifndef SENSORDEVICESPEC_H
#define SENSORDEVICESPEC_H
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
namespace hk {
namespace device {
class SenseDeviceSpec
{
public:
friend std::ostream& operator<<(
std::ostream& os, const SenseDeviceSpec& spec)
{
os << spec.stringify();
return os;
}
bool operator==(const SenseDeviceSpec& other) const
{
return sensorType == other.sensorType &&
provider == other.provider &&
deviceSelector == other.deviceSelector;
}
public:
char sensorType;
std::string implexor;
std::string api;
std::vector<std::string> apiParams;
std::string provider;
std::vector<std::string> providerParams;
std::string deviceSelector;
std::string stringify() const
{
std::ostringstream os;
os << "Device: " << sensorType << ", Implexor: "
<< implexor << ", API: " << api << ", API Params: (";
for (const auto& param : apiParams)
{
os << param << " ";
}
os << "), Provider: " << provider << ", Provider Params: (";
for (const auto& param : providerParams)
{
os << param << " ";
}
os << "), Device Selector: " << deviceSelector << std::endl;
return os.str();
}
};
class InteroceptorDeviceSpec : public SenseDeviceSpec
{
};
class ExtrospectorDeviceSpec : public SenseDeviceSpec
{
};
} // namespace device
} // namespace hk
#endif // SENSORDEVICESPEC_H