YARP
Yet Another Robot Platform
IRobotDescription.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_IROBOTDESCRIPTION_H
10 #define YARP_DEV_IROBOTDESCRIPTION_H
11 
12 #include <yarp/dev/api.h>
13 #include <yarp/os/Vocab.h>
14 #include <vector>
15 #include <string>
16 
17 namespace yarp {
18 namespace dev {
19 
21 {
22  std::string device_name;
23  std::string device_type;
24  bool operator ==(DeviceDescription const& b) const
25  {
26  return this->device_name == b.device_name && this->device_type == b.device_type;
27  }
28 };
29 
37 {
38 public:
42  virtual ~IRobotDescription();
43 
47  virtual bool getAllDevices(std::vector<DeviceDescription>& dev_list) = 0;
48 
52  virtual bool getAllDevicesByType(const std::string &type, std::vector<DeviceDescription>& dev_list) = 0;
53 
57  virtual bool registerDevice(const DeviceDescription& dev) = 0;
58 
62  virtual bool unregisterDevice(const std::string& device_name) = 0;
63 };
64 
65 } // namespace dev
66 } // namespace yarp
67 
75 
76 #endif // YARP_DEV_IROBOTDESCRIPTION_H
VOCAB_IROBOT_BY_TYPE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_BY_TYPE
Definition: IRobotDescription.h:74
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
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
VOCAB_IROBOT_DEVICE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DEVICE
Definition: IRobotDescription.h:73
yarp::dev::DeviceDescription::operator==
bool operator==(DeviceDescription const &b) const
Definition: IRobotDescription.h:24
yarp::dev::DeviceDescription::device_type
std::string device_type
Definition: IRobotDescription.h:23
VOCAB_IROBOT_DESCRIPTION
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DESCRIPTION
Definition: IRobotDescription.h:68
yarp::dev::DeviceDescription
Definition: IRobotDescription.h:21
VOCAB_IROBOT_SET
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_SET
Definition: IRobotDescription.h:70
yarp::dev::IRobotDescription::registerDevice
virtual bool registerDevice(const DeviceDescription &dev)=0
Register a new running yarp device into a robot description server.
yarp::dev::DeviceDescription::device_name
std::string device_name
Definition: IRobotDescription.h:22
yarp::dev::IRobotDescription::~IRobotDescription
virtual ~IRobotDescription()
Destructor.
VOCAB_IROBOT_DELETE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DELETE
Definition: IRobotDescription.h:71
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IRobotDescription::getAllDevicesByType
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.
VOCAB_IROBOT_GET
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_GET
Definition: IRobotDescription.h:69
yarp::dev::IRobotDescription::unregisterDevice
virtual bool unregisterDevice(const std::string &device_name)=0
Unregister a running yarp device from a robot description server.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
VOCAB_IROBOT_ALL
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_ALL
Definition: IRobotDescription.h:72
yarp::dev::IRobotDescription::getAllDevices
virtual bool getAllDevices(std::vector< DeviceDescription > &dev_list)=0
Ask the complete list of all yarp device drivers registered by a robot description server.
api.h