5 #ifndef CNOID_BASE_ITEM_LIST_H 6 #define CNOID_BASE_ITEM_LIST_H 9 #include <cnoid/PolymorphicPointerArray> 13 template<
class ItemType = Item>
21 template <
class RhsObjectType>
25 template <
class SubType>
36 ItemType*
toSingle(
bool allowFromMultiElements =
false)
const {
44 if(child->isSubItem()){
45 ItemType* targetItem =
dynamic_cast<ItemType*
>(child);
54 ItemType*
find(
const std::string& name){
56 if((*
this)[i]->name() == name){
64 void extractChildItemsSub(
Item* item){
66 ItemType* targetItem =
dynamic_cast<ItemType*
>(item);
71 extractChildItemsSub(item->
nextItem());
ItemType * toSingle(bool allowFromMultiElements=false) const
Definition: ItemList.h:36
Item * nextItem() const
Definition: Item.h:76
Definition: ItemList.h:14
ref_ptr< ItemType > & operator[](std::size_t i)
Definition: PolymorphicPointerArray.h:109
ref_ptr< ItemType > & front()
Definition: PolymorphicPointerArray.h:101
ItemList(const ItemList< RhsObjectType > &rhs)
Definition: ItemList.h:22
bool extractSubItems(ItemPtr item)
Definition: ItemList.h:41
bool extractChildItems(ItemPtr item)
Definition: ItemList.h:30
Definition: PolymorphicPointerArray.h:21
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
ItemType * find(const std::string &name)
Definition: ItemList.h:54
Item * childItem() const
Definition: Item.h:74
bool empty() const
Definition: PolymorphicPointerArray.h:61
std::size_t size() const
Definition: PolymorphicPointerArray.h:73
T * get() const
Definition: Referenced.h:197
void clear()
Definition: PolymorphicPointerArray.h:117
void push_back(const ref_ptr< ItemType > &pointer)
Definition: PolymorphicPointerArray.h:121
ItemList()
Definition: ItemList.h:19