A Simple Fast Resource Manager using C++ and STL
StructureThe Resource ClassTo enable consistent handling and initialization across various types of resources, we have used a common base class for all resources. For fast access, we have chosen to use unsigned integer handles for each resource. The resource class also has a reference count and members to hold the file name and path. The following figure shows the members of the class:
The ResourceManager ClassThe ResourceManager class manages different types of resources. We use a different ResourceManager instance for every type of resource, and thus the ResourceManager is a template class. The members are shown in the following diagram:
The ResourceManager class has four member variables. |
|