xo-object2: streamline GCObject_DFloat + codegen

This commit is contained in:
Roland Conybeare 2026-01-15 00:46:39 -05:00
commit 9244302cc1
10 changed files with 152 additions and 78 deletions

View file

@ -9,6 +9,7 @@
namespace xo {
using xo::facet::typeseq;
using xo::print::ppdetail_atomic;
using std::size_t;
namespace scm {
DFloat *
@ -25,6 +26,30 @@ namespace xo {
{
return ppdetail_atomic<double>::print_pretty(ppii, value_);
}
size_t
DFloat::shallow_size() const noexcept
{
return sizeof(DFloat);
}
DFloat *
DFloat::shallow_copy(obj<AAllocator> mm) const noexcept
{
DFloat * copy = (DFloat *)mm.alloc_copy((std::byte *)this);
if (copy)
*copy = *this;
return copy;
}
size_t
DFloat::forward_children(obj<ACollector>) noexcept
{
return shallow_size();
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -1,46 +1,39 @@
/** @file IGCObject_DFloat.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_DFloat.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObject_DFloat.json5]
**/
#include "IGCObject_DFloat.hpp"
#include "xo/alloc2/alloc/AAllocator.hpp"
#include "xo/facet/obj.hpp"
#include <cstddef>
#include "number/IGCObject_DFloat.hpp"
namespace xo {
using xo::mm::AAllocator;
using xo::facet::obj;
using xo::facet::typeseq;
using std::size_t;
namespace scm {
size_t
IGCObject_DFloat::shallow_size(const DFloat &) noexcept
auto
IGCObject_DFloat::shallow_size(const DFloat & self) noexcept -> size_type
{
return sizeof(DFloat);
return self.shallow_size();
}
DFloat *
IGCObject_DFloat::shallow_copy(const DFloat & src,
obj<AAllocator> mm) noexcept
auto
IGCObject_DFloat::shallow_copy(const DFloat & self, obj<AAllocator> mm) noexcept -> Opaque
{
DFloat * copy = (DFloat *)mm.alloc_copy((std::byte *)&src);
if (copy)
*copy = src;
return copy;
return self.shallow_copy(mm);
}
size_t
IGCObject_DFloat::forward_children(DFloat & src,
obj<ACollector>) noexcept
auto
IGCObject_DFloat::forward_children(DFloat & self, obj<ACollector> gc) noexcept -> size_type
{
return shallow_size(src);
return self.forward_children(gc);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IGCObject_DFloat.cpp */
/* end IGCObject_DFloat.cpp */

View file

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

View file

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