diff --git a/xo-alloc2/idl/GCObject.json5 b/xo-alloc2/idl/GCObject.json5 new file mode 100644 index 00000000..e826af21 --- /dev/null +++ b/xo-alloc2/idl/GCObject.json5 @@ -0,0 +1,59 @@ +{ + mode: "facet", + includes: [], + namespace1: "xo", + namespace2: "scm", + facet: "GCObject", + detail_subdir: "detail", + brief: "xxx", + using_doxygen: true, + doc: [ + "GC hooks for collector-aware data" + ], + types: [ + // using size_type = std::size_t + { + name: "size_type", + doc: ["type for an amount of memory"], + definition: "std::size_t", + }, + ], + const_methods: [ + // size_type shallow_size() const noexcept + { + name: "shallow_size", + doc: ["memory consumption for this instance"], + return_type: "size_type", + args: [], + const: true, + noexcept: true, + attributes: [], + }, + // Opaque shallow_copy(obj>) const noexcept + { + name: "shallow_copy", + doc: ["copy instance using allocator"], + return_type: "Opaque", + args:[ + {types: "obj", name: "mm"}, + ], + const: true, + noexcept: true, + attributes: [], + }, + ], + nonconst_methods: [ + // size_type forward_children(obj) const noexcept + { + name: "size_type", + doc: ["during GC: forward immdiate children"]. + return_type: "size_type", + args: [ + {types: "obj", name: "gc"}, + ], + const: true, + noexcept: true, + attributes: [], + }, + ], +} \ No newline at end of file diff --git a/xo-facet/codegen/abstract_facet.hpp.j2 b/xo-facet/codegen/abstract_facet.hpp.j2 index 0861b2aa..e1fc17cf 100644 --- a/xo-facet/codegen/abstract_facet.hpp.j2 +++ b/xo-facet/codegen/abstract_facet.hpp.j2 @@ -21,6 +21,10 @@ #include #include +{% for line in facet_pretext %} +{{line}} +{% endfor %} + namespace {{facet_ns1}} { namespace {{facet_ns2}} { @@ -85,4 +89,4 @@ using {{iface_facet_impltype}} = xo::facet::FacetImplType<{{abstract_facet}}, DR } /*namespace {{facet_ns2}}*/ } /*namespace {{facet_ns1}}*/ -/* {{abstract_face_fname}} */ +/* {{abstract_facet_fname}} */ diff --git a/xo-facet/codegen/genfacet b/xo-facet/codegen/genfacet index baea9898..eef2eec1 100755 --- a/xo-facet/codegen/genfacet +++ b/xo-facet/codegen/genfacet @@ -22,7 +22,7 @@ def format_method_qualifiers(method): return ' '.join(quals) def format_method_staticqual(method): - """ Build qualifier string for a static method: noexcet + """ Build qualifier string for a static method: noexcept """ quals = [] if method.get('noexcept', False): @@ -93,6 +93,8 @@ def gen_facet(env, # extra include files (or perhaps other definitions) facet_includes = idl['includes'] + # arbitrary text after includes, before opening namespaces + facet_pretext = idl['pretext'] # detail facet_detail_subdir = idl['detail_subdir'] facet_ns1 = idl['namespace1'] @@ -156,6 +158,7 @@ def gen_facet(env, # 'facet_hpp_j2': 'facet.hpp.j2', 'facet_includes': facet_includes, + 'facet_pretext': facet_pretext, 'facet_ns1': facet_ns1, 'facet_ns2': facet_ns2, 'facet_name_lc': facet_name_lc, diff --git a/xo-facet/codegen/iface_facet_any.cpp.j2 b/xo-facet/codegen/iface_facet_any.cpp.j2 index 0454bb24..6ad2d07e 100644 --- a/xo-facet/codegen/iface_facet_any.cpp.j2 +++ b/xo-facet/codegen/iface_facet_any.cpp.j2 @@ -32,6 +32,17 @@ bool {{iface_facet_any}}::_valid = valid_facet_implementation<{{abstract_facet}}, {{iface_facet_any}}>(); +// nonconst methods + +{% for md in nonconst_methods %} +auto +{{iface_facet_any}}::{{md.name}}({{md.args | argtypes}}) {{md | qualifiers}} -> {{md.return_type}} +{ + _fatal(); +} + +{% endfor %} + } /*namespace {{facet_ns2}}*/ } /*namespace {{facet_ns1}}*/ diff --git a/xo-facet/codegen/iface_facet_any.hpp.j2 b/xo-facet/codegen/iface_facet_any.hpp.j2 index cd8b99c4..87e9d74a 100644 --- a/xo-facet/codegen/iface_facet_any.hpp.j2 +++ b/xo-facet/codegen/iface_facet_any.hpp.j2 @@ -70,7 +70,7 @@ namespace {{facet_ns2}} { // nonconst methods {% for md in nonconst_methods %} - [[noreturn]] {{md.return_type}} {{md.name}}({{md.args | argtypes}}) {{md | qualifiers}} override { _fatal(); } + [[noreturn]] {{md.return_type}} {{md.name}}({{md.args | argtypes}}) {{md | qualifiers}} override; {% endfor %} {% if using_dox %} diff --git a/xo-facet/codegen/router_facet.hpp.j2 b/xo-facet/codegen/router_facet.hpp.j2 index b25d21af..7dba7672 100644 --- a/xo-facet/codegen/router_facet.hpp.j2 +++ b/xo-facet/codegen/router_facet.hpp.j2 @@ -62,8 +62,11 @@ public: {% endfor %} // non-const methods - // << do something for non-const methods >> - // + {% for md in nonconst_methods %} + {{md.return_type}} {{md.name}}({{md.args | argsnodata}}) {{md | staticqual}} { + return O::iface()->{{md.name}}({{md.args | argrouting}}); + } + {% endfor %} {% if using_dox %} ///@} diff --git a/xo-gc/CMakeLists.txt b/xo-gc/CMakeLists.txt index fbe3bab2..2ad70af5 100644 --- a/xo-gc/CMakeLists.txt +++ b/xo-gc/CMakeLists.txt @@ -18,6 +18,18 @@ add_definitions(${PROJECT_CXX_FLAGS}) # ---------------------------------------------------------------- +# note: manual target; generated code committed to git +xo_add_genfacet( + TARGET xo-gc-facet-gcobject + FACET GCObject + INPUT idl/GCObject.json5 + OUTPUT_HPP_DIR include/xo/gc + OUTPUT_IMPL_SUBDIR detail + OUTPUT_CPP_DIR src/gc +) + +# ---------------------------------------------------------------- + # must complete definition of expression lib before configuring examples add_subdirectory(src/gc) add_subdirectory(utest) diff --git a/xo-gc/idl/GCObject.json5 b/xo-gc/idl/GCObject.json5 new file mode 100644 index 00000000..d35916b8 --- /dev/null +++ b/xo-gc/idl/GCObject.json5 @@ -0,0 +1,67 @@ +{ + mode: "facet", + includes: [ + "", + "", + "", + "", + ], + pretext: [ + "namespace xo { namespace mm { struct ACollector; }}", + ], + namespace1: "xo", + namespace2: "mm", + facet: "GCObject", + detail_subdir: "detail", + brief: "xxx", + using_doxygen: true, + doc: [ + "GC hooks for collector-aware data" + ], + types: [ + // using size_type = std::size_t + { + name: "size_type", + doc: ["type for an amount of memory"], + definition: "std::size_t", + }, + ], + const_methods: [ + // size_type shallow_size() const noexcept + { + name: "shallow_size", + doc: ["memory consumption for this instance"], + return_type: "size_type", + args: [], + const: true, + noexcept: true, + attributes: [], + }, + // Opaque shallow_copy(obj>) const noexcept + { + name: "shallow_copy", + doc: ["copy instance using allocator"], + return_type: "Opaque", + args:[ + {type: "obj", name: "mm"}, + ], + const: true, + noexcept: true, + attributes: [], + }, + ], + nonconst_methods: [ + // size_type forward_children(obj) const noexcept + { + name: "forward_children", + doc: ["during GC: forward immdiate children"], + return_type: "size_type", + args: [ + {type: "obj", name: "gc"}, + ], + const: true, + noexcept: true, + attributes: [], + }, + ], +} diff --git a/xo-gc/include/xo/gc/GCObject.hpp b/xo-gc/include/xo/gc/GCObject.hpp index 2674b2ae..ebb6d26f 100644 --- a/xo-gc/include/xo/gc/GCObject.hpp +++ b/xo-gc/include/xo/gc/GCObject.hpp @@ -1,6 +1,14 @@ /** @file GCObject.hpp * - * @author Roland Conybeare, Dec 2025 + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/GCObject.json5] + * 2. jinja2 template for facet .hpp file: + * [facet.hpp.j2] + * 3. idl for facet methods + * [idl/GCObject.json5] **/ #pragma once @@ -10,4 +18,4 @@ #include "detail/IGCObject_Xfer.hpp" #include "detail/RGCObject.hpp" -/* end GCObject.hpp */ +/* end GCObject.hpp */ \ No newline at end of file diff --git a/xo-gc/include/xo/gc/detail/ACollector.hpp b/xo-gc/include/xo/gc/detail/ACollector.hpp index 36b4bffb..0fd031fb 100644 --- a/xo-gc/include/xo/gc/detail/ACollector.hpp +++ b/xo-gc/include/xo/gc/detail/ACollector.hpp @@ -22,8 +22,8 @@ namespace xo { using Copaque = const void *; using Opaque = void *; - struct AGCObject; - struct IGCObject_Any; // see IGCObject_Any.hpp + class AGCObject; + class IGCObject_Any; // see IGCObject_Any.hpp /** @class ACollector * @brief Abstract facet for the XO garbage collector diff --git a/xo-gc/include/xo/gc/detail/AGCObject.hpp b/xo-gc/include/xo/gc/detail/AGCObject.hpp index 7c2ac308..5210dc97 100644 --- a/xo-gc/include/xo/gc/detail/AGCObject.hpp +++ b/xo-gc/include/xo/gc/detail/AGCObject.hpp @@ -1,57 +1,79 @@ /** @file AGCObject.hpp * - * @author Roland Conybeare, Dec 2025 + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/GCObject.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [abstract_facet.hpp.j2] + * 3. idl for facet methods + * [idl/GCObject.json5] **/ #pragma once -#include "Allocator.hpp" -#include "xo/facet/facet_implementation.hpp" -#include "xo/facet/typeseq.hpp" -#include "xo/facet/obj.hpp" // for obj in shallow_copy +// includes (via {facet_includes}) +#include +#include #include #include +#include +#include +#include + +namespace xo { namespace mm { struct ACollector; }} namespace xo { - namespace mm { - using Copaque = const void *; - using Opaque = void *; +namespace mm { - struct ACollector; +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 typeseq = xo::facet::typeseq; - using size_type = std::size_t; +/** +GC hooks for collector-aware data +**/ +class AGCObject { +public: + /** @defgroup mm-gcobject-type-traits **/ + ///@{ + // types + /** integer identifying a type **/ + using typeseq = xo::facet::typeseq; + /** type for an amount of memory **/ + using size_type = std::size_t; + ///@} - /** RTTI: unique id# for actual runtime data representation **/ - virtual typeseq _typeseq() const noexcept = 0; + /** @defgroup mm-gcobject-methods **/ + ///@{ + // const methods + /** RTTI: unique id# for actual runtime data representation **/ + virtual typeseq _typeseq() const noexcept = 0; + /** memory consumption for this instance **/ + virtual size_type shallow_size(Copaque data) const noexcept = 0; + /** copy instance using allocator **/ + virtual Opaque shallow_copy(Copaque data, obj mm) const noexcept = 0; - virtual size_type shallow_size(Copaque d) const noexcept = 0; - virtual Opaque shallow_copy(Copaque d, - obj mm) const noexcept = 0; - virtual size_type forward_children(Opaque d, - obj) const noexcept = 0; - }; + // nonconst methods + /** during GC: forward immdiate children **/ + virtual size_type forward_children(Opaque data, obj gc) const noexcept = 0; + ///@} +}; /*AGCObject*/ - // implementation IGCObject_DRepr of AGCObject for state DRepr - // should provide a specialization: - // - // template <> - // struct xo::facet::FacetImplementation { - // using ImplType = IGCObject_DRepr; - // }; - // - // then IGCObject_ImplType --> IGCObject_DRepr - // - template - using IGCObject_ImplType = xo::facet::FacetImplType; - } /*namespace mm*/ +/** Implementation IGCObject_DRepr of AGCObject for state DRepr + * should provide a specialization: + * + * template <> + * struct xo::facet::FacetImplementation { + * using Impltype = IGCObject_DRepr; + * }; + * + * then IGCObject_ImplType --> IGCObject_DRepr + **/ +template +using IGCObject_ImplType = xo::facet::FacetImplType; + +} /*namespace mm*/ } /*namespace xo*/ -/* end AGCObject.hpp */ +/* AGCObject.hpp */ \ No newline at end of file diff --git a/xo-gc/include/xo/gc/detail/IAllocator_DX1Collector.hpp b/xo-gc/include/xo/gc/detail/IAllocator_DX1Collector.hpp index 0ed1ab1f..424f24ff 100644 --- a/xo-gc/include/xo/gc/detail/IAllocator_DX1Collector.hpp +++ b/xo-gc/include/xo/gc/detail/IAllocator_DX1Collector.hpp @@ -6,6 +6,7 @@ #pragma once #include "Allocator.hpp" +#include "Collector.hpp" #include "DX1Collector.hpp" namespace xo { diff --git a/xo-gc/include/xo/gc/detail/IGCObject_Any.hpp b/xo-gc/include/xo/gc/detail/IGCObject_Any.hpp index 88b19e8b..9f086669 100644 --- a/xo-gc/include/xo/gc/detail/IGCObject_Any.hpp +++ b/xo-gc/include/xo/gc/detail/IGCObject_Any.hpp @@ -1,51 +1,88 @@ /** @file IGCObject_Any.hpp * - * @author Roland Conybeare, Dec 2025 + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/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" -#include "Collector.hpp" -#include +#include + +namespace xo { namespace mm { class IGCObject_Any; } } namespace xo { - namespace mm { struct IGCObject_Any; } +namespace facet { - namespace facet { - template <> - struct FacetImplementation { - using ImplType = xo::mm::IGCObject_Any; - }; - } +template <> +struct FacetImplementation +{ + using ImplType = xo::mm::IGCObject_Any; +}; - namespace mm { - /** @class IGCObject_Any - * @brief AGCObject implementation for empty variant instance - **/ - struct IGCObject_Any : public AGCObject { - using typeseq = xo::facet::typeseq; - using size_type = std::size_t; +} +} - const AGCObject * iface() const { return std::launder(this); } +namespace xo { +namespace mm { - // from AGCObject - typeseq _typeseq() const noexcept override { return s_typeseq; } + /** @class IGCObject_Any + * @brief AGCObject implementation for empty variant instance + **/ + class IGCObject_Any : public AGCObject { + public: + /** @defgroup mm-gcobject-any-type-traits **/ + ///@{ - [[noreturn]] size_type shallow_size(Copaque) const noexcept override { _fatal(); } - [[noreturn]] Opaque shallow_copy(Copaque, - obj) const noexcept override { _fatal(); } - [[noreturn]] size_type forward_children(Opaque, - obj) const noexcept override { _fatal(); } + /** integer identifying a type **/ + using typeseq = xo::facet::typeseq; + using size_type = AGCObject::size_type; - private: - [[noreturn]] static void _fatal(); + ///@} + /** @defgroup mm-gcobject-any-methods **/ + ///@{ - public: - static typeseq s_typeseq; - static bool _valid; - }; - } /*namespace mm*/ -} /*namespace xo*/ + const AGCObject * iface() const { return std::launder(this); } -/* end IGCObject_Any.hpp */ + // from AGCObject + + // const methods + typeseq _typeseq() const noexcept override { return s_typeseq; } + [[noreturn]] size_type shallow_size(Copaque) const noexcept override { _fatal(); } + [[noreturn]] Opaque shallow_copy(Copaque, obj) const noexcept override { _fatal(); } + + // nonconst methods + [[noreturn]] size_type forward_children(Opaque, obj) const noexcept override; + + ///@} + + private: + /** @defgraoup mm-gcobject-any-private-methods **/ + ///@{ + + [[noreturn]] static void _fatal(); + + ///@} + + public: + /** @defgroup mm-gcobject-any-member-vars **/ + ///@{ + + static typeseq s_typeseq; + static bool _valid; + + ///@} + }; + +} /*namespace mm */ +} /*namespace xo */ + +/* IGCObject_Any.hpp */ \ No newline at end of file diff --git a/xo-gc/include/xo/gc/detail/IGCObject_Xfer.hpp b/xo-gc/include/xo/gc/detail/IGCObject_Xfer.hpp index a9deb4ad..2ece6b01 100644 --- a/xo-gc/include/xo/gc/detail/IGCObject_Xfer.hpp +++ b/xo-gc/include/xo/gc/detail/IGCObject_Xfer.hpp @@ -1,64 +1,90 @@ /** @file IGCObject_Xfer.hpp * - * @author Roland Conybeare, Dec 2025 + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/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" -#include "ACollector.hpp" +#include +#include +#include +#include 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; +namespace mm { + /** @class IGCObject_Xfer + **/ + template + class IGCObject_Xfer : public AGCObject { + public: + /** @defgroup mm-gcobject-xfer-type-traits **/ + ///@{ + /** actual implementation (not generated; often delegates to DRepr) **/ + using Impl = IGCObject_DRepr; + /** integer identifying a type **/ + using typeseq = AGCObject::typeseq; + using size_type = AGCObject::size_type; + ///@} - static const DRepr & _dcast(Copaque d) { return *(const DRepr *)d; } - static DRepr & _dcast(Opaque d) { return *(DRepr *)d; } + /** @defgroup mm-gcobject-xfer-methods **/ + ///@{ - // from AGCObject + static const DRepr & _dcast(Copaque d) { return *(const DRepr *)d; } + static DRepr & _dcast(Opaque d) { return *(DRepr *)d; } - // const methods + // from AGCObject - typeseq _typeseq() const noexcept override { return s_typeseq; } - size_type shallow_size(Copaque d) const noexcept override { - return I::shallow_size(_dcast(d)); - } - Opaque shallow_copy(Copaque d, obj mm) const noexcept override { - return I::shallow_copy(_dcast(d), mm); - } + // const methods + typeseq _typeseq() const noexcept override { return s_typeseq; } + size_type shallow_size(Copaque data) const noexcept override { + return I::shallow_size(_dcast(data)); + } + Opaque shallow_copy(Copaque data, obj mm) const noexcept override { + return I::shallow_copy(_dcast(data), mm); + } - // non-const methods + // non-const methods + size_type forward_children(Opaque data, obj gc) const noexcept override { + return I::forward_children(_dcast(data), gc); + } - size_type forward_children(Opaque d, - obj gc) const noexcept override { - return I::forward_children(_dcast(d), gc); - } + ///@} - private: - using I = Impl; + private: + using I = Impl; - public: - static typeseq s_typeseq; - static bool _valid; - }; + public: + /** @defgroup mm-gcobject-xfer-member-vars **/ + ///@{ - template - xo::facet::typeseq - IGCObject_Xfer::s_typeseq = facet::typeseq::id(); + /** typeseq for template parameter DRepr **/ + static typeseq s_typeseq; + /** true iff satisfies facet implementation **/ + static bool _valid; - template - bool - IGCObject_Xfer::_valid = facet::valid_facet_implementation(); + ///@} + }; - } /*namespace mm*/ + template + xo::facet::typeseq + IGCObject_Xfer::s_typeseq + = xo::facet::typeseq::id(); + + template + bool + IGCObject_Xfer::_valid + = xo::facet::valid_facet_implementation(); + +} /*namespace mm */ } /*namespace xo*/ -/* end IGCObject_Xfer.hpp */ +/* end IGCObject_Xfer.hpp */ \ No newline at end of file diff --git a/xo-gc/include/xo/gc/detail/RGCObject.hpp b/xo-gc/include/xo/gc/detail/RGCObject.hpp index 4c3205b0..ace699c5 100644 --- a/xo-gc/include/xo/gc/detail/RGCObject.hpp +++ b/xo-gc/include/xo/gc/detail/RGCObject.hpp @@ -1,48 +1,83 @@ /** @file RGCObject.hpp * - * @author Roland Conybeare, Dec 2025 + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/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" -#include namespace xo { - namespace mm { - /** @class RGCObject **/ - template - struct RGCObject : public Object { - private: - using O = Object; - public: - using ObjectType = Object; - using DataPtr = Object::DataPtr; - using typeseq = xo::facet::typeseq; - using size_type = std::size_t; +namespace mm { - RGCObject() = default; - RGCObject(Object::DataPtr data) : Object{std::move(data)} {} +/** @class RGCObject + **/ +template +class RGCObject : public Object { +private: + using O = Object; - typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); } - size_type shallow_size() const noexcept { O::iface()->shallow_size(O::data()); } - Opaque shallow_copy(obj mm) const noexcept { O::iface()->shallow_copy(O::data(), mm); } - size_type forward_children() noexcept { O::iface()->forward_children(O::data()); } +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; + ///@} - static bool _valid; - }; + /** @defgroup mm-gcobject-router-ctors **/ + ///@{ + RGCObject() {} + RGCObject(Object::DataPtr data) : Object{std::move(data)} {} - template - bool - RGCObject::_valid = facet::valid_object_router(); - } /*namespace mm*/ + ///@} + /** @defgroup mm-gcobject-router-methods **/ + ///@{ - namespace facet { - template - struct RoutingFor { - using RoutingType = xo::mm::RGCObject; - }; + // 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 mm) const noexcept { + return O::iface()->shallow_copy(O::data(), mm); + } + + // non-const methods + size_type forward_children(obj gc) noexcept { + return O::iface()->forward_children(O::data(), gc); + } + + ///@} + /** @defgroup mm-gcobject-member-vars **/ + ///@{ + + static bool _valid; + + ///@} +}; + +template +bool +RGCObject::_valid = xo::facet::valid_object_router(); + +} /*namespace mm*/ } /*namespace xo*/ -/* end RGCObject.hpp */ +namespace xo { namespace facet { + template + struct RoutingFor { + using RoutingType = xo::mm::RGCObject; + }; +} } + +/* end RGCObject.hpp */ \ No newline at end of file diff --git a/xo-gc/src/gc/DX1CollectorIterator.cpp b/xo-gc/src/gc/DX1CollectorIterator.cpp index 3942468b..7980d319 100644 --- a/xo-gc/src/gc/DX1CollectorIterator.cpp +++ b/xo-gc/src/gc/DX1CollectorIterator.cpp @@ -3,6 +3,7 @@ * @author Roland Conybeare, Dec 2025 **/ +#include "Collector.hpp" #include "xo/gc/DX1CollectorIterator.hpp" #include "xo/gc/DX1Collector.hpp" #include diff --git a/xo-gc/src/gc/IAllocator_DX1Collector.cpp b/xo-gc/src/gc/IAllocator_DX1Collector.cpp index 6c4dc5bf..58e89941 100644 --- a/xo-gc/src/gc/IAllocator_DX1Collector.cpp +++ b/xo-gc/src/gc/IAllocator_DX1Collector.cpp @@ -5,6 +5,7 @@ * See also ICollector_DX1Collector.cpp for collector facet **/ +#include "Collector.hpp" // for obj argument to GCObject.forward_children() #include "detail/IAllocator_DX1Collector.hpp" #include "detail/IAllocIterator_DX1CollectorIterator.hpp" #include "DX1CollectorIterator.hpp" diff --git a/xo-gc/src/gc/IGCObject_Any.cpp b/xo-gc/src/gc/IGCObject_Any.cpp index f39445c8..ff6d395d 100644 --- a/xo-gc/src/gc/IGCObject_Any.cpp +++ b/xo-gc/src/gc/IGCObject_Any.cpp @@ -1,34 +1,47 @@ /** @file IGCObject_Any.cpp * - * @author Roland Conybeare, Dec 2025 **/ #include "detail/IGCObject_Any.hpp" #include namespace xo { - using xo::facet::DVariantPlaceholder; - using xo::facet::typeseq; - using xo::facet::valid_facet_implementation; +namespace mm { - namespace mm { +using xo::facet::DVariantPlaceholder; +using xo::facet::typeseq; +using xo::facet::valid_facet_implementation; - void - IGCObject_Any::_fatal() { - std::cerr << "fatal" - << ": attempt to call uninitialized" - << " IGCObject_Any method" - << std::endl; - std::terminate(); - } +void +IGCObject_Any::_fatal() +{ + /* control here on uninitialized IAllocator_Any. + * Initialized instance will have specific implementation type + */ + std::cerr << "fatal" + << ": attempt to call uninitialized" + << " IGCObject_Any method" + << std::endl; + std::terminate(); +} - typeseq - IGCObject_Any::s_typeseq = typeseq::id(); +typeseq +IGCObject_Any::s_typeseq = typeseq::id(); - bool - IGCObject_Any::_valid = valid_facet_implementation(); +bool +IGCObject_Any::_valid + = valid_facet_implementation(); - } /*namespace mm*/ +// nonconst methods + +auto +IGCObject_Any::forward_children(Opaque, obj) const noexcept -> size_type +{ + _fatal(); +} + + +} /*namespace mm*/ } /*namespace xo*/ -/* end IGCObject_Any.cpp */ +/* end IGCObject_Any.cpp */ \ No newline at end of file