]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resourcemanager.h
Pass errors from the resource loading thread to the main thread
[libs/gl.git] / source / resourcemanager.h
index a1ff7aee2fc32adda60d12b0a63166c635e81822..a2a4975db5185eaf3eadf7348e995f9a0b4ca5b7 100644 (file)
@@ -13,6 +13,14 @@ namespace GL {
 
 class ResourceWatcher;
 
+class resource_load_error: public std::runtime_error
+{
+public:
+       resource_load_error(const std::string &, const std::exception &);
+       virtual ~resource_load_error() throw() { }
+};
+
+
 class ResourceManager
 {
 public:
@@ -32,7 +40,8 @@ private:
                        LOAD_QUEUED,
                        LOADING,
                        LOAD_FINISHED,
-                       LOADED
+                       LOADED,
+                       LOAD_ERROR
                };
 
                Resource *resource;
@@ -68,6 +77,7 @@ private:
                LoadQueue sync_queue;
                unsigned capacity;
                unsigned size;
+               std::list<resource_load_error> error_queue;
                volatile bool done;
 
        public: