]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/collection.cpp
Minor reorganization
[libs/datafile.git] / source / collection.cpp
index ea1095b39a93f61e0a14930b8e8edf039da9089e..d52ee22399ba7500c880798f2fcf3036d9cd095c 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2006  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "collection.h"
 
 namespace Msp {
@@ -12,26 +5,27 @@ namespace DataFile {
 
 Collection::~Collection()
 {
-       for(ItemMap::iterator i=items.begin(); i!=items.end(); ++i)
-               delete i->second;
-       for(ItemKeywordSeq::iterator i=keywords.begin(); i!=keywords.end(); ++i)
-               delete *i;
-       for(ItemCreatorSeq::iterator i=creators.begin(); i!=creators.end(); ++i)
+       for(TypeList::iterator i = types.begin(); i!=types.end(); ++i)
                delete *i;
 }
 
-bool Collection::contains(const std::string &n) const
-{
-       return items.count(n);
-}
-
 
 Collection::Loader::Loader(Collection &c):
        coll(c)
 {      
-       for(ItemKeywordSeq::const_iterator i=coll.keywords.begin(); i!=coll.keywords.end(); ++i)
+       for(TypeList::const_iterator i = coll.types.begin(); i!=coll.types.end(); ++i)
                (*i)->add_to_loader(*this);
 }
 
+
+CollectionItemTypeBase::CollectionItemTypeBase():
+       tag(0)
+{ }
+
+CollectionItemTypeBase::~CollectionItemTypeBase()
+{
+       delete tag;
+}
+
 } // namespace DataFile
 } // namespace Msp