From e8a72234dc585459d2a5dc95ff601e8a212e0b71 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 20 Jan 2026 12:56:14 +0100 Subject: Added Chunk Size deduction for ghost layer --- default.nix | 2 +- lib/core/c++/chunk.hpp | 18 ++++++++---------- lib/core/tests/chunk.cpp | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 lib/core/tests/chunk.cpp diff --git a/default.nix b/default.nix index b41c5a8..77abf03 100644 --- a/default.nix +++ b/default.nix @@ -39,7 +39,7 @@ let forstio = (import ((builtins.fetchTarball { url = "https://git.keldu.de/forstio-forstio/snapshot/master.tar.gz"; - sha256 = "sha256:1l305m2vsm4vxflip9ij9f8q7qbiy85k06kwqi7jwm0b1j23jrin"; + sha256 = "sha256:12wm3kgrsw3irfnafixrq89vr2gr4h05vc2ybixkgfsnc1znhwlv"; }) + "/default.nix"){ inherit stdenv; inherit clang-tools; diff --git a/lib/core/c++/chunk.hpp b/lib/core/c++/chunk.hpp index 223ceec..1950661 100644 --- a/lib/core/c++/chunk.hpp +++ b/lib/core/c++/chunk.hpp @@ -6,26 +6,24 @@ namespace kel { namespace lbm { namespace sch { namespace impl { -template -struct chunk_schema_type_helper { - using Schema = typename chunk_schema_type_helper::Schema; -}; +template> +struct chunk_schema_type_helper; -template -struct chunk_schema_type_helper, saw::tmpl_group> final { - using Schema = FixedArray; +template +struct chunk_schema_type_helper, saw::tmpl_value_group> final { + using Schema = typename chunk_schema_type_helper, saw::tmpl_value_group>::Schema; }; template -struct chunk_schema_type_helper, saw::tmpl_group> final { +struct chunk_schema_type_helper, saw::tmpl_value_group> final { using Schema = FixedArray; }; } -template +template struct Chunk { - using InnerSchema = typename impl::chunk_schema_type_helper::Schema; + using InnerSchema = typename impl::chunk_schema_type_helper>::Schema; }; // Not needed for now diff --git a/lib/core/tests/chunk.cpp b/lib/core/tests/chunk.cpp new file mode 100644 index 0000000..5110597 --- /dev/null +++ b/lib/core/tests/chunk.cpp @@ -0,0 +1,37 @@ +#include + +#include "../c++/chunk.hpp" + +namespace { +namespace sch { +using namespace saw::schema; +} + +SAW_TEST("Chunk Ghost size 0"){ + using namespace kel; + + using TestChunk = lbm::sch::Chunk; + using TestArray = sch::FixedArray; + + SAW_EXPECT((std::is_same_v), "Types are not identical"); +} + +SAW_TEST("Chunk Ghost size 1"){ + using namespace kel; + + using TestChunk = lbm::sch::Chunk; + using TestArray = sch::FixedArray; + + SAW_EXPECT((std::is_same_v), "Types are not identical"); +} + +SAW_TEST("Chunk Ghost size 3"){ + using namespace kel; + + using TestChunk = lbm::sch::Chunk; + using TestArray = sch::FixedArray; + + SAW_EXPECT((std::is_same_v), "Types are not identical"); +} + +} -- cgit v1.2.3