FlatTime
This commit is contained in:
18
Bigfoot/Sources/System/Include/System/Time/FlatTime.hpp
Normal file
18
Bigfoot/Sources/System/Include/System/Time/FlatTime.hpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*********************************************************************
|
||||||
|
* \file FlatTime.hpp
|
||||||
|
*
|
||||||
|
* \author Romain BOULLARD
|
||||||
|
* \date February 2026
|
||||||
|
*********************************************************************/
|
||||||
|
#ifndef BIGFOOT_SYSTEM_FLATTIME_HPP
|
||||||
|
#define BIGFOOT_SYSTEM_FLATTIME_HPP
|
||||||
|
#include <System/Time/Time.hpp>
|
||||||
|
#include <System/Time/Time_generated.hpp>
|
||||||
|
|
||||||
|
namespace flatbuffers
|
||||||
|
{
|
||||||
|
Bigfoot::Flat::Time Pack(const Bigfoot::Time& p_time);
|
||||||
|
Bigfoot::Time UnPack(const Bigfoot::Flat::Time& p_flatTime);
|
||||||
|
} // namespace flatbuffers
|
||||||
|
|
||||||
|
#endif
|
||||||
8
Bigfoot/Sources/System/Include/System/Time/Time.fbs
Normal file
8
Bigfoot/Sources/System/Include/System/Time/Time.fbs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
native_include "System/Time/FlatTime.hpp";
|
||||||
|
|
||||||
|
namespace Bigfoot.Flat;
|
||||||
|
|
||||||
|
struct Time (native_type: "::Bigfoot::Time")
|
||||||
|
{
|
||||||
|
epoch:ulong;
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
// automatically generated by the FlatBuffers compiler, do not modify
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef FLATBUFFERS_GENERATED_TIME_BIGFOOT_FLAT_H_
|
||||||
|
#define FLATBUFFERS_GENERATED_TIME_BIGFOOT_FLAT_H_
|
||||||
|
|
||||||
|
#include "flatbuffers/flatbuffers.h"
|
||||||
|
|
||||||
|
// Ensure the included flatbuffers.h is the same version as when this file was
|
||||||
|
// generated, otherwise it may not be compatible.
|
||||||
|
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
||||||
|
FLATBUFFERS_VERSION_MINOR == 12 &&
|
||||||
|
FLATBUFFERS_VERSION_REVISION == 19,
|
||||||
|
"Non-compatible flatbuffers version included");
|
||||||
|
|
||||||
|
#include "System/Time/FlatTime.hpp"
|
||||||
|
|
||||||
|
#include "EASTL/unique_ptr.h"
|
||||||
|
#include "EASTL/string.h"
|
||||||
|
|
||||||
|
namespace Bigfoot {
|
||||||
|
namespace Flat {
|
||||||
|
|
||||||
|
struct Time;
|
||||||
|
|
||||||
|
inline const ::flatbuffers::TypeTable *TimeTypeTable();
|
||||||
|
|
||||||
|
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Time FLATBUFFERS_FINAL_CLASS {
|
||||||
|
private:
|
||||||
|
uint64_t epoch_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
struct Traits;
|
||||||
|
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||||
|
return TimeTypeTable();
|
||||||
|
}
|
||||||
|
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||||
|
return "Bigfoot.Flat.Time";
|
||||||
|
}
|
||||||
|
Time()
|
||||||
|
: epoch_(0) {
|
||||||
|
}
|
||||||
|
Time(uint64_t _epoch)
|
||||||
|
: epoch_(::flatbuffers::EndianScalar(_epoch)) {
|
||||||
|
}
|
||||||
|
uint64_t epoch() const {
|
||||||
|
return ::flatbuffers::EndianScalar(epoch_);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
FLATBUFFERS_STRUCT_END(Time, 8);
|
||||||
|
|
||||||
|
struct Time::Traits {
|
||||||
|
using type = Time;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline const ::flatbuffers::TypeTable *TimeTypeTable() {
|
||||||
|
static const ::flatbuffers::TypeCode type_codes[] = {
|
||||||
|
{ ::flatbuffers::ET_ULONG, 0, -1 }
|
||||||
|
};
|
||||||
|
static const int64_t values[] = { 0, 8 };
|
||||||
|
static const char * const names[] = {
|
||||||
|
"epoch"
|
||||||
|
};
|
||||||
|
static const ::flatbuffers::TypeTable tt = {
|
||||||
|
::flatbuffers::ST_STRUCT, 1, type_codes, nullptr, nullptr, values, names
|
||||||
|
};
|
||||||
|
return &tt;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Flat
|
||||||
|
} // namespace Bigfoot
|
||||||
|
|
||||||
|
#endif // FLATBUFFERS_GENERATED_TIME_BIGFOOT_FLAT_H_
|
||||||
22
Bigfoot/Sources/System/Time/FlatTime.cpp
Normal file
22
Bigfoot/Sources/System/Time/FlatTime.cpp
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*********************************************************************
|
||||||
|
* \file FlatTime.cpp
|
||||||
|
*
|
||||||
|
* \author Romain BOULLARD
|
||||||
|
* \date February 2026
|
||||||
|
*********************************************************************/
|
||||||
|
#include <System/Time/FlatTime.hpp>
|
||||||
|
|
||||||
|
namespace flatbuffers
|
||||||
|
{
|
||||||
|
Bigfoot::Flat::Time Pack(const Bigfoot::Time& p_time)
|
||||||
|
{
|
||||||
|
return Bigfoot::Flat::Time {p_time.Epoch()};
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************/
|
||||||
|
|
||||||
|
Bigfoot::Time UnPack(const Bigfoot::Flat::Time& p_flatTime)
|
||||||
|
{
|
||||||
|
return Bigfoot::Time {p_flatTime.epoch()};
|
||||||
|
}
|
||||||
|
} // namespace flatbuffers
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
* \author Romain BOULLARD
|
* \author Romain BOULLARD
|
||||||
* \date December 2025
|
* \date December 2025
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#include <System/Time.hpp>
|
#include <System/Time/Time.hpp>
|
||||||
|
|
||||||
#include <System/SystemAssertHandler.hpp>
|
#include <System/SystemAssertHandler.hpp>
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <Engine/BigFile/BigFile.hpp>
|
#include <Engine/BigFile/BigFile.hpp>
|
||||||
|
|
||||||
#include <System/Log/Log.hpp>
|
#include <System/Log/Log.hpp>
|
||||||
#include <System/Time.hpp>
|
#include <System/Time/Time.hpp>
|
||||||
#include <System/UUID/UUID.hpp>
|
#include <System/UUID/UUID.hpp>
|
||||||
|
|
||||||
#include <Utils/Singleton.hpp>
|
#include <Utils/Singleton.hpp>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* \author Romain BOULLARD
|
* \author Romain BOULLARD
|
||||||
* \date December 2025
|
* \date December 2025
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#include <System/Time.hpp>
|
#include <System/Time/Time.hpp>
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
Reference in New Issue
Block a user