X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fcollection.h;h=5fcaab34f35345406de07e372a70cb972efc2a67;hp=24be69dd2f70cd07d425453b3121788b2ff60086;hb=0812e7601e9ef6081d01b243ba0365aed652d773;hpb=6678cf025ca97dd398a9304b0578f146d1f7af80 diff --git a/source/collection.h b/source/collection.h index 24be69d..5fcaab3 100644 --- a/source/collection.h +++ b/source/collection.h @@ -110,7 +110,7 @@ private: ItemCreatorBridge *creator=dynamic_cast *>(this); if(creator) { - creator->create(coll, name, ptr); + ptr=creator->create(coll, name); return true; } return false; @@ -120,7 +120,7 @@ private: template struct ItemCreatorBridge: public ItemCreatorBase { - virtual bool create(Collection &, const std::string &, S *&) const =0; + virtual S *create(Collection &, const std::string &) const =0; }; template @@ -213,7 +213,7 @@ public: if(!item) throw TypeError("Item '"+name+"' is not of correct type"); - return *item->data; + return item->data; } /** @@ -236,7 +236,7 @@ public: { // We already know that the item didn't exist yet items[name]=new Item(d); - return *d; + return d; } } throw KeyError("Item '"+name+"' not found in collection"); @@ -246,7 +246,7 @@ public: if(!item) throw TypeError("Item '"+name+"' is not of correct type"); - return *item->data; + return item->data; } /**