YARP
Yet Another Robot Platform
PolyDriverList.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
11 
12 #include <vector>
13 
14 
15 #define RES(v) ((std::vector<PolyDriverDescriptor> *)v)
16 
17 using namespace yarp::dev;
18 
20 {
21  descriptors=new std::vector<PolyDriverDescriptor>;
22 }
23 
25 {
26  delete RES(descriptors);
27 }
28 
30 {
31  return &(*RES(descriptors))[k];
32 }
33 
35 {
36  return &(*RES(descriptors))[k];
37 }
38 
40 {
41  return (int)RES(descriptors)->size();
42 }
43 
44 void PolyDriverList::push(PolyDriver *p, const char *k)
45 {
46  RES(descriptors)->push_back(PolyDriverDescriptor(p, k));
47 }
48 
50 {
51  RES(descriptors)->push_back(v);
52 }
53 
55 {
56  *RES(descriptors)=*RES(l.descriptors);
57  return *this;
58 }
yarp::dev::PolyDriverDescriptor
Definition: PolyDriverDescriptor.h:24
yarp::dev::PolyDriverList::PolyDriverList
PolyDriverList()
Definition: PolyDriverList.cpp:19
yarp::dev::PolyDriverList::operator=
const PolyDriverList & operator=(const PolyDriverList &)
Definition: PolyDriverList.cpp:54
yarp::dev::PolyDriverList::size
int size() const
Definition: PolyDriverList.cpp:39
yarp::dev::PolyDriverList
Definition: PolyDriverList.h:22
yarp::dev
An interface for the device drivers.
Definition: audioBufferSizeData.cpp:17
PolyDriverList.h
yarp::dev::PolyDriverList::push
void push(PolyDriver *p, const char *k)
Definition: PolyDriverList.cpp:44
yarp::dev::PolyDriverList::operator[]
yarp::dev::PolyDriverDescriptor * operator[](int k)
Definition: PolyDriverList.cpp:29
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
RES
#define RES(v)
Definition: PolyDriverList.cpp:15
yarp::dev::PolyDriverList::~PolyDriverList
~PolyDriverList()
Definition: PolyDriverList.cpp:24