matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Loading...
Searching...
No Matches
Namespaces | Classes | Functions | Variables
engine::util Namespace Reference

Namespaces

namespace  alg
 Contains algorithm.
 
namespace  ds
 

Classes

class  ArgParser
 Parses command line arguments. More...
 
class  Configuration
 Loads and stores the configuration file. More...
 
class  EngineError
 Represents an error that occurred in the engine. More...
 
class  Error
 Base class for all errors. More...
 
class  UserError
 Represents an error that occurred in the user's code. More...
 

Functions

void tracing_on ()
 Turns on tracing.
 
void tracing_off ()
 Turns off tracing.
 
void trace (std::source_location location=std::source_location::current())
 Traces a function call.
 
std::string read_text_file (const std::filesystem::path &path)
 Reads a text file.
 
template<typename Action >
void once (Action action)
 Calls an action once.
 

Variables

static bool g_tracing = true
 

Function Documentation

◆ tracing_on()

void engine::util::tracing_on ( )

Turns on tracing.

◆ tracing_off()

void engine::util::tracing_off ( )

Turns off tracing.

◆ trace()

void engine::util::trace ( std::source_location  location = std::source_location::current())

Traces a function call.

Parameters
locationThe location of the trace. Defaults to the call site location.
void foo() {
trace();
}
void trace(std::source_location location=std::source_location::current())
Traces a function call.
Definition Utils.cpp:20
Prints: "foo() at foo.cpp:10"

◆ read_text_file()

std::string engine::util::read_text_file ( const std::filesystem::path &  path)

Reads a text file.

Parameters
pathThe path to the file.
Returns
The content of the file.

◆ once()

template<typename Action >
void engine::util::once ( Action  action)

Calls an action once.

Parameters
actionThe action to call.
void foo() {
once([] { std::cout << "foo\n"; });
}
void once(Action action)
Calls an action once.
Definition Utils.hpp:117
Prints: "foo" once when the control flow reaches the function for the first time. If the function foo is called again, the action is not called again.

Variable Documentation

◆ g_tracing

bool engine::util::g_tracing = true
static