]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resources/resource.h
Add correct copy and move semantics to most classes
[libs/gl.git] / source / resources / resource.h
index 1fdbb3ef3fd906142a92a13b2e1e3ed3add4225f..2a312e960acd8b1595dc5a93fe03a5b8ed54cff7 100644 (file)
@@ -2,6 +2,7 @@
 #define MSP_GL_RESOURCE_H_
 
 #include <cstdint>
+#include <msp/core/noncopyable.h>
 #include <msp/io/seekable.h>
 
 namespace Msp {
@@ -10,7 +11,7 @@ namespace GL {
 class ResourceManager;
 class Resources;
 
-class Resource
+class Resource: public NonCopyable
 {
 public:
        class AsyncLoader
@@ -29,6 +30,7 @@ protected:
        void *manager_data = 0;
 
        Resource() = default;
+       Resource(Resource &&);
 public:
        virtual ~Resource();
 
@@ -41,7 +43,7 @@ public:
 
        /** Returns the amount of graphics memory used by this resource.  The
        returned value must not change while the resource is loaded. */
-       virtual std::uint64_t get_data_size() const = 0;
+       virtual std::size_t get_data_size() const = 0;
 
        virtual void unload() = 0;
 };