Doxybook2 Example
Asset.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <queue>
3 #include <string>
4 
5 namespace Engine {
6  namespace Assets {
10  class Asset {
11  public:
15  union Event {
16  struct Loaded {
17  bool success;
18  int usage;
19  } loaded;
20  struct Unloaded {
21  bool success;
22  } unloaded;
23  struct Waiting {
29  } waiting;
30  };
31 
32  explicit Asset(const std::string& name);
33  virtual ~Asset() = 0;
34 
38  virtual void load();
42  virtual void unload();
48  const Event& getEvent() const {
49  return event;
50  }
51  private:
52  Event event;
53  };
54  }
55 }
Engine::Assets::Asset::Event::Unloaded::success
bool success
Definition: Asset.hpp:21
Engine::Assets::Asset::Event::waiting
struct Engine::Assets::Asset::Event::Waiting waiting
Engine::Assets::Asset::Event
Definition: Asset.hpp:15
Engine::Assets::Asset::Event::loaded
struct Engine::Assets::Asset::Event::Loaded loaded
Engine::Assets::Asset::Event::Waiting::other
Asset * other
The pointer to the other asset this asset is waiting for.
Definition: Asset.hpp:28
Engine::Assets::Asset::Event::Loaded::usage
int usage
Definition: Asset.hpp:18
Engine::Assets::Asset::~Asset
virtual ~Asset()=0
Engine::Assets::Asset::Event::unloaded
struct Engine::Assets::Asset::Event::Unloaded unloaded
Engine::Assets::Asset
Definition: Asset.hpp:10
Engine::Assets::Asset::Event::Loaded
Definition: Asset.hpp:16
Engine::Assets::Asset::unload
virtual void unload()
Call this method to unload the asset.
Engine::Assets::Asset::Event::Loaded::success
bool success
Definition: Asset.hpp:17
Engine
This namespace contains all of the necessary engine components.
Definition: Asset.hpp:5
Engine::Assets::Asset::Event::Unloaded
Definition: Asset.hpp:20
Engine::Assets::Asset::getEvent
const Event & getEvent() const
Returns the current status of the asset.
Definition: Asset.hpp:48
Engine::Assets::Asset::Event::Waiting
Definition: Asset.hpp:23
Engine::Assets::Asset::load
virtual void load()
Call this method to load the asset.
Engine::Assets::Asset::Asset
Asset(const std::string &name)