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:
2025-08-29 15:16:11 -04:00
parent 8f41e164a2
commit 6ef86eea05
10 changed files with 89 additions and 78 deletions
+9 -7
View File
@@ -5,7 +5,7 @@
#include <vector>
#include <memory>
#include <user/senseApiDesc.h>
#include <user/senseDeviceSpec.h>
#include <user/deviceAttachmentSpec.h>
#include <xcbXorg/xcbXorg.h>
namespace xcb_window {
@@ -30,23 +30,25 @@ struct WindowSelector
class AttachedWindow
{
public:
AttachedWindow(const std::shared_ptr<smo::device::SenseDeviceSpec>& spec);
AttachedWindow(
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& spec);
~AttachedWindow();
const std::shared_ptr<smo::device::SenseDeviceSpec>& getDeviceSpec() const
{ return deviceSpec; }
const std::shared_ptr<smo::device::DeviceAttachmentSpec>&
getDeviceAttachmentSpec() const
{ return deviceAttachmentSpec; }
const WindowSelector& getWindowSelector() const { return windowSelector; }
const std::string& getActualWindowName() const { return actualWindowName; }
void* getXcbConnection() const { return xcbConnectionShared.get(); }
std::string stringify() const;
private:
void parseWindowSelector(const smo::device::SenseDeviceSpec& spec);
void parseWindowSelector(const smo::device::DeviceAttachmentSpec& spec);
int getRequiredParamAsInt(
const smo::device::SenseDeviceSpec& spec,
const smo::device::DeviceAttachmentSpec& spec,
const std::string& paramName);
std::shared_ptr<smo::device::SenseDeviceSpec> deviceSpec;
std::shared_ptr<smo::device::DeviceAttachmentSpec> deviceAttachmentSpec;
WindowSelector windowSelector;
std::string actualWindowName;
std::shared_ptr<xcb_xorg::XcbConnection> xcbConnectionShared;