/** @file IGCObject_Xfer.hpp * * @author Roland Conybeare, Dec 2025 **/ #pragma once #include "AGCObject.hpp" namespace xo { namespace mm { /** @class IGCObject_Xfer * * Adapts typed GC object implementation @tparam IGCObject_DRepr * to type-erased @ref AGCObject interface **/ template struct IGCObject_Xfer : public AGCObject { using Impl = IGCObject_DRepr; using size_type = AGCObject::size_type; static const DRepr & _dcast(Copaque d) { return *(const DRepr *)d; } static DRepr & _dcast(Opaque d) { return *(DRepr *)d; } // from AGCObject // const methods int32_t _typeseq() const noexcept override { return s_typeseq; } size_type shallow_size(Copaque d) const noexcept override { return I::shallow_copy(_dcast(d)); } Opaque * shallow_copy(Copaque d, obj mm) const noexcept override { return I::shallow_size(_dcast(d), mm); } // non-const methods size_type forward_children(Opaque d) const noexcept override { return I::forward_children(d); } private: using I = Impl; public: static int32_t s_typeseq; static bool _valid; }; template int32_t IGCObject_Xfer::s_typeseq = facet::typeseq::id(); template bool IGCObject_Xfer::_valid = facet::valid_facet_implementation(); } /*namespace mm*/ } /*namespace xo*/ /* end IGCObject_Xfer.hpp */