Resource

Inherited: Object

Description

Note: This class must be a superclass only and shouldn’t be created manually.

Public Methods

void

decRef ()

void

incRef ()

bool

isUnloadable ()

void

notifyCurrentState ()

void

setState (ResourceState state)

ResourceState

state () const

void

subscribe (Resource::ResourceUpdatedCallback callback, void * object)

void

switchState (ResourceState state)

void

unsubscribe (void * object)

Static Methods

None

Methods Description

void Resource::decRef ()

Decreases the reference counter for the resource. In case of the reference count becomes zero the resource set to ResourceState::Suspend state.


void Resource::incRef ()

Increases the reference counter for the resource.


bool Resource::isUnloadable ()

Returns true in case of resource can be unloaded from GPU; otherwise returns false.


void Resource::notifyCurrentState ()

Notifies subscribers about the current state of the resource.


void Resource::setState (ResourceState state)

Sets new state for the resource.

See also *state*().


ResourceState Resource::state () const

Returns state for the resource. For possible states please see Resource::ResourceState.

See also setState().


void Resource::subscribe (Resource::ResourceUpdatedCallback callback, void * object)

Subscribes callback fro object to handle resource status.


void Resource::switchState (ResourceState state)

Switches the current state to a new state for the resource.


void Resource::unsubscribe (void * object)

Unsubscribes an object to stop handle resource status.