{ Collection::Loader::Add<T, S>::add(loader, kwd); }
};
- CreatorBase *creator;
+ CreatorBase *creat;
StoreBase *store;
public:
CollectionItemType():
- creator(0), store(new Store<T>)
+ creat(0), store(new Store<T>)
{ tag = new Tag<T>; }
~CollectionItemType()
{
- delete creator;
+ delete creat;
delete store;
}
}
template<typename C>
- CollectionItemType &create(T *(C::*func)(const std::string &))
+ CollectionItemType &creator(T *(C::*func)(const std::string &))
{
- delete creator;
- creator = new Creator<C>(func);
+ delete creat;
+ creat = new Creator<C>(func);
return *this;
}
{ store->add_to_loader(loader, kwd); }
virtual bool can_create() const
- { return creator!=0; }
+ { return creat!=0; }
virtual void create_item(Collection &coll, const std::string &name) const
{
- if(!creator)
+ if(!creat)
throw std::runtime_error("no creator");
- T *obj = creator->create(coll, name);
+ T *obj = creat->create(coll, name);
store->store(coll, name, obj);
}
};
TestCollection::TestCollection()
{
- add_type<Foo>().keyword("foo").create(&TestCollection::create_foo);
+ add_type<Foo>().keyword("foo").creator(&TestCollection::create_foo);
add_type<Bar>().keyword("bar");
add_type<Sub>().keyword("sub").store_as<Bar>();
}