#include "StepLoadZoneContent.h" #include "Zone/Stream/ZoneInputStream.h" namespace { class StepLoadZoneContent final : public ILoadingStep { public: StepLoadZoneContent(std::function(ZoneInputStream&)> entryPointFactory, const unsigned pointerBitCount, const unsigned offsetBlockBitCount, const block_t insertBlock, MemoryManager& memory) : m_entry_point_factory(std::move(entryPointFactory)), m_pointer_bit_count(pointerBitCount), m_offset_block_bit_count(offsetBlockBitCount), m_insert_block(insertBlock), m_memory(memory) { } void PerformStep(ZoneLoader& zoneLoader, ILoadingStream& stream) override { const auto inputStream = ZoneInputStream::Create(m_pointer_bit_count, m_offset_block_bit_count, zoneLoader.m_blocks, m_insert_block, stream, m_memory); const auto entryPoint = m_entry_point_factory(*inputStream); assert(entryPoint); entryPoint->Load(); } private: std::function(ZoneInputStream&)> m_entry_point_factory; unsigned m_pointer_bit_count; unsigned m_offset_block_bit_count; block_t m_insert_block; MemoryManager& m_memory; }; } // namespace namespace step { std::unique_ptr CreateStepLoadZoneContent(std::function(ZoneInputStream&)> entryPointFactory, const unsigned pointerBitCount, const unsigned offsetBlockBitCount, const block_t insertBlock, MemoryManager& memory) { return std::make_unique(std::move(entryPointFactory), pointerBitCount, offsetBlockBitCount, insertBlock, memory); } } // namespace step