Resource Loader Task. More...
#include <deResourceLoaderTask.h>
Public Types | |
| enum | eTaskStates { etsLoadPending, etsLoadReadFile, etsLoadSucceeded, etsLoadFailed, etsSavePending, etsSaveWriteFile, etsSaveSucceeded, etsSaveFailed } |
Task states. More... | |
Public Member Functions | |
Constructors and Destructors | |
| deResourceLoaderTask (const char *path, int resourceType, deFileResource *resource, int state) | |
| Creates a new task. | |
| ~deResourceLoaderTask () | |
| Cleans up the task. | |
Management | |
| const char * | GetPath () const |
| Retrieves the path. | |
| int | GetResourceType () const |
| Retrieves the resource type. | |
| bool | Matches (const char *path, int resourceType) const |
| Determines if this task matches the given path/resourceType. | |
| int | GetState () const |
| Retrieves the state. | |
| void | SetState (int state) |
| Sets the state. | |
| deResourceLoaderThread * | GetThread () const |
| Retrieves the thread. | |
| void | SetThread (deResourceLoaderThread *thread) |
| Sets the thread. | |
| deFileResource * | GetResource () const |
| Retrieves the resource and adds a reference or NULL if not ready yet. | |
| void | SetResource (deFileResource *resource) |
| Sets the resource or NULL if not ready yet. | |
| void | SetStateAndResource (int state, deFileResource *resource) |
| Sets the state and resource in one go. | |
Resource Loader Task.
Manages the loading of a resource. Tasks have various states throughout their livetime. Task in pending state have been queued but no thread has been assigned to them. Tasks in processing state have a thread assigned and are loading the resources. Once finished loading the tasks switches over to the finished state. Tasks in this state are picked up the next time the resource loader checks for updates and the notifiers are called. Afterwards the task is removed. If the loading fails for some reason the task is switched to the failed state and the error is stored. A task is initialized with the path and type of the resource to load. The loaded resources is stored in the task until it is removed.
Task states.
| deResourceLoaderTask::deResourceLoaderTask | ( | const char * | path, |
| int | resourceType, | ||
| deFileResource * | resource, | ||
| int | state | ||
| ) |
Creates a new task.
| deResourceLoaderTask::~deResourceLoaderTask | ( | ) |
Cleans up the task.
| const char* deResourceLoaderTask::GetPath | ( | ) | const [inline] |
Retrieves the path.
| deFileResource* deResourceLoaderTask::GetResource | ( | ) | const |
Retrieves the resource and adds a reference or NULL if not ready yet.
| int deResourceLoaderTask::GetResourceType | ( | ) | const [inline] |
Retrieves the resource type.
| int deResourceLoaderTask::GetState | ( | ) | const |
Retrieves the state.
| deResourceLoaderThread* deResourceLoaderTask::GetThread | ( | ) | const [inline] |
Retrieves the thread.
| bool deResourceLoaderTask::Matches | ( | const char * | path, |
| int | resourceType | ||
| ) | const |
Determines if this task matches the given path/resourceType.
| void deResourceLoaderTask::SetResource | ( | deFileResource * | resource ) |
Sets the resource or NULL if not ready yet.
| void deResourceLoaderTask::SetState | ( | int | state ) |
Sets the state.
| void deResourceLoaderTask::SetStateAndResource | ( | int | state, |
| deFileResource * | resource | ||
| ) |
Sets the state and resource in one go.
| void deResourceLoaderTask::SetThread | ( | deResourceLoaderThread * | thread ) |
Sets the thread.
1.7.2