Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::loading_screen Struct Reference

#include <loading_screen.h>

Public Types

using visualizer_fn = std::function<void(const loading_screen&)>
 
using on_fail_fn = std::function<void(const std::string& module, const std::string& message)>
 

Public Member Functions

void set_visualizer (visualizer_fn fn)
 
void set_on_fail (on_fail_fn fn)
 
void begin_module (const std::string &module_name)
 
void progress (size_t completed, size_t total, const std::string &current_job={})
 
void log (const std::string &message)
 
void fail (const std::string &message)
 
auto check (bool result) -> bool
 Convenience: if result is false and no error was set, auto-fails with the current module name.
 
auto has_failed () const -> bool
 
auto error_message () const -> const std::string &
 
auto current_module () const -> const std::string &
 
auto completed () const -> size_t
 
auto total () const -> size_t
 
auto current_job () const -> const std::string &
 

Detailed Description

Definition at line 9 of file loading_screen.h.

Member Typedef Documentation

◆ on_fail_fn

using unravel::loading_screen::on_fail_fn = std::function<void(const std::string& module, const std::string& message)>

Definition at line 12 of file loading_screen.h.

◆ visualizer_fn

using unravel::loading_screen::visualizer_fn = std::function<void(const loading_screen&)>

Definition at line 11 of file loading_screen.h.

Member Function Documentation

◆ begin_module()

void unravel::loading_screen::begin_module ( const std::string & module_name)

Definition at line 18 of file loading_screen.cpp.

◆ check()

auto unravel::loading_screen::check ( bool result) -> bool

Convenience: if result is false and no error was set, auto-fails with the current module name.

Definition at line 57 of file loading_screen.cpp.

◆ completed()

auto unravel::loading_screen::completed ( ) const -> size_t

Definition at line 81 of file loading_screen.cpp.

◆ current_job()

auto unravel::loading_screen::current_job ( ) const -> const std::string&

Definition at line 91 of file loading_screen.cpp.

◆ current_module()

auto unravel::loading_screen::current_module ( ) const -> const std::string&

Definition at line 76 of file loading_screen.cpp.

◆ error_message()

auto unravel::loading_screen::error_message ( ) const -> const std::string&

Definition at line 71 of file loading_screen.cpp.

◆ fail()

void unravel::loading_screen::fail ( const std::string & message)

Definition at line 44 of file loading_screen.cpp.

◆ has_failed()

auto unravel::loading_screen::has_failed ( ) const -> bool

Definition at line 66 of file loading_screen.cpp.

◆ log()

void unravel::loading_screen::log ( const std::string & message)

Definition at line 37 of file loading_screen.cpp.

◆ progress()

void unravel::loading_screen::progress ( size_t completed,
size_t total,
const std::string & current_job = {} )

Definition at line 29 of file loading_screen.cpp.

◆ set_on_fail()

void unravel::loading_screen::set_on_fail ( on_fail_fn fn)

Definition at line 13 of file loading_screen.cpp.

◆ set_visualizer()

void unravel::loading_screen::set_visualizer ( visualizer_fn fn)

Definition at line 8 of file loading_screen.cpp.

◆ total()

auto unravel::loading_screen::total ( ) const -> size_t

Definition at line 86 of file loading_screen.cpp.


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