]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/objectloader.h
Exception rework for loader components
[libs/datafile.git] / source / objectloader.h
index 515ea6b8b81c6d51338735a704f960a0f27b802a..f1cb6ffe051c5f8405fa652a67d36b3001dee380 100644 (file)
@@ -1,18 +1,18 @@
-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_DATAFILE_OBJECTLOADER_H_
 #define MSP_DATAFILE_OBJECTLOADER_H_
 
+#include <typeinfo>
 #include "loader.h"
 
 namespace Msp {
 namespace DataFile {
 
+class no_collection: public std::runtime_error
+{
+public:
+       no_collection(const std::type_info &);
+};
+
 class Collection;
 
 /**
@@ -54,7 +54,7 @@ public:
        C &get_collection() const
        {
                if(!coll)
-                       throw InvalidState("No collection");
+                       throw no_collection(typeid(O));
                return *coll;
        }
 };