xo-alloc/xo-gc/include/xo/gc/detail/RGCObject.hpp

85 lines
No EOL
2 KiB
C++

/** @file RGCObject.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* arguments:
* --input [idl/GCObject.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/GCObject.json5]
**/
#pragma once
#include "AGCObject.hpp"
namespace xo {
namespace mm {
/** @class RGCObject
**/
template <typename Object>
class RGCObject : public Object {
private:
using O = Object;
public:
/** @defgroup mm-gcobject-router-type-traits **/
///@{
using ObjectType = Object;
using DataPtr = Object::DataPtr;
using typeseq = xo::reflect::typeseq;
using size_type = AGCObject::size_type;
using AAllocator = AGCObject::AAllocator;
using ACollector = AGCObject::ACollector;
///@}
/** @defgroup mm-gcobject-router-ctors **/
///@{
RGCObject() {}
RGCObject(Object::DataPtr data) : Object{std::move(data)} {}
///@}
/** @defgroup mm-gcobject-router-methods **/
///@{
// const methods
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
size_type shallow_size() const noexcept {
return O::iface()->shallow_size(O::data());
}
Opaque shallow_copy(obj<AAllocator> mm) const noexcept {
return O::iface()->shallow_copy(O::data(), mm);
}
// non-const methods
size_type forward_children(obj<ACollector> gc) noexcept {
return O::iface()->forward_children(O::data(), gc);
}
///@}
/** @defgroup mm-gcobject-member-vars **/
///@{
static bool _valid;
///@}
};
template <typename Object>
bool
RGCObject<Object>::_valid = xo::facet::valid_object_router<Object>();
} /*namespace mm*/
} /*namespace xo*/
namespace xo { namespace facet {
template <typename Object>
struct RoutingFor<xo::mm::AGCObject, Object> {
using RoutingType = xo::mm::RGCObject<Object>;
};
} }
/* end RGCObject.hpp */