YARP
Yet Another Robot Platform
RobotDescriptionServer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_ROBOTDESCRIPTIONSERVER_H
10 #define YARP_DEV_ROBOTDESCRIPTIONSERVER_H
11 
12 
13 #include <yarp/os/Network.h>
14 #include <yarp/os/BufferedPort.h>
18 #include <yarp/sig/Vector.h>
19 #include <mutex>
20 #include <yarp/os/Time.h>
21 #include <string>
22 #include <yarp/dev/PolyDriver.h>
25 
42  public yarp::os::PortReader,
44 {
45 protected:
46  std::mutex m_external_mutex;
47  std::mutex m_internal_mutex;
49  std::string m_local_name;
50  std::vector<yarp::dev::DeviceDescription> m_robot_devices;
51 
52 public:
53  /* DeviceDriver methods */
54  bool open(yarp::os::Searchable& config) override;
55  bool close() override;
56 
57  bool detachAll() override;
58  bool attachAll(const yarp::dev::PolyDriverList &l) override;
59  bool read(yarp::os::ConnectionReader& connection) override;
60 
61 private:
62  bool add_device(yarp::dev::DeviceDescription dev);
63  bool remove_device(yarp::dev::DeviceDescription dev);
64 };
65 
66 #endif // YARP_DEV_ROBOTDESCRIPTIONSERVER_H
Network.h
RobotDescriptionServer::attachAll
bool attachAll(const yarp::dev::PolyDriverList &l) override
Attach to a list of objects.
Definition: RobotDescriptionServer.cpp:52
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
IPreciselyTimed.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
RobotDescriptionServer::m_robot_devices
std::vector< yarp::dev::DeviceDescription > m_robot_devices
Definition: RobotDescriptionServer.h:50
RobotDescriptionServer::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: RobotDescriptionServer.cpp:114
ControlBoardHelpers.h
yarp::dev::PolyDriverList
Definition: PolyDriverList.h:22
RobotDescriptionServer::detachAll
bool detachAll() override
Detach the object (you must have first called attach).
Definition: RobotDescriptionServer.cpp:72
ControlBoardInterfaces.h
define control board standard interfaces
RobotDescriptionServer
robotDescriptionServer: This device is a storage which contains a list of the currently opened device...
Definition: RobotDescriptionServer.h:44
IRobotDescription.h
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::dev::DeviceDescription
Definition: IRobotDescription.h:21
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
PolyDriver.h
BufferedPort.h
RobotDescriptionServer::open
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: RobotDescriptionServer.cpp:28
IMultipleWrapper.h
RobotDescriptionServer::m_rpc_port
yarp::os::Port m_rpc_port
Definition: RobotDescriptionServer.h:48
RobotDescriptionServer::m_internal_mutex
std::mutex m_internal_mutex
Definition: RobotDescriptionServer.h:47
RobotDescriptionServer::m_external_mutex
std::mutex m_external_mutex
Definition: RobotDescriptionServer.h:46
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::dev::IMultipleWrapper
Interface for an object that can wrap/attach to to another.
Definition: IMultipleWrapper.h:30
RobotDescriptionServer::close
bool close() override
Close the DeviceDriver.
Definition: RobotDescriptionServer.cpp:79
Time.h
RobotDescriptionServer::m_local_name
std::string m_local_name
Definition: RobotDescriptionServer.h:49