|
wavelength 1.0.0
|
Read of one resource file into memory, shared by every reference to the file. More...
#include <rndmanager.h>
Public Member Functions | |
| ResourceLoader (std::unique_ptr< File > pFile, const char *pszTag) | |
| Start reading a file. | |
| ~ResourceLoader () | |
| Release the buffer and the file. | |
| bool | Poll () |
| Finish the read when the file reports it complete. | |
| int | GetData (void **ppData, int *pnSize) |
| Wait for the data and hand it out, dropping one reference. | |
| void | AddRef () |
| Take one more reference, for one more GetData(). | |
Read of one resource file into memory, shared by every reference to the file.
The RTTI includes the nested class name. A compressed file is read to the end of the buffer and inflated forward over it once the read completes.
| RndManager::ResourceLoader::ResourceLoader | ( | std::unique_ptr< File > | pFile, |
| const char * | pszTag ) |
Start reading a file.
The loader has one reference.
| pFile | The open file. The loader closes it once the read completes. |
| pszTag | The tag the buffer is billed to. |
| RndManager::ResourceLoader::~ResourceLoader | ( | ) |
Release the buffer and the file.
| bool RndManager::ResourceLoader::Poll | ( | ) |
Finish the read when the file reports it complete.
A compressed file is inflated, and the file is deleted.
| int RndManager::ResourceLoader::GetData | ( | void ** | ppData, |
| int * | pnSize ) |
Wait for the data and hand it out, dropping one reference.
The last reference receives the buffer itself. Every earlier one receives a copy.
| ppData | Receives the data, which the caller frees. |
| pnSize | Receives the size of the data in bytes. |
|
inline |
Take one more reference, for one more GetData().