- for(ItemMap::const_iterator i=items.begin(); i!=items.end(); ++i)
- if(i->second.check_type<RPNCT>())
- {
- T *ptr = i->second.value<RPNCT>().get();
- if(ptr)
- {
- if(objects)
- objects->push_back(ptr);
- if(names)
- names->push_back(i->first);
- }
- else if(future_names)
- future_names->push_back(i->first);
- }
+ void gather_items(std::list<const Variant *> *, std::list<std::string> *, const CollectionItemTypeBase &, bool) const;
+
+ template<typename T>
+ void gather_items(std::list<const Variant *> *vars, std::list<std::string> *names, const CollectionItemTypeBase *type, bool include_sources) const
+ {
+ if(type || (type = get_type<T>()))
+ gather_items(vars, names, *type, include_sources);
+ else
+ gather_items(vars, names, CollectionItemType<T>(), false);