]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/dynamicobjectloader.h
Use the override specifier to mark overridden virtual functions
[libs/datafile.git] / source / dynamicobjectloader.h
index 551a0a63dd1f454cbc691cbe53ebf96b620f23f1..687dacaf5363cf74b179a486c017731ae4976451 100644 (file)
@@ -30,11 +30,11 @@ protected:
 
        typedef Msp::TypeRegistry<CreateObject, DynamicObjectLoader &> TypeRegistry;
 
-       Collection *coll;
-       T *object;
+       Collection *coll = nullptr;
+       T *object = nullptr;
 private:
-       Loader *obj_loader;
-       std::function<void(Collection &, const std::string &, T *)> store_func;
+       Loader *obj_loader = nullptr;
+       void (*store_func)(Collection &, const std::string &, T *) = nullptr;
 
        static ActionMap shared_actions;
 
@@ -44,7 +44,7 @@ public:
        ~DynamicObjectLoader() { delete object; delete obj_loader; }
 
 private:
-       virtual void init_actions();
+       void init_actions() override;
 
 public:
        T *get_object() { T *o = object; object = 0; return o; }
@@ -70,9 +70,7 @@ Loader::ActionMap DynamicObjectLoader<T, C>::shared_actions;
 
 template<typename T, typename C>
 DynamicObjectLoader<T, C>::DynamicObjectLoader(Collection *c):
-       coll(c),
-       object(0),
-       obj_loader(0)
+       coll(c)
 {
        set_actions(shared_actions);
 }