X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcollection.h;h=021b714a934e05dbb190dd4b2b473f1607b160e6;hb=4931b4867258d1d2c20bad7ec24dfe4b99646aa1;hp=82339d8859902f725308b347f9f3de3fd39ff244;hpb=9f2a99f61887a71a31afb4c56558fcc76be532d1;p=libs%2Fdatafile.git diff --git a/source/collection.h b/source/collection.h index 82339d8..021b714 100644 --- a/source/collection.h +++ b/source/collection.h @@ -46,7 +46,7 @@ public: template friend class CollectionItemType; private: - template::value > + template::value> struct Add; Collection &coll; @@ -292,17 +292,17 @@ private: { Collection::Loader::Add::add(loader, kwd); } }; - CreatorBase *creator; + CreatorBase *creat; StoreBase *store; public: CollectionItemType(): - creator(0), store(new Store) + creat(0), store(new Store) { tag = new Tag; } ~CollectionItemType() { - delete creator; + delete creat; delete store; } @@ -313,10 +313,10 @@ public: } template - CollectionItemType &create(T *(C::*func)(const std::string &)) + CollectionItemType &creator(T *(C::*func)(const std::string &)) { - delete creator; - creator = new Creator(func); + delete creat; + creat = new Creator(func); return *this; } @@ -334,13 +334,13 @@ public: { 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); } };