Tramway SDK
Public Types | Public Member Functions | Protected Attributes | List of all members
tram::Resource Class Referenceabstract

#include <resource.h>

Inheritance diagram for tram::Resource:
tram::Audio::Sound tram::Physics::CollisionModel tram::Render::Animation tram::Render::Material tram::Render::Model tram::Render::Sprite

Public Types

enum  Status { UNLOADED , LOADED , READY }
 

Public Member Functions

 Resource (name_t name)
 
Resource::Status GetStatus () const
 
name_t GetName () const
 
size_t GetReferences () const
 
bool IsLoadFailed () const
 
void AddReference ()
 
void RemoveReference ()
 
virtual void LoadFromDisk ()=0
 
virtual void LoadFromMemory ()=0
 
void Load ()
 
virtual void Unload ()=0
 

Protected Attributes

Status status = UNLOADED
 
name_t name
 
bool load_fail = false
 
size_t references = 0
 

Member Enumeration Documentation

◆ Status

Enumerator
UNLOADED 
LOADED 
READY 

Constructor & Destructor Documentation

◆ Resource()

tram::Resource::Resource ( name_t  name)
inline

Member Function Documentation

◆ AddReference()

void tram::Resource::AddReference ( )
inline

◆ GetName()

name_t tram::Resource::GetName ( ) const
inline

◆ GetReferences()

size_t tram::Resource::GetReferences ( ) const
inline

◆ GetStatus()

Resource::Status tram::Resource::GetStatus ( ) const
inline

◆ IsLoadFailed()

bool tram::Resource::IsLoadFailed ( ) const
inline

◆ Load()

void tram::Resource::Load ( )
inline

◆ LoadFromDisk()

virtual void tram::Resource::LoadFromDisk ( )
pure virtual

◆ LoadFromMemory()

virtual void tram::Resource::LoadFromMemory ( )
pure virtual

◆ RemoveReference()

void tram::Resource::RemoveReference ( )
inline

◆ Unload()

virtual void tram::Resource::Unload ( )
pure virtual

Member Data Documentation

◆ load_fail

bool tram::Resource::load_fail = false
protected

◆ name

name_t tram::Resource::name
protected

◆ references

size_t tram::Resource::references = 0
protected

◆ status

Status tram::Resource::status = UNLOADED
protected

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