YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RobotDescription_nws_yarp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_ROBOTDESCRIPTION_NWS_YARP_H
7#define YARP_DEV_ROBOTDESCRIPTION_NWS_YARP_H
8
9#include <mutex>
10#include <string>
11
13#include <yarp/dev/PolyDriver.h>
16
18
20
22{
23 private:
24 yarp::dev::IRobotDescription* m_istorage = nullptr;
25 std::mutex m_mutex;
26
27 public:
29 virtual ~IRobotDescriptiond() { m_istorage=nullptr; }
30
31 virtual return_getAllDevices getAllDevicesRPC() override;
32 virtual return_getAllDevicesByType getAllDevicesByTypeRPC(const std::string& type) override;
34 virtual yarp::dev::ReturnValue unregisterDeviceRPC(const std::string& dev) override;
36
37 std::mutex* getMutex() {return &m_mutex;}
38};
39
56{
57protected:
58 std::mutex m_mutex;
60
61 //thrift
62 std::unique_ptr <IRobotDescriptiond> m_RPC;
63
64public:
65 /* DeviceDriver methods */
66 bool open(yarp::os::Searchable& config) override;
67 bool close() override;
68
69 bool detach() override;
70 bool attach(yarp::dev::PolyDriver* driver) override;
71 bool read(yarp::os::ConnectionReader& connection) override;
72};
73
74#endif // YARP_DEV_ROBOTDESCRIPTION_NWS_YARP_H
virtual yarp::dev::ReturnValue unregisterAllRPC() override
virtual return_getAllDevices getAllDevicesRPC() override
virtual yarp::dev::ReturnValue registerDeviceRPC(const yarp::dev::DeviceDescription &dev) override
IRobotDescriptiond(yarp::dev::IRobotDescription *stor)
virtual return_getAllDevicesByType getAllDevicesByTypeRPC(const std::string &type) override
virtual yarp::dev::ReturnValue unregisterDeviceRPC(const std::string &dev) override
This class is the parameters parser for class RobotDescription_nws_yarp.
RobotDescription_nws_yarp: This device is a storage which contains a list of the currently opened dev...
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
std::unique_ptr< IRobotDescriptiond > m_RPC
bool attach(yarp::dev::PolyDriver *driver) override
Attach to another object.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool detach() override
Detach the object (you must have first called attach).
Interface implemented by all device drivers.
This interface allows users to retrieve a list which contains the names and the types of the currentl...
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
An interface for reading from a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31