Rename DSL: deviceSpec => deviceAttachmentSpec
This language is used broadly to specify how to attach (and thus also how to detach) devices to/from Salmanoff. The next bit of work we'll do is split off the DSL parsing from the management of the list of parsed binary attached spec objects. We'll be creating a PipeDeviceAttachmentParser, and later on when we support URDF, we'll create a URDFDeviceAttachmentParser.
This commit is contained in:
@@ -9,24 +9,26 @@
|
||||
namespace smo {
|
||||
namespace device {
|
||||
|
||||
class SenseDeviceSpec
|
||||
class DeviceAttachmentSpec
|
||||
{
|
||||
public:
|
||||
friend std::ostream& operator<<(
|
||||
std::ostream& os, const SenseDeviceSpec& spec)
|
||||
std::ostream& os, const DeviceAttachmentSpec& spec)
|
||||
{
|
||||
os << spec.stringify();
|
||||
return os;
|
||||
}
|
||||
|
||||
bool operator==(const SenseDeviceSpec& other) const
|
||||
bool operator==(const DeviceAttachmentSpec& other) const
|
||||
{
|
||||
return sensorType == other.sensorType &&
|
||||
return deviceIdentifier == other.deviceIdentifier &&
|
||||
sensorType == other.sensorType &&
|
||||
provider == other.provider &&
|
||||
deviceSelector == other.deviceSelector;
|
||||
}
|
||||
|
||||
public:
|
||||
std::string deviceIdentifier;
|
||||
char sensorType;
|
||||
std::string implexor;
|
||||
std::string api;
|
||||
@@ -38,8 +40,10 @@ public:
|
||||
std::string stringify() const
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "Device: " << sensorType << ", Implexor: "
|
||||
<< implexor << ", API: " << api << ", API Params: (";
|
||||
os << "Device Identifier: " << deviceIdentifier
|
||||
<< ", Sensor Type: " << sensorType
|
||||
<< ", Implexor: " << implexor << ", API: " << api
|
||||
<< ", API Params: (";
|
||||
for (const auto& param : apiParams)
|
||||
{
|
||||
os << param.first;
|
||||
@@ -63,11 +67,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class InteroceptorDeviceSpec : public SenseDeviceSpec
|
||||
class InteroceptorDevAttachmentSpec : public DeviceAttachmentSpec
|
||||
{
|
||||
};
|
||||
|
||||
class ExtrospectorDeviceSpec : public SenseDeviceSpec
|
||||
class ExtrospectorDevAttachmentSpec : public DeviceAttachmentSpec
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef __USER_SENSE_API_LIB_H__
|
||||
#define __USER_SENSE_API_LIB_H__
|
||||
|
||||
#include <preprocessor.h>
|
||||
#include <stdbool.h>
|
||||
#include <user/senseDeviceSpec.h>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <preprocessor.h>
|
||||
#include <user/deviceAttachmentSpec.h>
|
||||
|
||||
namespace smo {
|
||||
namespace sense_api {
|
||||
@@ -14,9 +14,9 @@ namespace sense_api {
|
||||
typedef int (sal_mlo_initializeIndFn)(void);
|
||||
typedef int (sal_mlo_finalizeIndFn)(void);
|
||||
typedef int (sal_mlo_attachDeviceReqFn)(
|
||||
const std::shared_ptr<device::SenseDeviceSpec>& desc);
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec>& desc);
|
||||
typedef int (sal_mlo_detachDeviceReqFn)(
|
||||
const std::shared_ptr<device::SenseDeviceSpec>& desc);
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec>& desc);
|
||||
|
||||
/**
|
||||
* @brief Hooks provided by Salmanoff to senseApi libraries.
|
||||
|
||||
Reference in New Issue
Block a user