Core module
Cubos core library.
Macro used to export and import symbols from the library.
The core library contains loose utilities and functionality on which the rest of the Cubos libraries and applications are built on. Lives in the cubos::
This library can be further divided into modules, which are documented in their respective module pages. Each of these modules has its own namespace and directory in the source tree. For example, the ECS module lives in the cubos::
Modules
- module Audio
- Provides audio functionality.
- module Data
- Provides filesystem and serialization utilities.
- module ECS
- Entity Component System library.
- module Geometry
- Provides geometry utilities.
- module Graphics
- Provides a graphics API abstraction.
- module Input and output
- Provides a window API abstraction.
- module Memory
- Provides a stream library and memory utilities.
- module Reflection
- Provides utilities useful for handling type-erased data.
- module Threading
- Provides threading and asynchronous related utilities.
Files
- file api.hpp
- Macro CUBOS_
CORE_ API. - file log.hpp
- Logging and assertion macros.
- file metrics.hpp
- Metrics and profiling utilities and macros.
Classes
- class cubos::core::Logger
- Singleton which holds the logging state.
- class cubos::core::Metrics
- Singleton class that manages a collection of metrics.
Defines
- #define CUBOS_LOG_LEVEL_TRACE
- Trace log level, lowest log level. Very verbose.
- #define CUBOS_LOG_LEVEL_DEBUG
- Debug log level. Contains messages useful for debugging, but which are not necessary in release builds.
- #define CUBOS_LOG_LEVEL_INFO
- Information log level. Contains important events that are not errors.
- #define CUBOS_LOG_LEVEL_WARN
- Warn log level. Contains events that are not errors, but which are unexpected and may be problematic.
- #define CUBOS_LOG_LEVEL_ERROR
- Error log level. Contains errors which are recoverable from.
- #define CUBOS_LOG_LEVEL_CRITICAL
- Critical log level, highest log level. Contains errors which are unrecoverable from.
- #define CUBOS_LOG_LEVEL_OFF
- Off log level, disables all logging.
- #define CUBOS_LOG_LEVEL
- Log level to compile in.
- #define CUBOS_TRACE(...)
- Used for logging very verbose information.
- #define CUBOS_DEBUG(...)
- Used for logging information which is useful for debugging but not necessary in release builds.
- #define CUBOS_INFO(...)
- Used for logging information which is useful in release builds.
- #define CUBOS_WARN(...)
- Used for logging unexpected events.
- #define CUBOS_ERROR(...)
- Used for logging recoverable errors.
- #define CUBOS_CRITICAL(...)
- Used for logging unrecoverable errors.
- #define CUBOS_LOG(level, ...)
- Used for logging messages.
- #define CUBOS_FAIL(...)
- Aborts a program, optionally printing a critical error message.
- #define CUBOS_UNREACHABLE(...)
- Marks a code path as supposedly unreachable. Aborts the program when reached.
- #define CUBOS_TODO(...)
- Marks a code path as unfinished. Aborts the program when reached.
- #define CUBOS_ASSERT(cond, ...)
- Asserts that a condition is true, aborting the program if it is not.
- #define CUBOS_ASSERT_IMP(cond, cons, ...)
- Asserts that an implication is true, aborting the program if it is not.
- #define CUBOS_DEBUG_ASSERT(cond, ...)
- In debug builds asserts that a condition is true, aborting the program if it is not.
- #define CUBOS_METRIC(...)
- Macro to add a metric.
- #define CUBOS_PROFILE(...)
- Macro to measure the execution time of a function/scope, registering it as a metric.
Define documentation
#define CUBOS_LOG_LEVEL_TRACE
#include <core/log.hpp>
Trace log level, lowest log level. Very verbose.
#define CUBOS_LOG_LEVEL_DEBUG
#include <core/log.hpp>
Debug log level. Contains messages useful for debugging, but which are not necessary in release builds.
#define CUBOS_LOG_LEVEL_INFO
#include <core/log.hpp>
Information log level. Contains important events that are not errors.
#define CUBOS_LOG_LEVEL_WARN
#include <core/log.hpp>
Warn log level. Contains events that are not errors, but which are unexpected and may be problematic.
#define CUBOS_LOG_LEVEL_ERROR
#include <core/log.hpp>
Error log level. Contains errors which are recoverable from.
#define CUBOS_LOG_LEVEL_CRITICAL
#include <core/log.hpp>
Critical log level, highest log level. Contains errors which are unrecoverable from.
#define CUBOS_LOG_LEVEL_OFF
#include <core/log.hpp>
Off log level, disables all logging.
#define CUBOS_LOG_LEVEL
#include <core/log.hpp>
Log level to compile in.
This macro essentially controls the minimum log level that will be compiled into the binary.
Should be set to one of the following:
- CUBOS_
LOG_ LEVEL_ TRACE - CUBOS_
LOG_ LEVEL_ DEBUG - CUBOS_
LOG_ LEVEL_ INFO - CUBOS_
LOG_ LEVEL_ WARN - CUBOS_
LOG_ LEVEL_ ERROR - CUBOS_
LOG_ LEVEL_ CRITICAL - CUBOS_
LOG_ LEVEL_ OFF
By default, on debug builds, this is set to CUBOS_
#define CUBOS_TRACE(...)
#include <core/log.hpp>
Used for logging very verbose information.
Parameters | |
---|---|
... | Format string and arguments. |
#define CUBOS_DEBUG(...)
#include <core/log.hpp>
Used for logging information which is useful for debugging but not necessary in release builds.
Parameters | |
---|---|
... | Format string and arguments. |
#define CUBOS_INFO(...)
#include <core/log.hpp>
Used for logging information which is useful in release builds.
Parameters | |
---|---|
... | Format string and arguments. |
#define CUBOS_WARN(...)
#include <core/log.hpp>
Used for logging unexpected events.
Parameters | |
---|---|
... | Format string and arguments. |
#define CUBOS_ERROR(...)
#include <core/log.hpp>
Used for logging recoverable errors.
Parameters | |
---|---|
... | Format string and arguments. |
#define CUBOS_CRITICAL(...)
#include <core/log.hpp>
Used for logging unrecoverable errors.
Parameters | |
---|---|
... | Format string and arguments. |
#define CUBOS_LOG(level,
...)
#include <core/log.hpp>
Used for logging messages.
Parameters | |
---|---|
level | Log level. |
... | Format string and arguments. |
#define CUBOS_FAIL(...)
#include <core/log.hpp>
Aborts a program, optionally printing a critical error message.
Parameters | |
---|---|
... | Optional format string and arguments. |
#define CUBOS_UNREACHABLE(...)
#include <core/log.hpp>
Marks a code path as supposedly unreachable. Aborts the program when reached.
Parameters | |
---|---|
... | Optional format string and arguments. |
#define CUBOS_TODO(...)
#include <core/log.hpp>
Marks a code path as unfinished. Aborts the program when reached.
Parameters | |
---|---|
... | Optional format string and arguments. |
#define CUBOS_ASSERT(cond,
...)
#include <core/log.hpp>
Asserts that a condition is true, aborting the program if it is not.
Parameters | |
---|---|
cond | Condition to assert. |
... | Optional format string and arguments. |
#define CUBOS_ASSERT_IMP(cond,
cons,
...)
#include <core/log.hpp>
Asserts that an implication is true, aborting the program if it is not.
Parameters | |
---|---|
cond | Implication condition. |
cons | Implication consequence. |
... | Optional format string and arguments. |
#define CUBOS_DEBUG_ASSERT(cond,
...)
#include <core/log.hpp>
In debug builds asserts that a condition is true, aborting the program if it is not.
Parameters | |
---|---|
cond | Condition to assert. |
... | Optional format string and arguments. |
#define CUBOS_METRIC(...)
#include <core/metrics.hpp>
Macro to add a metric.
#define CUBOS_PROFILE(...)
#include <core/metrics.hpp>
Macro to measure the execution time of a function/scope, registering it as a metric.