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 
40  public yarp::os::PortReader,
42 {
43 protected:
44  std::mutex m_external_mutex;
45  std::mutex m_internal_mutex;
47  std::string m_local_name;
48  std::vector<yarp::dev::DeviceDescription> m_robot_devices;
49 
50 public:
51  /* DeviceDriver methods */
52  bool open(yarp::os::Searchable& config) override;
53  bool close() override;
54 
55  bool detachAll() override;
56  bool attachAll(const yarp::dev::PolyDriverList &l) override;
57  bool read(yarp::os::ConnectionReader& connection) override;
58 
59 private:
60  bool add_device(yarp::dev::DeviceDescription dev);
61  bool remove_device(yarp::dev::DeviceDescription dev);
62 };
63 
64 #endif // YARP_DEV_ROBOTDESCRIPTIONSERVER_H
define control board standard interfaces
contains the definition of a Vector type
This device is a storage which contains a list of the currently opened device drivers.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool detachAll() override
Detach the object (you must have first called attach).
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool attachAll(const yarp::dev::PolyDriverList &l) override
Attach to a list of objects.
bool close() override
Close the DeviceDriver.
std::vector< yarp::dev::DeviceDescription > m_robot_devices
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
Interface for an object that can wrap/attach to to another.
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:28
A mini-server for network communication.
Definition: Port.h:50
A base class for nested structures that can be searched.
Definition: Searchable.h:69