]> git.tdb.fi Git - libs/datafile.git/commitdiff
Rename CollectionItemType::create method to creator
authorMikko Rasa <tdb@tdb.fi>
Tue, 26 Jul 2011 10:09:07 +0000 (13:09 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 26 Jul 2011 10:09:07 +0000 (13:09 +0300)
source/collection.h
tests/collection.cpp

index 82339d8859902f725308b347f9f3de3fd39ff244..8b4eba01b0fb5b83f4a1fdc936d6d327ba4bc971 100644 (file)
@@ -292,17 +292,17 @@ private:
                { 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;
        }
 
@@ -313,10 +313,10 @@ public:
        }
 
        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;
        }
 
@@ -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);
        }
 };
index 69aaf428c21a2c11d3fa4fce971eefacd95d7331..bb72c03fbba536f3cce42cf6cfdea6e52c9f45ba 100644 (file)
@@ -140,7 +140,7 @@ Base::Loader::Loader(Base &b):
 
 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>();
 }