Go to the documentation of this file.
5 #ifndef CNOID_BASE_ITEM_LIST_H
6 #define CNOID_BASE_ITEM_LIST_H
9 #include <cnoid/PolymorphicPointerArray>
10 #include "exportdecl.h"
19 virtual bool push_back_if_type_matches(
Item* item) = 0;
20 bool extractSubTreeItemsSub(
Item* item);
21 bool extractParentItemsSub(
Item* item);
22 bool extractAssociatedItemsSub(
Item* item);
23 bool extractSubItemsSub(
Item* item);
27 template<
class ItemType>
35 template <
class RhsObjectType>
39 template <
class SubType>
44 ItemType*
toSingle(
bool allowFromMultiElements =
false)
const {
70 ItemType*
find(
const std::string& name){
72 if((*
this)[i]->name() == name){
80 virtual bool push_back_if_type_matches(
Item* item)
override {
81 if(ItemType* casted =
dynamic_cast<ItemType*
>(item)){
Definition: ItemList.h:16
std::size_t size() const
Definition: PolymorphicPointerArray.h:73
void push_back(const PointerType &pointer)
Definition: PolymorphicPointerArray.h:121
void clear()
Definition: PolymorphicPointerArray.h:117
PointerType & operator[](std::size_t i)
Definition: PolymorphicPointerArray.h:109
bool extractChildItems(const Item *item)
Definition: ItemList.h:56
bool extractSubTreeItems(const Item *root)
Definition: ItemList.h:50
Definition: PolymorphicPointerArray.h:21
bool empty() const
Definition: PolymorphicPointerArray.h:61
ItemList(const ItemList< RhsObjectType > &rhs)
Definition: ItemList.h:36
Definition: AbstractSceneLoader.h:11
bool extractSubItems(const Item *item)
Definition: ItemList.h:65
ItemType * find(const std::string &name)
Definition: ItemList.h:70
SubType * get(int index) const
Definition: ItemList.h:40
ItemType * get(int index) const
Definition: ItemList.h:42
bool extractAssociatedItemsSub(Item *item)
Definition: ItemList.cpp:56
PointerType & front()
Definition: PolymorphicPointerArray.h:101
bool extractAssociatedItems(const Item *item)
Definition: ItemList.h:60
bool extractSubTreeItemsSub(Item *item)
Definition: ItemList.cpp:28
ItemList()
Definition: ItemList.h:33
bool extractSubItemsSub(Item *item)
Definition: ItemList.cpp:66
ItemType * toSingle(bool allowFromMultiElements=false) const
Definition: ItemList.h:44