xo-procedure2: add DSimpleRcx w/ IRuntimeContext facet

This commit is contained in:
Roland Conybeare 2026-01-26 16:51:23 -05:00
commit 19d53585fb
6 changed files with 150 additions and 2 deletions

View file

@ -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

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
includes: [
//"<xo/procedure2/RuntimeContext.hpp>",
//"<xo/procedure2/detail/IRuntimeContext_Xfer.hpp>",
],
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" ],
}

View file

@ -0,0 +1,32 @@
/** @file DSimpleRcx.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#include <xo/alloc2/Allocator.hpp>
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<AAllocator> mm) : allocator_{mm} {}
obj<AAllocator> allocator() const noexcept { return allocator_; }
private:
obj<AAllocator> allocator_;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DSimpleRcx.hpp */

View file

@ -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<xo::scm::ARuntimeContext,
xo::scm::DSimpleRcx>
{
using ImplType = xo::scm::IRuntimeContext_Xfer
<xo::scm::DSimpleRcx,
xo::scm::IRuntimeContext_DSimpleRcx>;
};
}
}
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<AAllocator> allocator(const DSimpleRcx & self) noexcept;
// non-const methods
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end */

View file

@ -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.:

View file

@ -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<AAllocator>
{
return self.allocator();
}
} /*namespace scm*/
} /*namespace xo*/
/* end IRuntimeContext_DSimpleRcx.cpp */