template<typename T> friend class CollectionItemType;
private:
- template<typename T, typename S, bool = NeedsCollection<T>::value >
+ template<typename T, typename S, bool = NeedsCollection<typename T::Loader>::value>
struct Add;
Collection &coll;
template<typename T, typename S, typename C>
void coll_item(const std::string &n)
{
- RefPtr<T> it=new T;
+ RefPtr<T> it = new T;
load_sub(*it, dynamic_cast<C &>(coll));
coll.add<S>(n, it.get());
it.release();
template<typename T, typename S>
void item(const std::string &n)
{
- RefPtr<T> it=new T;
+ RefPtr<T> it = new T;
load_sub(*it);
coll.add<S>(n, it.get());
it.release();
}
-
- template<typename, typename, bool> friend class ItemKeyword;
};
private:
if(!creat)
throw std::runtime_error("no creator");
T *obj = creat->create(coll, name);
- store->store(coll, name, obj);
+ if(obj)
+ store->store(coll, name, obj);
}
};