+ template<typename T>
+ void collect_items(std::list<T *> *objects, std::list<std::string> *names, std::list<std::string> *future_names) const
+ {
+ 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);
+ }
+ }
+ }
+
+public:
+ /// Returns a list of the names of objects of one type in the collection.