YARP
Yet Another Robot Platform
RobotDescriptionClient.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_ROBOTDESCRIPTION_CLIENT_H
11 #define YARP_DEV_ROBOTDESCRIPTION_CLIENT_H
12 
13 #include <yarp/os/Network.h>
14 #include <yarp/os/BufferedPort.h>
18 #include <yarp/sig/Vector.h>
19 #include <yarp/os/Time.h>
20 #include <mutex>
21 #include <string>
22 #include <yarp/dev/PolyDriver.h>
24 
40 {
41 protected:
42  std::mutex m_mutex;
44  std::string m_local_name;
45  std::string m_remote_name;
46 
47 public:
48  /* DeviceDriver methods */
49  bool open(yarp::os::Searchable& config) override;
50  bool close() override;
51 
55  bool getAllDevices(std::vector<yarp::dev::DeviceDescription>& dev_list) override;
56 
60  bool getAllDevicesByType(const std::string &type, std::vector<yarp::dev::DeviceDescription>& dev_list) override;
61 
65  bool registerDevice(const yarp::dev::DeviceDescription& dev) override;
66 
70  bool unregisterDevice(const std::string& device_name) override;
71 };
72 
73 #endif // YARP_DEV_ROBOTDESCRIPTION_CLIENT_H
RobotDescriptionClient::m_mutex
std::mutex m_mutex
Definition: RobotDescriptionClient.h:42
Network.h
RobotDescriptionClient::m_local_name
std::string m_local_name
Definition: RobotDescriptionClient.h:44
yarp::dev::IRobotDescription
This interface allows users to retrieve a list which contains the names and the types of the currentl...
Definition: IRobotDescription.h:37
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
Vector.h
contains the definition of a Vector type
RobotDescriptionClient::getAllDevices
bool getAllDevices(std::vector< yarp::dev::DeviceDescription > &dev_list) override
Ask the complete list of all yarp device drivers registered by a robot description server.
Definition: RobotDescriptionClient.cpp:173
IPreciselyTimed.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
RobotDescriptionClient::close
bool close() override
Close the DeviceDriver.
Definition: RobotDescriptionClient.cpp:74
ControlBoardHelpers.h
RobotDescriptionClient::m_rpc_port
yarp::os::Port m_rpc_port
Definition: RobotDescriptionClient.h:43
RobotDescriptionClient::unregisterDevice
bool unregisterDevice(const std::string &device_name) override
Unregister a running yarp device from a robot description server.
Definition: RobotDescriptionClient.cpp:120
RobotDescriptionClient::open
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: RobotDescriptionClient.cpp:29
ControlBoardInterfaces.h
define control board standard interfaces
IRobotDescription.h
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
RobotDescriptionClient
robotDescriptionClient: This client device is used to connect to a robotDescriptionServer and ask inf...
Definition: RobotDescriptionClient.h:40
yarp::dev::DeviceDescription
Definition: IRobotDescription.h:21
PolyDriver.h
BufferedPort.h
RobotDescriptionClient::getAllDevicesByType
bool getAllDevicesByType(const std::string &type, std::vector< yarp::dev::DeviceDescription > &dev_list) override
Ask a list of all registered yarp device drivers whose type corresponds to the given param.
Definition: RobotDescriptionClient.cpp:81
RobotDescriptionClient::registerDevice
bool registerDevice(const yarp::dev::DeviceDescription &dev) override
Register a new running yarp device into a robot description server.
Definition: RobotDescriptionClient.cpp:146
Time.h
RobotDescriptionClient::m_remote_name
std::string m_remote_name
Definition: RobotDescriptionClient.h:45