- typedef RefPtr<typename RemoveConst<T>::Type> RPNCT;
-
- for(ItemMap::const_iterator i=items.begin(); i!=items.end(); ++i)
- if(i->second.check_type<RPNCT>())
- {
- if(objects)
- objects->push_back(i->second.value<RPNCT>().get());
- if(names)
- names->push_back(i->first);
- }
-
- if(future_names)
- if(CollectionItemTypeBase *type = get_type<T>())
- {
- for(SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i)
- {
- std::list<std::string> available_names = (*i)->get_names(*type);
- for(std::list<std::string>::iterator j=available_names.begin(); j!=available_names.end(); ++j)
- if(!items.count(*j))
- future_names->push_back(*j);
- }
- }
+ if(type || (type = get_type<T>()))
+ gather_items(vars, names, *type, include_sources);
+ else
+ gather_items(vars, names, CollectionItemType<T>(), false);