]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/collection.h
Style fixes
[libs/datafile.git] / source / collection.h
index 021b714a934e05dbb190dd4b2b473f1607b160e6..b2239905edb4d824cd14e1d763ff62d234672032 100644 (file)
@@ -58,7 +58,7 @@ public:
                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();
@@ -67,13 +67,11 @@ public:
                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:
@@ -341,7 +339,8 @@ public:
                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);
        }
 };