Lums
Public Member Functions | List of all members
lm::StreamProvider< T > Class Template Reference

A provider for assets that are loaded and unloaded at runtime. More...

#include <Provider.hpp>

Inheritance diagram for lm::StreamProvider< T >:
lm::BaseProvider< T > lm::Singleton< StreamProvider< T > >

Public Member Functions

T & get (int i)
 Get a resource by ID. More...
 
T & load (int i)
 
T & unload (int i)
 
T & reload (int i)
 
void reloadAll ()
 
void unloadAll ()
 
- Public Member Functions inherited from lm::BaseProvider< T >
T & get (int i)
 
T & set (int i)
 
std::size_t size () const
 

Additional Inherited Members

- Static Public Member Functions inherited from lm::Singleton< StreamProvider< T > >
static StreamProvider< T > & instance ()
 
- Protected Member Functions inherited from lm::Singleton< StreamProvider< T > >
 Singleton ()=default
 
 Singleton (const Singleton< StreamProvider< T > > &)=delete
 
Singleton< StreamProvider< T > > & operator= (const Singleton< StreamProvider< T > > &)=delete
 
- Protected Attributes inherited from lm::BaseProvider< T >
std::vector< T * > buffer
 

Detailed Description

template<typename T>
class lm::StreamProvider< T >

A provider for assets that are loaded and unloaded at runtime.

This is a template used to create custom providers for dynamic assets. Assets should implement load(), unload() and loaded().

Member Function Documentation

template<typename T >
T& lm::StreamProvider< T >::get ( int  i)
inline

Get a resource by ID.

If the resource is not currently loaded, a call to load() will be isued.

Parameters
iThe resource identifier
Returns
A reference to the resource
template<typename T >
T& lm::StreamProvider< T >::load ( int  i)
inline

Load a resource

Parameters
iThe resource ID
Returns
A reference to the resource
template<typename T >
T& lm::StreamProvider< T >::reload ( int  i)
inline

Reload a resource

Parameters
iThe resource ID
Returns
A reference to the resource
template<typename T >
void lm::StreamProvider< T >::reloadAll ( )
inline

Reload every resource

template<typename T >
T& lm::StreamProvider< T >::unload ( int  i)
inline

Unload a resource

Parameters
iThe resource ID
Returns
A reference to the resource
template<typename T >
void lm::StreamProvider< T >::unloadAll ( )
inline

Unload every resource


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