YARP
Yet Another Robot Platform
PolyDriverList.cpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
8 
9 #include <vector>
10 
11 
12 #define RES(v) ((std::vector<PolyDriverDescriptor> *)v)
13 
14 using namespace yarp::dev;
15 
17 {
18  descriptors=new std::vector<PolyDriverDescriptor>;
19 }
20 
22 {
23  delete RES(descriptors);
24 }
25 
27 {
28  return &(*RES(descriptors))[k];
29 }
30 
32 {
33  return &(*RES(descriptors))[k];
34 }
35 
37 {
38  return (int)RES(descriptors)->size();
39 }
40 
41 void PolyDriverList::push(PolyDriver *p, const char *k)
42 {
43  RES(descriptors)->push_back(PolyDriverDescriptor(p, k));
44 }
45 
47 {
48  RES(descriptors)->push_back(v);
49 }
50 
52 {
53  *RES(descriptors)=*RES(l.descriptors);
54  return *this;
55 }
#define RES(v)
void push(PolyDriver *p, const char *k)
yarp::dev::PolyDriverDescriptor * operator[](int k)
const PolyDriverList & operator=(const PolyDriverList &)
A container for a device driver.
Definition: PolyDriver.h:23
For streams capable of holding different kinds of content, check what they actually have.