igor::iResource Class Reference

#include <iResource.h>

Inherited by igor::iAnimation, igor::iMaterial, igor::iModel, igor::iShaderMaterial, igor::iSound, igor::iSprite, and igor::iTexture.

Public Member Functions

virtual ~iResource ()=default
 
bool isValid () const
 
bool isProcessed () const
 
bool isQuiet () const
 
const iaStringgetSource () const
 
const iaString getInfo () const
 
const iResourceIDgetID () const
 
const iaStringgetAlias () const
 
iResourceCacheMode getCacheMode () const
 
const iParametersgetParameters () const
 
const iaStringgetType () const
 

Static Public Member Functions

static bool extractID (const iParameters &parameters, iResourceID &id, bool quiet=false)
 

Protected Member Functions

 iResource (const iParameters &parameters)
 

Friends

class iResourceManager
 

Detailed Description

represents a resource

available parameters for loading data:

  • id: the unique id of the resource (type: iResourceID)
  • alias: the alias of the resource (type: iaString) Internally this doubles as filename and id in string form.
  • type: the type of resource (type: iaString)
  • cacheMode: the cache mode of this resource (type: iResourceCacheMode)
  • quiet: if true this resource will cause less verbose output in logging. Helpful when generating stuff
  • generate: if true the data is assumed to be generated and not loaded. This implies that there is no uuid for it and therefore will also be generated

Cache mode of a resource can be increased by requesting the same resource with a higher level of cache mode.

Constructor & Destructor Documentation

◆ ~iResource()

virtual igor::iResource::~iResource ( )
virtualdefault

does nothing

◆ iResource()

igor::iResource::iResource ( const iParameters parameters)
protected

initializes members

Parameters
parametersthe parameters which define the resource

Member Function Documentation

◆ extractID()

bool igor::iResource::extractID ( const iParameters parameters,
iResourceID id,
bool  quiet = false 
)
static
Returns
extracted resource id from parameters
Parameters
parametersthe given parameters

◆ getAlias()

const iaString & igor::iResource::getAlias ( ) const
Returns
alias of resource (not unique)

◆ getCacheMode()

iResourceCacheMode igor::iResource::getCacheMode ( ) const
Returns
cache mode

◆ getID()

const iResourceID & igor::iResource::getID ( ) const
Returns
resource id

◆ getInfo()

const iaString igor::iResource::getInfo ( ) const
Returns
info string

◆ getParameters()

const iParameters & igor::iResource::getParameters ( ) const
Returns
resource parameters

◆ getSource()

const iaString & igor::iResource::getSource ( ) const
Returns
the source of this resource

usually the filename

◆ getType()

const iaString & igor::iResource::getType ( ) const
Returns
the resource type

◆ isProcessed()

bool igor::iResource::isProcessed ( ) const
Returns
true if the resource was processed

processed does not mean that it was loaded correctly it can also mean that we are done trying to loading it

◆ isQuiet()

bool igor::iResource::isQuiet ( ) const
Returns
true if this resource will not be logged

◆ isValid()

bool igor::iResource::isValid ( ) const
Returns
true if there is valid data present

Friends And Related Function Documentation

◆ iResourceManager

friend class iResourceManager
friend

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