// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "dnacalib/TypeDefs.h" #include "dnacalib/types/Aliases.h" namespace dnac { template class CommandImplBase { protected: explicit CommandImplBase(MemoryResource* memRes_) : memRes{memRes_} { } public: static TCommand* create(MemoryResource* memRes) { PolyAllocator alloc{memRes}; return alloc.newObject(memRes); } static void destroy(TCommand* instance) { PolyAllocator alloc{instance->getMemoryResource()}; alloc.deleteObject(instance); } MemoryResource* getMemoryResource() { return memRes; } private: MemoryResource* memRes; }; } // namespace dnac