BigFile/Sasquatch #1

Merged
rboullard merged 100 commits from BigFile into Development 2026-09-01 16:32:02 +00:00
5 changed files with 59 additions and 105 deletions
Showing only changes of commit 1d572b9d09 - Show all commits
@@ -8,46 +8,13 @@
#define BIGFOOT_ENGINE_ENGINEASSERTHANDLER_HPP
#include <Engine/EngineLogger_generated.hpp>
#include <Utils/Assert.hpp>
#include <Utils/Assert/AssertHandler.hpp>
#if defined BIGFOOT_NOT_OPTIMIZED
#include <format>
#include <source_location>
namespace Bigfoot
{
class EngineAssertHandler
{
public:
EngineAssertHandler() = delete;
EngineAssertHandler(const EngineAssertHandler& p_handler) = delete;
EngineAssertHandler(EngineAssertHandler&& p_handler) = delete;
~EngineAssertHandler() = delete;
/**
* Handle an assertion.
*
* \param p_location Location of the assertion.
* \param p_format Format string for the assertion message.
* \param p_args Arguments for the format string.
*/
template<typename... ARGS>
static void Handle(const std::source_location& p_location, std::format_string<ARGS...> p_format, ARGS&&... p_args)
{
BIGFOOT_LOG_FATAL(ENGINE_LOGGER,
"Assert: {} (File:{}, Line:{}, Function:{}\n",
std::format(p_format, std::forward<ARGS>(p_args)...),
p_location.file_name(),
p_location.line(),
p_location.function_name());
}
EngineAssertHandler& operator=(const EngineAssertHandler& p_handler) = delete;
EngineAssertHandler& operator=(EngineAssertHandler&& p_handler) = delete;
};
using EngineAssertHandler = AssertHandler<ENGINE_LOGGER>;
} // namespace Bigfoot
#endif
#endif
@@ -8,46 +8,13 @@
#define BIGFOOT_SYSTEM_SYSTEMASSERTHANDLER_HPP
#include <System/SystemLogger_generated.hpp>
#include <Utils/Assert.hpp>
#include <Utils/Assert/AssertHandler.hpp>
#if defined BIGFOOT_NOT_OPTIMIZED
#include <format>
#include <source_location>
namespace Bigfoot
{
class SystemAssertHandler
{
public:
SystemAssertHandler() = delete;
SystemAssertHandler(const SystemAssertHandler& p_handler) = delete;
SystemAssertHandler(SystemAssertHandler&& p_handler) = delete;
~SystemAssertHandler() = delete;
/**
* Handle an assertion.
*
* \param p_location Location of the assertion.
* \param p_format Format string for the assertion message.
* \param p_args Arguments for the format string.
*/
template<typename... ARGS>
static void Handle(const std::source_location& p_location, std::format_string<ARGS...> p_format, ARGS&&... p_args)
{
BIGFOOT_LOG_FATAL(SYSTEM_LOGGER,
"Assert: {} (File:{}, Line:{}, Function:{}\n",
std::format(p_format, std::forward<ARGS>(p_args)...),
p_location.file_name(),
p_location.line(),
p_location.function_name());
}
SystemAssertHandler& operator=(const SystemAssertHandler& p_handler) = delete;
SystemAssertHandler& operator=(SystemAssertHandler&& p_handler) = delete;
};
using SystemAssertHandler = AssertHandler<SYSTEM_LOGGER>;
} // namespace Bigfoot
#endif
#endif
@@ -0,0 +1,53 @@
/*********************************************************************
* \file AssertHandler.hpp
*
* \author Romain BOULLARD
* \date August 2026
*********************************************************************/
#ifndef BIGFOOT_UTILS_ASSERTHANDLER_HPP
#define BIGFOOT_UTILS_ASSERTHANDLER_HPP
#include <Utils/Assert/Assert.hpp>
#include <Utils/Log/Log.hpp>
#if defined BIGFOOT_NOT_OPTIMIZED
#include <format>
#include <source_location>
namespace Bigfoot
{
template<Log::LoggerInfo& LOGGER>
class AssertHandler
{
public:
AssertHandler() = delete;
AssertHandler(const AssertHandler& p_handler) = delete;
AssertHandler(AssertHandler&& p_handler) = delete;
~AssertHandler() = delete;
/**
* Handle an assertion.
*
* \param p_location Location of the assertion.
* \param p_format Format string for the assertion message.
* \param p_args Arguments for the format string.
*/
template<typename... ARGS>
static void Handle(const std::source_location& p_location, std::format_string<ARGS...> p_format, ARGS&&... p_args)
{
BIGFOOT_LOG_FATAL(LOGGER,
"Assert: {} (File:{}, Line:{}, Function:{}\n",
std::format(p_format, std::forward<ARGS>(p_args)...),
p_location.file_name(),
p_location.line(),
p_location.function_name());
}
AssertHandler& operator=(const AssertHandler& p_handler) = delete;
AssertHandler& operator=(AssertHandler&& p_handler) = delete;
};
} // namespace Bigfoot
#endif
#endif
@@ -6,47 +6,14 @@
*********************************************************************/
#ifndef BIGFOOT_UTILS_UTILSASSERTHANDLER_HPP
#define BIGFOOT_UTILS_UTILSASSERTHANDLER_HPP
#include <Utils/Assert.hpp>
#include <Utils/Assert/AssertHandler.hpp>
#include <Utils/UtilsLogger_generated.hpp>
#if defined BIGFOOT_NOT_OPTIMIZED
#include <format>
#include <source_location>
namespace Bigfoot
{
class UtilsAssertHandler
{
public:
UtilsAssertHandler() = delete;
UtilsAssertHandler(const UtilsAssertHandler& p_handler) = delete;
UtilsAssertHandler(UtilsAssertHandler&& p_handler) = delete;
~UtilsAssertHandler() = delete;
/**
* Handle an assertion.
*
* \param p_location Location of the assertion.
* \param p_format Format string for the assertion message.
* \param p_args Arguments for the format string.
*/
template<typename... ARGS>
static void Handle(const std::source_location& p_location, std::format_string<ARGS...> p_format, ARGS&&... p_args)
{
BIGFOOT_LOG_FATAL(UTILS_LOGGER,
"Assert: {} (File:{}, Line:{}, Function:{}\n",
std::format(p_format, std::forward<ARGS>(p_args)...),
p_location.file_name(),
p_location.line(),
p_location.function_name());
}
UtilsAssertHandler& operator=(const UtilsAssertHandler& p_handler) = delete;
UtilsAssertHandler& operator=(UtilsAssertHandler&& p_handler) = delete;
};
using UtilsAssertHandler = AssertHandler<UTILS_LOGGER>;
} // namespace Bigfoot
#endif
#endif