DelayedLoadSystem.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "DelayedLoad.hpp"
5 #include <unordered_map>
6 
7 namespace iv
8 {
9 
10 class DelayedLoader;
11 
13 {
14 public:
16 
21 };
22 
25 class DelayedLoadSystem : public System
26 {
27 public:
29  virtual std::string debug_name() const override { return "DelayedLoadSystem"; }
30 
31  bool loadStep();
32 
33  //--------------------- DelayedLoadSystem --------------------
37  void QueueDelayedLoad( DelayedLoad * load, int complexity_bytes );
38  void ClearDelayedLoad( DelayedLoad * load );
39 
45  void BlockLoading( DelayedLoader *, bool block );
46  bool LoadingRunning();
47 
51  DelayedLoadStatus const & Status();
52 
53 private:
54  void Notify_LoadStart();
55  void Notify_LoadFinish();
56  void Notify_ItemQueued( DelayedLoad const * item, int complexity_bytes );
57  void Notify_ItemLoaded( DelayedLoad const * item, int complexity_bytes );
58 
59 private:
60  std::unordered_map< DelayedLoad *, int > _to_load;
61 
64 
65  bool _loading;
66  DelayedLoadStatus status;
67 };
68 
69 }