]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resources/resourcemanager.h
Use standard fixed-size integer types
[libs/gl.git] / source / resources / resourcemanager.h
index 38437a727fd9a7d94cc24b048123bb62f0a0e35d..2b9aef58f6414af9073988898e08e04483861e6a 100644 (file)
@@ -2,7 +2,7 @@
 #define MSP_GL_RESOURCEMANAGER_H_
 
 #include <deque>
-#include <msp/core/inttypes.h>
+#include <cstdint>
 #include <msp/core/mutex.h>
 #include <msp/core/semaphore.h>
 #include <msp/core/thread.h>
@@ -62,7 +62,7 @@ private:
                Resource::AsyncLoader *loader;
                State state;
                unsigned last_used;
-               UInt64 data_size;
+               std::uint64_t data_size;
                std::vector<ResourceObserver *> observers;
 
                ManagedResource(Resource &);
@@ -88,7 +88,7 @@ private:
                unsigned size;
                std::list<resource_load_error> error_queue;
                Mutex data_size_mutex;
-               UInt64 loaded_data_size;
+               std::uint64_t loaded_data_size;
                volatile bool done;
 
        public:
@@ -107,7 +107,7 @@ private:
        public:
                bool sync();
                bool needs_work() const { return size<capacity; }
-               UInt64 get_and_reset_loaded_data_size();
+               std::uint64_t get_and_reset_loaded_data_size();
 
                void terminate();
        };
@@ -117,8 +117,8 @@ private:
        mutable Mutex map_mutex;
        std::map<const Resource *, ManagedResource> resources;
        std::deque<ManagedResource *> queue;
-       UInt64 total_data_size;
-       UInt64 size_limit;
+       std::uint64_t total_data_size;
+       std::uint64_t size_limit;
        unsigned frame;
        unsigned min_retain_frames;
        unsigned max_retain_frames;
@@ -131,7 +131,7 @@ public:
 
        void set_loading_policy(LoadingPolicy);
        void set_async_loads(bool);
-       void set_size_limit(UInt64);
+       void set_size_limit(std::uint64_t);
        void set_min_retain_frames(unsigned);
        void set_max_retain_frames(unsigned);
 
@@ -158,7 +158,7 @@ private:
        void unload_by_age();
        void unload_by_size();
 public:
-       UInt64 get_total_data_size() const { return total_data_size; }
+       std::uint64_t get_total_data_size() const { return total_data_size; }
 
 private:
        static bool age_order(ManagedResource *, ManagedResource *);