From 19d53585fb72d18da8e3a23a1fe67f32752b4ef0 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 26 Jan 2026 16:51:23 -0500 Subject: [PATCH] xo-procedure2: add DSimpleRcx w/ IRuntimeContext facet --- xo-procedure2/CMakeLists.txt | 15 ++++- .../idl/IRuntimeContext_DSimpleRcx.json5 | 15 +++++ .../include/xo/procedure2/DSimpleRcx.hpp | 32 ++++++++++ .../detail/IRuntimeContext_DSimpleRcx.hpp | 59 +++++++++++++++++++ xo-procedure2/src/procedure2/CMakeLists.txt | 3 +- .../procedure2/IRuntimeContext_DSimpleRcx.cpp | 28 +++++++++ 6 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 xo-procedure2/idl/IRuntimeContext_DSimpleRcx.json5 create mode 100644 xo-procedure2/include/xo/procedure2/DSimpleRcx.hpp create mode 100644 xo-procedure2/include/xo/procedure2/detail/IRuntimeContext_DSimpleRcx.hpp create mode 100644 xo-procedure2/src/procedure2/IRuntimeContext_DSimpleRcx.cpp diff --git a/xo-procedure2/CMakeLists.txt b/xo-procedure2/CMakeLists.txt index be7909a5..929c48bc 100644 --- a/xo-procedure2/CMakeLists.txt +++ b/xo-procedure2/CMakeLists.txt @@ -43,7 +43,20 @@ xo_add_genfacet( # ---------------------------------------------------------------- xo_add_genfacetimpl( - TARGET xo-procedure2-facetimpl-procedure2-primitive_gco_2_gco_gco + TARGET xo-procedure2-facetimpl-runtimecontext-simplercx + FACET_PKG xo_procedure2 + FACET RuntimeContext + REPR DSimpleRcx + INPUT idl/IRuntimeContext_DSimpleRcx.json5 + OUTPUT_HPP_DIR include/xo/procedure2 + OUTPUT_IMPL_SUBDIR detail + OUTPUT_CPP_DIR src/procedure2 + ) + +# ---------------------------------------------------------------- + +xo_add_genfacetimpl( + TARGET xo-procedure2-facetimpl-procedure-primitive_gco_2_gco_gco FACET_PKG xo_procedure2 FACET Procedure REPR DPrimitive_gco_2_gco_gco diff --git a/xo-procedure2/idl/IRuntimeContext_DSimpleRcx.json5 b/xo-procedure2/idl/IRuntimeContext_DSimpleRcx.json5 new file mode 100644 index 00000000..ed838629 --- /dev/null +++ b/xo-procedure2/idl/IRuntimeContext_DSimpleRcx.json5 @@ -0,0 +1,15 @@ +{ + mode: "implementation", + includes: [ + //"", + //"", + ], + local_types: [ ], + namespace1: "xo", + namespace2: "scm", + facet_idl: "idl/RuntimeContext.json5", + brief: "provide ARuntimeContext interface for DSimpleRcx", + using_doxygen: true, + repr: "DSimpleRcx", + doc: [ "implement ARuntimeContext for DSimpleRcx" ], +} diff --git a/xo-procedure2/include/xo/procedure2/DSimpleRcx.hpp b/xo-procedure2/include/xo/procedure2/DSimpleRcx.hpp new file mode 100644 index 00000000..d5060bb9 --- /dev/null +++ b/xo-procedure2/include/xo/procedure2/DSimpleRcx.hpp @@ -0,0 +1,32 @@ +/** @file DSimpleRcx.hpp + * + * @author Roland Conybeare, Jan 2026 + **/ + +#include + +namespace xo { + namespace scm { + + /** @brief Minimal runtime context. + * + * Minimal runtime context provides an allocator, + * and nothing more. + **/ + class DSimpleRcx { + public: + using AAllocator = xo::mm::AAllocator; + + public: + DSimpleRcx(obj mm) : allocator_{mm} {} + + obj allocator() const noexcept { return allocator_; } + + private: + obj allocator_; + }; + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end DSimpleRcx.hpp */ diff --git a/xo-procedure2/include/xo/procedure2/detail/IRuntimeContext_DSimpleRcx.hpp b/xo-procedure2/include/xo/procedure2/detail/IRuntimeContext_DSimpleRcx.hpp new file mode 100644 index 00000000..06f14bc5 --- /dev/null +++ b/xo-procedure2/include/xo/procedure2/detail/IRuntimeContext_DSimpleRcx.hpp @@ -0,0 +1,59 @@ +/** @file IRuntimeContext_DSimpleRcx.hpp + * + * Generated automagically from ingredients: + * 1. code generator: + * [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/IRuntimeContext_DSimpleRcx.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [iface_facet_repr.hpp.j2] + * 3. idl for facet methods + * [idl/IRuntimeContext_DSimpleRcx.json5] + **/ + +#pragma once + +#include "RuntimeContext.hpp" +#include "DSimpleRcx.hpp" + +namespace xo { namespace scm { class IRuntimeContext_DSimpleRcx; } } + +namespace xo { + namespace facet { + template <> + struct FacetImplementation + { + using ImplType = xo::scm::IRuntimeContext_Xfer + ; + }; + } +} + +namespace xo { + namespace scm { + /** @class IRuntimeContext_DSimpleRcx + **/ + class IRuntimeContext_DSimpleRcx { + public: + /** @defgroup scm-runtimecontext-dsimplercx-type-traits **/ + ///@{ + using AAllocator = xo::scm::ARuntimeContext::AAllocator; + using Copaque = xo::scm::ARuntimeContext::Copaque; + using Opaque = xo::scm::ARuntimeContext::Opaque; + ///@} + /** @defgroup scm-runtimecontext-dsimplercx-methods **/ + ///@{ + // const methods + /** default allocator to use for objects **/ + static obj allocator(const DSimpleRcx & self) noexcept; + + // non-const methods + ///@} + }; + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end */ \ No newline at end of file diff --git a/xo-procedure2/src/procedure2/CMakeLists.txt b/xo-procedure2/src/procedure2/CMakeLists.txt index d1699eb0..8ecbc329 100644 --- a/xo-procedure2/src/procedure2/CMakeLists.txt +++ b/xo-procedure2/src/procedure2/CMakeLists.txt @@ -6,9 +6,10 @@ set(SELF_SRCS init_primitives.cpp procedure2_register_types.cpp procedure2_register_facets.cpp - DPrimitive.cpp IRuntimeContext_Any.cpp + IRuntimeContext_DSimpleRcx.cpp IProcedure_Any.cpp + DPrimitive.cpp IGCObject_DPrimitive_gco_2_gco_gco.cpp IProcedure_DPrimitive_gco_2_gco_gco.cpp # Add source files here, e.g.: diff --git a/xo-procedure2/src/procedure2/IRuntimeContext_DSimpleRcx.cpp b/xo-procedure2/src/procedure2/IRuntimeContext_DSimpleRcx.cpp new file mode 100644 index 00000000..4ec8378b --- /dev/null +++ b/xo-procedure2/src/procedure2/IRuntimeContext_DSimpleRcx.cpp @@ -0,0 +1,28 @@ +/** @file IRuntimeContext_DSimpleRcx.cpp + * + * Generated automagically from ingredients: + * 1. code generator: + * [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/IRuntimeContext_DSimpleRcx.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [iface_facet_any.hpp.j2] + * 3. idl for facet methods + * [idl/IRuntimeContext_DSimpleRcx.json5] +**/ + +#include "detail/IRuntimeContext_DSimpleRcx.hpp" + +namespace xo { + namespace scm { + auto + IRuntimeContext_DSimpleRcx::allocator(const DSimpleRcx & self) noexcept -> obj + { + return self.allocator(); + } + + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end IRuntimeContext_DSimpleRcx.cpp */ \ No newline at end of file