xo-procedure2: work on Primitive.apply_nocheck() + ARuntimeContext [WIP]
This commit is contained in:
parent
a4dd872a15
commit
f2139feafb
22 changed files with 667 additions and 25 deletions
80
include/xo/procedure2/detail/RRuntimeContext.hpp
Normal file
80
include/xo/procedure2/detail/RRuntimeContext.hpp
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/** @file RRuntimeContext.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/RuntimeContext.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/RuntimeContext.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ARuntimeContext.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
/** @class RRuntimeContext
|
||||
**/
|
||||
template <typename Object>
|
||||
class RRuntimeContext : public Object {
|
||||
private:
|
||||
using O = Object;
|
||||
|
||||
public:
|
||||
/** @defgroup scm-runtimecontext-router-type-traits **/
|
||||
///@{
|
||||
using ObjectType = Object;
|
||||
using DataPtr = Object::DataPtr;
|
||||
using typeseq = xo::reflect::typeseq;
|
||||
using AAllocator = ARuntimeContext::AAllocator;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-runtimecontext-router-ctors **/
|
||||
///@{
|
||||
RRuntimeContext() {}
|
||||
RRuntimeContext(Object::DataPtr data) : Object{std::move(data)} {}
|
||||
RRuntimeContext(const ARuntimeContext * iface, void * data)
|
||||
requires std::is_same_v<typename Object::DataType, xo::facet::DVariantPlaceholder>
|
||||
: Object(iface, data) {}
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-runtimecontext-router-methods **/
|
||||
///@{
|
||||
|
||||
// const methods
|
||||
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
obj<AAllocator> allocator() const noexcept {
|
||||
return O::iface()->allocator(O::data());
|
||||
}
|
||||
|
||||
// non-const methods (still const in router!)
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-runtimecontext-member-vars **/
|
||||
///@{
|
||||
|
||||
static bool _valid;
|
||||
|
||||
///@}
|
||||
};
|
||||
|
||||
template <typename Object>
|
||||
bool
|
||||
RRuntimeContext<Object>::_valid = xo::facet::valid_object_router<Object>();
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
namespace xo { namespace facet {
|
||||
template <typename Object>
|
||||
struct RoutingFor<xo::scm::ARuntimeContext, Object> {
|
||||
using RoutingType = xo::scm::RRuntimeContext<Object>;
|
||||
};
|
||||
} }
|
||||
|
||||
/* end RRuntimeContext.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue