Choreonoid
1.8
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
p
q
r
s
t
v
w
z
Enumerations
Enumerator
a
b
c
d
f
g
i
k
l
m
n
p
s
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
i
l
n
p
r
s
t
u
v
Enumerations
a
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Properties
Related Functions
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
v
w
y
Files
File List
File Members
All
Functions
Variables
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Body
DeviceList.h
Go to the documentation of this file.
1
6
#ifndef CNOID_BODY_DEVICE_LIST_H
7
#define CNOID_BODY_DEVICE_LIST_H
8
9
#include "
Device.h
"
10
#include <cnoid/PolymorphicReferencedArray>
11
#include "exportdecl.h"
12
13
namespace
cnoid
{
14
15
template
<
class
DeviceType = Device,
class
Po
int
erType = ref_ptr<DeviceType> >
16
class
DeviceList
:
public
PolymorphicReferencedArray
<DeviceType, Device, PointerType>
17
{
18
typedef
PolymorphicReferencedArray<DeviceType, Device, PointerType>
ArrayBase
;
19
20
public
:
21
DeviceList
() { }
22
23
template
<
class
RhsDeviceType>
24
DeviceList
(
const
DeviceList<RhsDeviceType>
& rhs)
25
:
ArrayBase
(rhs) { }
26
27
DeviceList
getSortedById
()
const
{
28
DeviceList
sorted;
29
for
(
size_t
i=0; i <
ArrayBase::size
(); ++i){
30
DeviceType* device = (*this)[i];
31
const
int
id
= device->id();
32
if
(
id
>= 0){
33
if
(
static_cast<
int
>
(sorted.
size
()) <= id){
34
sorted.
resize
(
id
+ 1);
35
}
36
sorted[id] = device;
37
}
38
}
39
return
sorted;
40
}
41
};
42
43
}
44
45
#endif
Device.h
cnoid::DeviceList::getSortedById
DeviceList getSortedById() const
Definition:
DeviceList.h:27
cnoid
Definition:
AbstractSceneLoader.h:11
cnoid::PolymorphicReferencedArrayBase< Device >
cnoid::DeviceList::DeviceList
DeviceList(const DeviceList< RhsDeviceType > &rhs)
Definition:
DeviceList.h:24
cnoid::DeviceList::DeviceList
DeviceList()
Definition:
DeviceList.h:21
cnoid::PolymorphicReferencedArray::resize
void resize(size_t size)
Definition:
PolymorphicReferencedArray.h:123
cnoid::DeviceList
Definition:
DeviceList.h:16
cnoid::PolymorphicReferencedArray::size
std::size_t size() const
Definition:
PolymorphicReferencedArray.h:127
cnoid::PolymorphicReferencedArray
Definition:
PolymorphicReferencedArray.h:27
Generated by
1.8.17