- std::list<T *> result;
- for(ItemMap::const_iterator i=items.begin(); i!=items.end(); ++i)
- if(i->second.check_type<RPNCT>())
- result.push_back(i->second.value<RPNCT>().get());
- return result;
+ /** Returns a list of objects of one type, loading them from sources if
+ necessary. */
+ template<typename T>
+ std::list<T *> get_list()
+ {
+ CollectionItemTypeBase *type = get_type<typename RemoveConst<T>::Type>();
+ if(type)
+ load_items_from_sources(*type);
+
+ std::list<const Variant *> vars;
+ gather_items<typename RemoveConst<T>::Type>(&vars, 0, type, true);
+ return extract_list<T>(vars);
+ }
+
+private:
+ unsigned get_status(const std::string &, const CollectionItemTypeBase &) const;
+
+ template<typename T>
+ unsigned get_status(const std::string &name) const
+ {
+ // XXX Should go through all applicable types
+ if(CollectionItemTypeBase *type = get_type<T>())
+ return get_status(name, *type);
+
+ ItemMap::const_iterator i = items.find(name);
+ return (i!=items.end() && i->second.check_type<RefPtr<T> >());