xo-object2: tidy IGCObject_DList

This commit is contained in:
Roland Conybeare 2026-01-15 00:32:50 -05:00
commit 503fd41c78
12 changed files with 159 additions and 89 deletions

View file

@ -5,9 +5,11 @@
#include "DList.hpp"
#include "list/IPrintable_DList.hpp"
#include "list/IGCObject_DList.hpp"
#include <xo/gc/GCObject.hpp>
#include <xo/printable2/Printable.hpp>
#include <xo/facet/FacetRegistry.hpp>
#include <xo/facet/facet_implementation.hpp>
#include <xo/indentlog/print/pretty.hpp>
#include <xo/indentlog/print/tag.hpp>
@ -145,6 +147,36 @@ namespace xo {
return false;
}
}
auto
DList::shallow_size() const noexcept -> size_type
{
return sizeof(DList);
}
DList *
DList::shallow_copy(obj<AAllocator> mm) const noexcept
{
DList * copy = (DList *)mm.alloc_copy((std::byte *)this);
if (copy)
*copy = *this;
return copy;
}
auto
DList::forward_children(obj<ACollector> gc) noexcept -> size_type
{
scope log(XO_DEBUG(true));
gc.forward_inplace(head_.iface(), (void **)&(head_.data_));
auto iface = xo::facet::impl_for<AGCObject,DList>();
gc.forward_inplace(&iface, (void **)(&rest_));
return shallow_size();
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -1,53 +1,39 @@
/** @file IGCObject_DList.cpp
*
* @author Roland Conybeare, Dec 2025
**/
* Generated automagically from ingredients:
* 1. code generator:
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IGCObject_DList.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObject_DList.json5]
**/
#include "IGCObject_DList.hpp"
#include "DList.hpp"
#include <xo/indentlog/scope.hpp>
#include "list/IGCObject_DList.hpp"
namespace xo {
using xo::mm::AGCObject;
using xo::mm::AAllocator;
//using xo::facet::with_facet;
using xo::facet::obj;
using xo::facet::typeseq;
using std::size_t;
namespace scm {
size_t
IGCObject_DList::shallow_size(const DList &) noexcept
auto
IGCObject_DList::shallow_size(const DList & self) noexcept -> size_type
{
return sizeof(DList);
return self.shallow_size();
}
DList *
IGCObject_DList::shallow_copy(const DList & src,
obj<AAllocator> mm) noexcept
auto
IGCObject_DList::shallow_copy(const DList & self, obj<AAllocator> mm) noexcept -> Opaque
{
DList * copy = (DList *)mm.alloc_copy((std::byte *)&src);
if (copy)
*copy = src;
return copy;
return self.shallow_copy(mm);
}
size_t
IGCObject_DList::forward_children(DList & src,
obj<ACollector> gc) noexcept
auto
IGCObject_DList::forward_children(DList & self, obj<ACollector> gc) noexcept -> size_type
{
scope log(XO_DEBUG(true));
gc.forward_inplace(src.head_.iface(), (void **)&(src.head_.data_));
auto iface = xo::facet::impl_for<AGCObject, DList>();
gc.forward_inplace(&iface, (void **)(&src.rest_));
return shallow_size(src);
return self.forward_children(gc);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IGCObject_DList.cpp */
/* end IGCObject_DList.cpp */

View file

@ -5,7 +5,7 @@
#include "object2_register_facets.hpp"
#include <xo/object2/IGCObject_DList.hpp>
#include <xo/object2/list/IGCObject_DList.hpp>
#include <xo/object2/IGCObject_DFloat.hpp>
#include <xo/object2/IGCObject_DInteger.hpp>
#include <xo/object2/string/IGCObject_DString.hpp>

View file

@ -5,7 +5,7 @@
#include "object2_register_types.hpp"
#include "IGCObject_DList.hpp"
#include "list/IGCObject_DList.hpp"
#include "IGCObject_DFloat.hpp"
#include "IGCObject_DInteger.hpp"
#include "string/IGCObject_DString.hpp"