/** @file DMockCollector.hpp * * @author Roland Conybeare, Apr 2026 **/ #pragma once #include #include namespace xo { namespace mm { /** @brief Mock Collector * * Intended to help unit test a GCObjectSotre instance. * Mock a Collector in collection phase for generations 0 <= g < @ref upto_. **/ class DMockCollector { public: explicit DMockCollector(GCObjectStore * gcos, Generation upto) : p_gco_store_{gcos}, upto_{upto} {} template obj ref() { return obj(this); } Generation generation_of(Role r, const void * addr) const noexcept; AllocInfo alloc_info(void * mem) const noexcept; void visit_child(VisitReason reason, AGCObject * lhs_iface, void ** lhs_data); std::byte * alloc_copy(void * src) noexcept; private: GCObjectStore * p_gco_store_ = nullptr; Generation upto_; }; } /*namespace mm*/ } /*namespaace xo*/ /* end DMockCollector.hpp */