+ template<typename T>
+ T *find(const std::string &name)
+ {
+ typedef typename std::remove_cv<T>::type NCT;
+ const Variant *var = find_var(name, get_type<NCT>(name));
+ return (var ? &extract<NCT>(*var) : 0);
+ }
+
+private:
+ void add_var(const std::string &, const CollectionItemTypeBase *, const Variant &);
+ const Variant &get_var(const std::string &, const CollectionItemTypeBase *);
+ const Variant *find_var(const std::string &, const CollectionItemTypeBase *);
+
+ template<typename T>
+ T &extract(const Variant &var) const;
+
+ template<typename T>
+ std::list<T *> extract_list(const std::vector<const Variant *> &vars) const
+ {
+ std::list<T *> result;
+ for(const Variant *v: vars)
+ result.push_back(&extract<T>(*v));
+ return result;
+ }
+
+ 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: