+ void gather_items(std::vector<const Variant *> *, std::list<std::string> *, const CollectionItemTypeBase &, bool) const;
+
+ template<typename T>
+ void gather_items(std::vector<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);
+ }
+
+public:
+ /// Returns a list of the names of objects of one type in the collection.
+ template<typename T>
+ std::list<std::string> get_names() const
+ {
+ std::list<std::string> names;
+ gather_items<typename std::remove_cv<T>::type>(0, &names, 0, false);
+ return names;
+ }
+
+ /** Returns a list of the names of objects of one type in the collection or
+ available from sources. */
+ template<typename T>
+ std::list<std::string> get_names()
+ {
+ std::list<std::string> names;
+ gather_items<typename std::remove_cv<T>::type>(0, &names, 0, true);
+ return names;
+ }
+
+ /// Returns a list of objects of one type in the collection.