resource.hpp File Reference

Classes

struct  kanzi::ResourceLoaderThreadContext
 Resource loader thread local data. More...
 
class  kanzi::Resource
 Represents the base class for all resources. More...
 

Namespaces

 kanzi
 

Typedefs

typedef weak_ptr< Resource > kanzi::ResourceWeakPtr
 
typedef kanzi::ResourceLoaderThreadContext KzuResourceLoaderThreadContext
 

Enumerations

enum  KzuResourceLoadState { KZU_RESOURCE_LOAD_STATE_NOT_LOADED, KZU_RESOURCE_LOAD_STATE_LOADED }
 Resource loading state. More...
 
enum  KzuResourceLoadingStrategy { KZU_RESOURCE_LOADING_STRATEGY_DEFAULT, KZU_RESOURCE_LOADING_STRATEGY_MANUAL, KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_SPEED, KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_MEMORY }
 Resource loading strategy specifies when the resource is loaded and unloaded. More...
 

Typedef Documentation

Enumeration Type Documentation

Resource loading state.

Enumerator
KZU_RESOURCE_LOAD_STATE_NOT_LOADED 

The resource has not yet been loaded.

KZU_RESOURCE_LOAD_STATE_LOADED 

The resource has been loaded.

Resource loading strategy specifies when the resource is loaded and unloaded.

Enumerator
KZU_RESOURCE_LOADING_STRATEGY_DEFAULT 

When using the default strategy the engine loads the resource before it is needed.

The loading strategy depends on the platform and Kanzi application, but the engine optimizes the loading strategy.

KZU_RESOURCE_LOADING_STRATEGY_MANUAL 

When using the manual loading strategy you must load and unload the resource manually by calling the kzuResourceLoad and kzuResourceUnload functions.

This is the only loading strategy that you can control completely.

KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_SPEED 

When using the optimize speed strategy the engine keeps the resource in RAM.

When the application needs the resource, the engine can deploy the resource from RAM to GPU as fast as possible. The engine releases the resource from RAM only when the resource is not accessible anymore. This strategy guarantees that the engine does not unload the resource during runtime.

KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_MEMORY 

When using the optimize memory loading strategy the engine unloads the resource as soon as possible.

The engine releases the GPU resources from RAM after deploying the resources.