YARP
Yet Another Robot Platform
IRobotDescription.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_IROBOTDESCRIPTION_H
7 #define YARP_DEV_IROBOTDESCRIPTION_H
8 
9 #include <yarp/dev/api.h>
10 #include <yarp/os/Vocab.h>
11 #include <vector>
12 #include <string>
13 
14 namespace yarp {
15 namespace dev {
16 
18 {
19  std::string device_name;
20  std::string device_type;
21  bool operator ==(DeviceDescription const& b) const
22  {
23  return this->device_name == b.device_name && this->device_type == b.device_type;
24  }
25 };
26 
34 {
35 public:
39  virtual ~IRobotDescription();
40 
44  virtual bool getAllDevices(std::vector<DeviceDescription>& dev_list) = 0;
45 
49  virtual bool getAllDevicesByType(const std::string &type, std::vector<DeviceDescription>& dev_list) = 0;
50 
54  virtual bool registerDevice(const DeviceDescription& dev) = 0;
55 
59  virtual bool unregisterDevice(const std::string& device_name) = 0;
60 };
61 
62 } // namespace dev
63 } // namespace yarp
64 
72 
73 #endif // YARP_DEV_IROBOTDESCRIPTION_H
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_SET
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DEVICE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DELETE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DESCRIPTION
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_BY_TYPE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_ALL
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_GET
This interface allows users to retrieve a list which contains the names and the types of the currentl...
virtual ~IRobotDescription()
Destructor.
virtual bool registerDevice(const DeviceDescription &dev)=0
Register a new running yarp device into a robot description server.
virtual bool getAllDevices(std::vector< DeviceDescription > &dev_list)=0
Ask the complete list of all yarp device drivers registered by a robot description server.
virtual bool getAllDevicesByType(const std::string &type, std::vector< DeviceDescription > &dev_list)=0
Ask a list of all registered yarp device drivers whose type corresponds to the given param.
virtual bool unregisterDevice(const std::string &device_name)=0
Unregister a running yarp device from a robot description server.
std::int32_t vocab32_t
Definition: numeric.h:78
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition: Vocab.h:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
bool operator==(DeviceDescription const &b) const
#define YARP_dev_API
Definition: api.h:18