]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/collection.cpp
Redesign automatic object loading
[libs/datafile.git] / source / collection.cpp
index 5ac12ab7d366c3406cfc59206b42b166875557d5..bf1c5edc211e93b33f1dacc833e0ac1a38657a5e 100644 (file)
@@ -11,26 +11,9 @@ Collection::~Collection()
                delete *i;
 }
 
-void Collection::add_future(const string &name)
+void Collection::add_source(CollectionSource &s)
 {
-       for(TypeList::const_iterator i=types.begin(); i!=types.end(); ++i)
-               if((*i)->match_name(name))
-               {
-                       insert_unique(items, name, (*i)->create_future());
-                       return;
-               }
-}
-
-void Collection::add_future_with_keyword(const string &name, const string &keyword)
-{
-       for(TypeList::const_iterator i=types.begin(); i!=types.end(); ++i)
-               if((*i)->get_keyword()==keyword)
-               {
-                       insert_unique(items, name, (*i)->create_future());
-                       return;
-               }
-
-       throw runtime_error("Collection::add_future_with_keyword");
+       sources.push_back(&s);
 }