Subclasses can now override te type handler and access the object without
clearing it, for example to perform some custom initialization after the
object has been created.
typedef Msp::TypeRegistry<CreateObject, DynamicObjectLoader &> TypeRegistry;
Collection *coll;
-private:
T *object;
+private:
Loader *obj_loader;
std::function<void(Collection &, const std::string &, T *)> store_func;
T *get_object() { T *o = object; object = 0; return o; }
T *store_object(Collection &, const std::string &);
-private:
- void type(const Symbol &);
+protected:
+ virtual void type(const Symbol &);
+private:
template<typename U>
typename std::enable_if<NeedsCollection<typename U::Loader>::value, typename U::Loader *>::type create_object_loader(U &obj) const;