HoverRace
2.0
|
Queue of resource loaders. More...
#include <Loader.h>
Public Types | |
using | finishedLoadingSignal_t = boost::signals2::signal< void()> |
Public Member Functions | |
Loader () | |
~Loader () | |
template<class Fn > | |
void | AddLoader (const std::string &s, Fn fn) |
Add a new named loader. More... | |
template<class Fn > | |
void | AddLoader (Fn fn) |
Add a new unnamed loader. More... | |
void | FireFinishedLoadingSignal () |
finishedLoadingSignal_t & | GetFinishedLoadingSignal () |
Fired when all resources have been loaded and the loading scene is shutting down. More... | |
bool | IsEmpty () const |
bool | LoadNext () |
Load the next item. More... | |
Private Types | |
using | loader_t = std::pair< std::string, std::function< void()>> |
Private Attributes | |
finishedLoadingSignal_t | finishedLoadingSignal |
std::queue< loader_t > | loaders |
Queue of resource loaders.
using HoverRace::Util::Loader::finishedLoadingSignal_t = boost::signals2::signal<void()> |
|
private |
|
inline |
|
inline |
|
inline |
Add a new named loader.
The loader name is used for logging purposes only.
s | The name of the loader. |
fn | The loader function. |
|
inline |
Add a new unnamed loader.
fn | The loader function. |
|
inline |
|
inline |
Fired when all resources have been loaded and the loading scene is shutting down.
|
inline |
|
inline |
Load the next item.
If all of the loaders have been executed, then the finishedLoadingSignal will *not* be fired automatically, since the owner of the loader may want to perform some actions before notifying the listeners.
true
if there are any loaders remaining, false
if all loaders have executed.
|
private |
|
private |