xo-alloc2: still more header org-streamlining
This commit is contained in:
parent
cffee6b7cf
commit
1b5067d643
13 changed files with 28 additions and 15 deletions
53
xo-alloc2/include/xo/alloc2/gcobject/AGCObject.hpp
Normal file
53
xo-alloc2/include/xo/alloc2/gcobject/AGCObject.hpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/** @file AGCObject.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Allocator.hpp"
|
||||
#include "xo/facet/facet_implementation.hpp"
|
||||
#include "xo/facet/typeseq.hpp"
|
||||
#include "xo/facet/obj.hpp" // for obj<AAllocator> in shallow_copy
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
|
||||
/** @class AObject
|
||||
* @brief Abstract facet for collector-eligible data
|
||||
*
|
||||
* Data that supports AGCObject can have memory managed
|
||||
* by ACollector
|
||||
**/
|
||||
struct AGCObject {
|
||||
using size_type = std::size_t;
|
||||
|
||||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual int32_t _typeseq() const noexcept = 0;
|
||||
|
||||
virtual size_type shallow_size(Copaque d) const noexcept = 0;
|
||||
virtual Opaque * shallow_copy(Copaque d,
|
||||
obj<AAllocator> mm) const noexcept = 0;
|
||||
virtual size_type forward_children(Opaque d) const noexcept = 0;
|
||||
};
|
||||
|
||||
// implementation IGCObject_DRepr of AGCObject for state DRepr
|
||||
// should provide a specialization:
|
||||
//
|
||||
// template <>
|
||||
// struct xo::facet::FacetImplementation<AGCObjectx, DRepr> {
|
||||
// using ImplType = IGCObject_DRepr;
|
||||
// };
|
||||
//
|
||||
// then IGCObject_ImplType<DRepr> --> IGCObject_DRepr
|
||||
//
|
||||
template <typename DRepr>
|
||||
using IGCObject_ImplType = xo::facet::FacetImplType<AGCObject, DRepr>;
|
||||
} /*namespace mm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end AGCObject.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue