]> git.tdb.fi Git - libs/datafile.git/blob - source/collection.cpp
Redesign the Collection class
[libs/datafile.git] / source / collection.cpp
1 #include "collection.h"
2
3 namespace Msp {
4 namespace DataFile {
5
6 Collection::~Collection()
7 {
8         for(TypeList::iterator i = types.begin(); i!=types.end(); ++i)
9                 delete *i;
10 }
11
12 bool Collection::contains(const std::string &n) const
13 {
14         return items.count(n);
15 }
16
17
18 Collection::Loader::Loader(Collection &c):
19         coll(c)
20 {       
21         for(TypeList::const_iterator i = coll.types.begin(); i!=coll.types.end(); ++i)
22                 (*i)->add_to_loader(*this);
23 }
24
25 } // namespace DataFile
26 } // namespace Msp