1 #ifndef MSP_DATAFILE_OBJECTLOADER_H_
2 #define MSP_DATAFILE_OBJECTLOADER_H_
12 Provides the basic functionality of an object loader. Deriving from this
13 allows loading values directly into member variables of the objects.
16 class ObjectLoader: public Loader
24 ObjectLoader(O &o): obj(o) { }
27 O &get_object() const { return obj; }
32 Provides functionality for loading objects with a Collection. Deriving from
33 this allows loading pointers to objects in the collection automatically.
35 template<typename O, typename C = Collection>
36 class CollectionObjectLoader: public ObjectLoader<O>
44 CollectionObjectLoader(O &o, C *c): ObjectLoader<O>(o), coll(c) { }
47 C &get_collection() const
50 throw InvalidState("No collection");
55 } // namespace DataFile