Cogs.Core
ResourceStoreStorage.h
1#pragma once
2#include <set>
3#include <string>
4#include <memory>
5#include <vector>
6#include <unordered_set>
7#include <unordered_map>
8
9#include "Foundation/Platform/Threads.h"
10
11namespace Cogs::Core {
12
13 struct Resource
14 {
15 std::string name;
16 std::string path;
17 ResourceBuffer bytes;
18 };
19
21 {
22 Mutex lock;
23 std::unordered_map<std::string, Resource> resources;
24 std::unordered_set<std::string> loading;
25 };
26
28 {
29 ResourceStoreStorage(Context* context, ResourceStore* resourceStore);
30
31 Context* context = nullptr;
32 std::unique_ptr<ResourceCache> cache;
33 std::vector<ResourceArchive> archives;
34 std::string dataDir;
35 std::set<std::string> searchPaths;
36 std::vector<std::string> orderedSearchPaths;
37 std::unique_ptr<struct IOHandler> ioHandler;
38 };
39
40
41}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Provides handling of reading and caching of external resources.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....