diff --git a/include/xo/procedure2/DPrimitive.hpp b/include/xo/procedure2/DPrimitive.hpp index 6463ccd..f0e1b5e 100644 --- a/include/xo/procedure2/DPrimitive.hpp +++ b/include/xo/procedure2/DPrimitive.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -76,8 +77,9 @@ namespace xo { using Traits = detail::PmFnTraits; using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using DArray = xo::scm::DArray; using Reflect = xo::reflect::Reflect; using TypeDescr = xo::reflect::TypeDescr; @@ -134,7 +136,7 @@ namespace xo { /** @defgroup scm-primitive-gcobject-facet **/ ///@{ Primitive * shallow_move(obj gc) noexcept; - void forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} private: @@ -197,11 +199,12 @@ namespace xo { template void - Primitive::forward_children(obj gc) noexcept { - { - auto e = type_.to_facet(); // FacetRegistry dep - gc.forward_inplace(e.iface(), (void **)&(type_.data_)); - } + Primitive::visit_gco_children(obj gc) noexcept { + gc.visit_poly_child(&type_); + //{ + // auto e = type_.to_facet(); // FacetRegistry dep + // gc.forward_inplace(e.iface(), (void **)&(type_.data_)); + //} } } /*namespace scm*/ diff --git a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_0.hpp b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_0.hpp index a8b25c9..9d4d338 100644 --- a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_0.hpp +++ b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_0.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DPrimitive_gco_0 & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DPrimitive_gco_0 & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DPrimitive_gco_0 & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_1_gco.hpp b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_1_gco.hpp index 89c13e3..6b3e999 100644 --- a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_1_gco.hpp +++ b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_1_gco.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DPrimitive_gco_1_gco & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DPrimitive_gco_1_gco & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DPrimitive_gco_1_gco & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_dict_string.hpp b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_dict_string.hpp index 24dc877..d54fc0b 100644 --- a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_dict_string.hpp +++ b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_dict_string.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DPrimitive_gco_2_dict_string & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DPrimitive_gco_2_dict_string & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DPrimitive_gco_2_dict_string & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_gco_gco.hpp b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_gco_gco.hpp index 51db4ff..eba3197 100644 --- a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_gco_gco.hpp +++ b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_2_gco_gco.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DPrimitive_gco_2_gco_gco & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DPrimitive_gco_2_gco_gco & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DPrimitive_gco_2_gco_gco & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_3_dict_string_gco.hpp b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_3_dict_string_gco.hpp index 81e0b41..09f9c35 100644 --- a/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_3_dict_string_gco.hpp +++ b/include/xo/procedure2/detail/IGCObject_DPrimitive_gco_3_dict_string_gco.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DPrimitive_gco_3_dict_string_gco & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DPrimitive_gco_3_dict_string_gco & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DPrimitive_gco_3_dict_string_gco & self, obj fn) noexcept; ///@} }; diff --git a/src/procedure2/facet/IGCObject_DPrimitive_gco_0.cpp b/src/procedure2/facet/IGCObject_DPrimitive_gco_0.cpp index 24a68f6..0819f51 100644 --- a/src/procedure2/facet/IGCObject_DPrimitive_gco_0.cpp +++ b/src/procedure2/facet/IGCObject_DPrimitive_gco_0.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DPrimitive_gco_0::forward_children(DPrimitive_gco_0 & self, obj gc) noexcept -> void + IGCObject_DPrimitive_gco_0::visit_gco_children(DPrimitive_gco_0 & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/procedure2/facet/IGCObject_DPrimitive_gco_1_gco.cpp b/src/procedure2/facet/IGCObject_DPrimitive_gco_1_gco.cpp index 9d411bf..7561d16 100644 --- a/src/procedure2/facet/IGCObject_DPrimitive_gco_1_gco.cpp +++ b/src/procedure2/facet/IGCObject_DPrimitive_gco_1_gco.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DPrimitive_gco_1_gco::forward_children(DPrimitive_gco_1_gco & self, obj gc) noexcept -> void + IGCObject_DPrimitive_gco_1_gco::visit_gco_children(DPrimitive_gco_1_gco & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/procedure2/facet/IGCObject_DPrimitive_gco_2_dict_string.cpp b/src/procedure2/facet/IGCObject_DPrimitive_gco_2_dict_string.cpp index 32c4377..522cba9 100644 --- a/src/procedure2/facet/IGCObject_DPrimitive_gco_2_dict_string.cpp +++ b/src/procedure2/facet/IGCObject_DPrimitive_gco_2_dict_string.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DPrimitive_gco_2_dict_string::forward_children(DPrimitive_gco_2_dict_string & self, obj gc) noexcept -> void + IGCObject_DPrimitive_gco_2_dict_string::visit_gco_children(DPrimitive_gco_2_dict_string & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/procedure2/facet/IGCObject_DPrimitive_gco_2_gco_gco.cpp b/src/procedure2/facet/IGCObject_DPrimitive_gco_2_gco_gco.cpp index 281c426..6f7de39 100644 --- a/src/procedure2/facet/IGCObject_DPrimitive_gco_2_gco_gco.cpp +++ b/src/procedure2/facet/IGCObject_DPrimitive_gco_2_gco_gco.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DPrimitive_gco_2_gco_gco::forward_children(DPrimitive_gco_2_gco_gco & self, obj gc) noexcept -> void + IGCObject_DPrimitive_gco_2_gco_gco::visit_gco_children(DPrimitive_gco_2_gco_gco & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/procedure2/facet/IGCObject_DPrimitive_gco_3_dict_string_gco.cpp b/src/procedure2/facet/IGCObject_DPrimitive_gco_3_dict_string_gco.cpp index b15cc56..aa6c85c 100644 --- a/src/procedure2/facet/IGCObject_DPrimitive_gco_3_dict_string_gco.cpp +++ b/src/procedure2/facet/IGCObject_DPrimitive_gco_3_dict_string_gco.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DPrimitive_gco_3_dict_string_gco::forward_children(DPrimitive_gco_3_dict_string_gco & self, obj gc) noexcept -> void + IGCObject_DPrimitive_gco_3_dict_string_gco::visit_gco_children(DPrimitive_gco_3_dict_string_gco & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/