Public Types

deResourceLoaderTask Class Reference

Resource Loader Task. More...

#include <deResourceLoaderTask.h>

List of all members.

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.
deResourceLoaderThreadGetThread () const
 Retrieves the thread.
void SetThread (deResourceLoaderThread *thread)
 Sets the thread.
deFileResourceGetResource () 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.

Detailed Description

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.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Member Enumeration Documentation

Task states.

Enumerator:
etsLoadPending 

Loading pending.

etsLoadReadFile 

Loading, reading from file.

etsLoadSucceeded 

Loading succeeded, resource ready to be added.

etsLoadFailed 

Loading failed.

etsSavePending 

Saving pending.

etsSaveWriteFile 

Saving, writing to file.

etsSaveSucceeded 

Saving succeeded.

etsSaveFailed 

Saving failed.


Constructor & Destructor Documentation

deResourceLoaderTask::deResourceLoaderTask ( const char *  path,
int  resourceType,
deFileResource resource,
int  state 
)

Creates a new task.

deResourceLoaderTask::~deResourceLoaderTask (  )

Cleans up the task.


Member Function Documentation

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.


The documentation for this class was generated from the following file: