From ed029bc24d5ca032ec0308220f91cf3b611617da Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 2 May 2025 12:37:23 +0100 Subject: [PATCH] refactor: adjust template const modifiers --- .../Generating/CodeGenerator.cpp | 6 +-- .../Generating/CodeGenerator.h | 2 +- .../Generating/ICodeTemplate.h | 4 +- .../Templates/AssetStructTestsTemplate.cpp | 51 +++++++++---------- .../Templates/AssetStructTestsTemplate.h | 4 +- .../Templates/Internal/BaseTemplate.cpp | 4 +- .../Templates/Internal/BaseTemplate.h | 4 +- .../Generating/Templates/ZoneLoadTemplate.cpp | 26 +++++----- .../Generating/Templates/ZoneLoadTemplate.h | 4 +- .../Generating/Templates/ZoneMarkTemplate.cpp | 18 +++---- .../Generating/Templates/ZoneMarkTemplate.h | 4 +- .../Templates/ZoneWriteTemplate.cpp | 12 ++--- .../Generating/Templates/ZoneWriteTemplate.h | 4 +- 13 files changed, 70 insertions(+), 73 deletions(-) diff --git a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp index 347febe4..2b1d9bc6 100644 --- a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp @@ -27,7 +27,7 @@ void CodeGenerator::SetupTemplates() m_template_mapping["assetstructtests"] = std::make_unique(); } -bool CodeGenerator::GenerateCodeForTemplate(RenderingContext* context, ICodeTemplate* codeTemplate) const +bool CodeGenerator::GenerateCodeForTemplate(const RenderingContext& context, ICodeTemplate* codeTemplate) const { for (const auto& codeFile : codeTemplate->GetFilesToRender(context)) { @@ -110,7 +110,7 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository) for (auto* asset : assets) { auto context = RenderingContext::BuildContext(repository, asset); - if (!GenerateCodeForTemplate(context.get(), foundTemplate->second.get())) + if (!GenerateCodeForTemplate(*context, foundTemplate->second.get())) { std::cerr << std::format( "Failed to generate code for asset '{}' with preset '{}'\n", asset->m_definition->GetFullName(), foundTemplate->first); @@ -128,7 +128,7 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository) return false; auto context = RenderingContext::BuildContext(repository, asset); - if (!GenerateCodeForTemplate(context.get(), foundTemplate->second.get())) + if (!GenerateCodeForTemplate(*context, foundTemplate->second.get())) return false; } } diff --git a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h index b05bd382..c1b45b7d 100644 --- a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h +++ b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h @@ -17,7 +17,7 @@ public: private: void SetupTemplates(); - bool GenerateCodeForTemplate(RenderingContext* context, ICodeTemplate* codeTemplate) const; + bool GenerateCodeForTemplate(const RenderingContext& context, ICodeTemplate* codeTemplate) const; static bool GetAssetWithName(IDataRepository* repository, const std::string& name, StructureInformation*& asset); const ZoneCodeGeneratorArguments* m_args; diff --git a/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h b/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h index 833d9900..4c1c9992 100644 --- a/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h @@ -29,6 +29,6 @@ public: ICodeTemplate& operator=(const ICodeTemplate& other) = default; ICodeTemplate& operator=(ICodeTemplate&& other) noexcept = default; - virtual std::vector GetFilesToRender(RenderingContext* context) = 0; - virtual void RenderFile(std::ostream& stream, int fileTag, RenderingContext* context) = 0; + virtual std::vector GetFilesToRender(const RenderingContext& context) = 0; + virtual void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) = 0; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp index 1646dcbb..3237a9f6 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp @@ -2,18 +2,19 @@ #include "Domain/Computations/StructureComputations.h" #include "Internal/BaseTemplate.h" +#include "Utils/StringUtils.h" -#include -#include +#include +#include namespace { - static constexpr int TAG_SOURCE = 1; + constexpr int TAG_SOURCE = 1; class Template final : BaseTemplate { public: - Template(std::ostream& stream, RenderingContext* context) + Template(std::ostream& stream, const RenderingContext& context) : BaseTemplate(stream, context) { } @@ -26,21 +27,22 @@ namespace LINE("// Any changes will be discarded when regenerating.") LINE("// ====================================================================") LINE("") + LINEF("#include \"Game/{0}/{0}.h\"", m_env.m_game) + LINE("") LINE("#include ") LINE("#include ") LINE("#include ") - LINE("#include \"Game/" << m_env.m_game << "/" << m_env.m_game << ".h\"") LINE("") - LINE("using namespace " << m_env.m_game << ";") + LINEF("using namespace {0};", m_env.m_game) LINE("") - LINE("namespace game::" << m_env.m_game << "::xassets::asset_" << Lower(m_env.m_asset->m_definition->m_name)) + LINEF("namespace game::{0}::xassets::asset_{1}", m_env.m_game, Lower(m_env.m_asset->m_definition->m_name)) LINE("{") m_intendation++; if (m_env.m_asset->m_has_matching_cross_platform_structure) TestMethod(m_env.m_asset); - for (auto* structure : m_env.m_used_structures) + for (const auto* structure : m_env.m_used_structures) { StructureComputations computations(structure->m_info); if (!structure->m_info->m_definition->m_anonymous && !computations.IsAsset() && structure->m_info->m_has_matching_cross_platform_structure) @@ -52,10 +54,12 @@ namespace } private: - void TestMethod(StructureInformation* structure) + void TestMethod(const StructureInformation* structure) { - LINE("TEST_CASE(\"" << m_env.m_game << "::" << m_env.m_asset->m_definition->GetFullName() << ": Tests for " - << structure->m_definition->GetFullName() << "\", \"[assetstruct]\")") + LINEF("TEST_CASE(\"{0}::{1}: Tests for {2}\", \"[assetstruct]\")", + m_env.m_game, + m_env.m_asset->m_definition->GetFullName(), + structure->m_definition->GetFullName()) LINE("{") m_intendation++; @@ -63,44 +67,37 @@ namespace { if (!member->m_member->m_name.empty() && !member->m_member->m_type_declaration->m_has_custom_bit_size) { - LINE("REQUIRE(offsetof(" << structure->m_definition->GetFullName() << ", " << member->m_member->m_name - << ") == " << member->m_member->m_offset << ");") + LINEF("REQUIRE(offsetof({0}, {1}) == {2});", structure->m_definition->GetFullName(), member->m_member->m_name, member->m_member->m_offset) } } LINE("") - LINE("REQUIRE(" << structure->m_definition->GetSize() << "u == sizeof(" << structure->m_definition->GetFullName() << "));") - LINE("REQUIRE(" << structure->m_definition->GetAlignment() << "u == alignof(" << structure->m_definition->GetFullName() << "));") + LINEF("REQUIRE({0}u == sizeof({1}));", structure->m_definition->GetSize(), structure->m_definition->GetFullName()) + LINEF("REQUIRE({0}u == alignof({1}));", structure->m_definition->GetAlignment(), structure->m_definition->GetFullName()) m_intendation--; LINE("}") } }; } // namespace -std::vector AssetStructTestsTemplate::GetFilesToRender(RenderingContext* context) +std::vector AssetStructTestsTemplate::GetFilesToRender(const RenderingContext& context) { std::vector files; - auto assetName = context->m_asset->m_definition->m_name; - for (auto& c : assetName) - c = static_cast(tolower(c)); + auto assetName = context.m_asset->m_definition->m_name; + utils::MakeStringLowerCase(assetName); - { - std::ostringstream str; - str << assetName << '/' << assetName << "_struct_test.cpp"; - files.emplace_back(str.str(), TAG_SOURCE); - } + files.emplace_back(std::format("{0}/{0}_struct_test.cpp", assetName), TAG_SOURCE); return files; } -void AssetStructTestsTemplate::RenderFile(std::ostream& stream, const int fileTag, RenderingContext* context) +void AssetStructTestsTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) { Template t(stream, context); + assert(fileTag == TAG_SOURCE); if (fileTag == TAG_SOURCE) t.Source(); - else - std::cout << "Invalid tag in AssetStructTestsTemplate\n"; } diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h index 3a0f1879..9713927a 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h @@ -4,6 +4,6 @@ class AssetStructTestsTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(RenderingContext* context) override; - void RenderFile(std::ostream& stream, int fileTag, RenderingContext* context) override; + std::vector GetFilesToRender(const RenderingContext& context) override; + void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp index eb72f0fd..6513a060 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp @@ -5,9 +5,9 @@ #include -BaseTemplate::BaseTemplate(std::ostream& stream, RenderingContext* context) +BaseTemplate::BaseTemplate(std::ostream& stream, const RenderingContext& context) : m_out(stream), - m_env(*context), + m_env(context), m_intendation(0u) { } diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h index c95fd764..5818957d 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h @@ -15,7 +15,7 @@ class BaseTemplate protected: static constexpr auto INTENDATION = " "; - BaseTemplate(std::ostream& stream, RenderingContext* context); + BaseTemplate(std::ostream& stream, const RenderingContext& context); void DoIntendation() const; @@ -41,7 +41,7 @@ protected: static std::string MakeEvaluation(const IEvaluation* evaluation); std::ostream& m_out; - RenderingContext& m_env; + const RenderingContext& m_env; unsigned m_intendation; private: diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp index 97efda87..b43afe2c 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp @@ -16,7 +16,7 @@ namespace class Template final : BaseTemplate { public: - Template(std::ostream& stream, RenderingContext* context) + Template(std::ostream& stream, const RenderingContext& context) : BaseTemplate(stream, context) { } @@ -308,7 +308,7 @@ namespace } } - void PrintLoadPtrArrayMethod_PointerCheck(const DataDefinition* def, StructureInformation* info, const bool reusable) + void PrintLoadPtrArrayMethod_PointerCheck(const DataDefinition* def, const StructureInformation* info, const bool reusable) { LINEF("if (*{0})", MakeTypePtrVarName(def)) LINE("{") @@ -350,7 +350,7 @@ namespace LINE("}") } - void PrintLoadPtrArrayMethod(const DataDefinition* def, StructureInformation* info, const bool reusable) + void PrintLoadPtrArrayMethod(const DataDefinition* def, const StructureInformation* info, const bool reusable) { LINEF("void {0}::LoadPtrArray_{1}(const bool atStreamStart, const size_t count)", LoaderClassName(m_env.m_asset), MakeSafeTypeName(def)) LINE("{") @@ -903,7 +903,7 @@ namespace } } - void LoadMember_ReferenceArray(StructureInformation* info, MemberInformation* member, const DeclarationModifierComputations& modifier) + void LoadMember_ReferenceArray(const StructureInformation* info, const MemberInformation* member, const DeclarationModifierComputations& modifier) { auto first = true; for (const auto& entry : modifier.GetArrayEntries()) @@ -921,7 +921,7 @@ namespace } } - void LoadMember_Reference(StructureInformation* info, MemberInformation* member, const DeclarationModifierComputations& modifier) + void LoadMember_Reference(const StructureInformation* info, const MemberInformation* member, const DeclarationModifierComputations& modifier) { if (modifier.IsDynamicArray()) { @@ -958,7 +958,7 @@ namespace } } - void LoadMember_Condition_Struct(StructureInformation* info, MemberInformation* member) + void LoadMember_Condition_Struct(const StructureInformation* info, const MemberInformation* member) { LINE("") if (member->m_condition) @@ -978,7 +978,7 @@ namespace } } - void LoadMember_Condition_Union(StructureInformation* info, MemberInformation* member) + void LoadMember_Condition_Union(const StructureInformation* info, const MemberInformation* member) { const MemberComputations computations(member); @@ -1046,7 +1046,7 @@ namespace } } - void PrintLoadMemberIfNeedsTreatment(StructureInformation* info, MemberInformation* member) + void PrintLoadMemberIfNeedsTreatment(const StructureInformation* info, const MemberInformation* member) { const MemberComputations computations(member); if (computations.ShouldIgnore()) @@ -1062,7 +1062,7 @@ namespace } } - void PrintLoadMethod(StructureInformation* info) + void PrintLoadMethod(const StructureInformation* info) { const StructureComputations computations(info); LINEF("void {0}::Load_{1}(const bool atStreamStart)", LoaderClassName(m_env.m_asset), info->m_definition->m_name) @@ -1126,7 +1126,7 @@ namespace LINE("}") } - void PrintLoadPtrMethod(StructureInformation* info) + void PrintLoadPtrMethod(const StructureInformation* info) { const bool inTemp = info->m_block && info->m_block->m_type == FastFileBlockType::TEMP; LINEF("void {0}::LoadPtr_{1}(const bool atStreamStart)", LoaderClassName(m_env.m_asset), MakeSafeTypeName(info->m_definition)) @@ -1310,11 +1310,11 @@ namespace }; } // namespace -std::vector ZoneLoadTemplate::GetFilesToRender(RenderingContext* context) +std::vector ZoneLoadTemplate::GetFilesToRender(const RenderingContext& context) { std::vector files; - auto assetName = context->m_asset->m_definition->m_name; + auto assetName = context.m_asset->m_definition->m_name; utils::MakeStringLowerCase(assetName); files.emplace_back(std::format("{0}/{0}_load_db.h", assetName), TAG_HEADER); @@ -1323,7 +1323,7 @@ std::vector ZoneLoadTemplate::GetFilesToRender(RenderingContex return files; } -void ZoneLoadTemplate::RenderFile(std::ostream& stream, const int fileTag, RenderingContext* context) +void ZoneLoadTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) { Template t(stream, context); diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h index c205f328..f44aa382 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h @@ -4,6 +4,6 @@ class ZoneLoadTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(RenderingContext* context) override; - void RenderFile(std::ostream& stream, int fileTag, RenderingContext* context) override; + std::vector GetFilesToRender(const RenderingContext& context) override; + void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp index e16302dc..9c8cabe7 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp @@ -6,7 +6,6 @@ #include "Utils/StringUtils.h" #include -#include #include namespace @@ -17,7 +16,7 @@ namespace class Template final : BaseTemplate { public: - Template(std::ostream& stream, RenderingContext* context) + Template(std::ostream& stream, const RenderingContext& context) : BaseTemplate(stream, context) { } @@ -276,7 +275,7 @@ namespace } } - void PrintMarkPtrArrayMethod_PointerCheck(const DataDefinition* def, StructureInformation* info, const bool reusable) + void PrintMarkPtrArrayMethod_PointerCheck(const DataDefinition* def, const StructureInformation* info) { LINEF("if (*{0})", MakeTypePtrVarName(def)) LINE("{") @@ -295,7 +294,7 @@ namespace LINE("}") } - void PrintMarkPtrArrayMethod(const DataDefinition* def, StructureInformation* info, const bool reusable) + void PrintMarkPtrArrayMethod(const DataDefinition* def, const StructureInformation* info, const bool reusable) { LINEF("void {0}::MarkPtrArray_{1}(const size_t count)", MarkerClassName(m_env.m_asset), MakeSafeTypeName(def)) LINE("{") @@ -310,7 +309,7 @@ namespace m_intendation++; LINEF("{0} = var;", MakeTypePtrVarName(def)) - PrintMarkPtrArrayMethod_PointerCheck(def, info, reusable); + PrintMarkPtrArrayMethod_PointerCheck(def, info); LINE("") LINE("var++;") @@ -531,7 +530,8 @@ namespace } } - static bool MarkMember_ShouldMakePointerCheck(const MemberInformation* member, const DeclarationModifierComputations& modifier, MemberLoadType loadType) + static bool + MarkMember_ShouldMakePointerCheck(const MemberInformation* member, const DeclarationModifierComputations& modifier, const MemberLoadType loadType) { if (loadType != MemberLoadType::ARRAY_POINTER && loadType != MemberLoadType::POINTER_ARRAY && loadType != MemberLoadType::SINGLE_POINTER) { @@ -780,11 +780,11 @@ namespace }; } // namespace -std::vector ZoneMarkTemplate::GetFilesToRender(RenderingContext* context) +std::vector ZoneMarkTemplate::GetFilesToRender(const RenderingContext& context) { std::vector files; - auto assetName = context->m_asset->m_definition->m_name; + auto assetName = context.m_asset->m_definition->m_name; utils::MakeStringLowerCase(assetName); files.emplace_back(std::format("{0}/{0}_mark_db.h", assetName), TAG_HEADER); @@ -793,7 +793,7 @@ std::vector ZoneMarkTemplate::GetFilesToRender(RenderingContex return files; } -void ZoneMarkTemplate::RenderFile(std::ostream& stream, const int fileTag, RenderingContext* context) +void ZoneMarkTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) { Template t(stream, context); diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h index 5583b54e..f430c9d4 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h @@ -4,6 +4,6 @@ class ZoneMarkTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(RenderingContext* context) override; - void RenderFile(std::ostream& stream, int fileTag, RenderingContext* context) override; + std::vector GetFilesToRender(const RenderingContext& context) override; + void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp index a90247dc..e929d611 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp @@ -15,7 +15,7 @@ namespace class Template final : BaseTemplate { public: - Template(std::ostream& stream, RenderingContext* context) + Template(std::ostream& stream, const RenderingContext& context) : BaseTemplate(stream, context) { } @@ -1119,7 +1119,7 @@ namespace LINEF("m_stream->MarkFollowing(*{0});", MakeTypeWrittenPtrVarName(def)) } - void PrintWritePtrArrayMethod_PointerCheck(const DataDefinition* def, StructureInformation* info, const bool reusable) + void PrintWritePtrArrayMethod_PointerCheck(const DataDefinition* def, const StructureInformation* info, const bool reusable) { LINEF("if (*{0})", MakeTypePtrVarName(def)) LINE("{") @@ -1153,7 +1153,7 @@ namespace LINE("}") } - void PrintWritePtrArrayMethod(const DataDefinition* def, StructureInformation* info, const bool reusable) + void PrintWritePtrArrayMethod(const DataDefinition* def, const StructureInformation* info, const bool reusable) { LINEF("void {0}::WritePtrArray_{1}(const bool atStreamStart, const size_t count)", WriterClassName(m_env.m_asset), MakeSafeTypeName(def)) LINE("{") @@ -1228,11 +1228,11 @@ namespace }; } // namespace -std::vector ZoneWriteTemplate::GetFilesToRender(RenderingContext* context) +std::vector ZoneWriteTemplate::GetFilesToRender(const RenderingContext& context) { std::vector files; - auto assetName = context->m_asset->m_definition->m_name; + auto assetName = context.m_asset->m_definition->m_name; for (auto& c : assetName) c = static_cast(tolower(c)); @@ -1242,7 +1242,7 @@ std::vector ZoneWriteTemplate::GetFilesToRender(RenderingConte return files; } -void ZoneWriteTemplate::RenderFile(std::ostream& stream, const int fileTag, RenderingContext* context) +void ZoneWriteTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) { Template t(stream, context); diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h index df072484..e2211212 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h @@ -4,6 +4,6 @@ class ZoneWriteTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(RenderingContext* context) override; - void RenderFile(std::ostream& stream, int fileTag, RenderingContext* context) override; + std::vector GetFilesToRender(const RenderingContext& context) override; + void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; };