Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
ResourceManager.h
Go to the documentation of this file.
1#ifndef ULT_RESOURCE_MANAGER_H_INCLUDED
2#define ULT_RESOURCE_MANAGER_H_INCLUDED
3
4#include "HashTable.h"
5#include "ResourceName.h"
6#include "Texture/GLTexture.h"
7#include "Texture/Texture.h"
8
9namespace Ult
10{
11
15template<typename A, typename HANDLE>
17{
18public:
22 ResourceManager(int hashSize = 0);
26 virtual ~ResourceManager();
27
38 bool Create(A* res, const char* name, HANDLE* handle);
42 void Release(HANDLE& handle);
43
48 int GetRegisteredIndex(const char* name);
49
53 A* GetResource(const HANDLE& handle);
57 int GetSize();
61 std::vector<A*>* GetObjects();
62
63private:
64 std::vector<A*> mObjects;
65 HashTable<ResourceName>* mResourceHash;
66
67 void SetRegisteredName(const char* name, int index);
68 void DeleteAllMemory();
69};
70
71} // namespace Ult
72
73#include "ResourceManager.inl"
74
75#endif // ULT_RESOURCE_MANAGER_H_INCLUDED
76
Definition HashTable.h:62
A * GetResource(const HANDLE &handle)
Definition ResourceManager.inl:76
int GetSize()
Definition ResourceManager.inl:86
int GetRegisteredIndex(const char *name)
Definition ResourceManager.inl:56
std::vector< A * > * GetObjects()
Definition ResourceManager.inl:92
virtual ~ResourceManager()
Definition ResourceManager.inl:15
void Release(HANDLE &handle)
Definition ResourceManager.inl:46
bool Create(A *res, const char *name, HANDLE *handle)
Definition ResourceManager.inl:21
ResourceManager(int hashSize=0)
Definition ResourceManager.inl:5
Definition Archive.h:13