x-procedure2: + dict_lookup() primitive
This commit is contained in:
parent
7a4792c586
commit
a0f178c90a
20 changed files with 483 additions and 2 deletions
|
|
@ -110,6 +110,9 @@ namespace xo {
|
|||
/** current dictionary size (number of key-value pairs) **/
|
||||
size_type size() const noexcept { return keys_->size(); }
|
||||
|
||||
/** return value associated with @p key, if key is present **/
|
||||
std::optional<obj<AGCObject>> lookup(const DString * key) const noexcept;
|
||||
|
||||
/** return element @p key-value pair at position @p index (0-based) **/
|
||||
std::pair<const DString *, obj<AGCObject>> at_index(size_type index) const;
|
||||
/** return @p i'th key. O(1) **/
|
||||
|
|
@ -117,6 +120,7 @@ namespace xo {
|
|||
/** return @p i'th value. O(1) **/
|
||||
obj<AGCObject> value_at_index(size_type i) const;
|
||||
|
||||
|
||||
auto operator[](const DString * key) const noexcept { return LValue<decltype(this)>(this, key); }
|
||||
auto operator[](const DString * key) noexcept { return LValue<decltype(this)>(this, key); }
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,21 @@ namespace xo {
|
|||
return new (mem) DDictionary(keys, values);
|
||||
}
|
||||
|
||||
std::optional<obj<AGCObject>>
|
||||
DDictionary::lookup(const DString * key) const noexcept
|
||||
{
|
||||
for (DArray::size_type i = 0, z = keys_->size(); i < z; ++i) {
|
||||
auto i_key = obj<AGCObject,DString>::from(keys_->at(i));
|
||||
|
||||
assert(i_key);
|
||||
|
||||
if (DString::compare(*key, *i_key.data()) == 0)
|
||||
return values_->at(i);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::pair<const DString *, obj<AGCObject>>
|
||||
DDictionary::at_index(size_type ix) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -113,6 +113,29 @@ xo_add_genfacetimpl(
|
|||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-procedure2-facetimpl-procedure-primitive_gco_2_dict_string
|
||||
FACET_PKG xo_procedure2
|
||||
INPUT idl/IProcedure_DPrimitive_gco_2_dict_string.json5
|
||||
)
|
||||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-procedure2-facetimpl-gcobject-primitive_gco_2_dict_string
|
||||
FACET_PKG xo_alloc2
|
||||
INPUT idl/IGCObject_DPrimitive_gco_2_dict_string.json5
|
||||
)
|
||||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-procedure2-facetimpl-printable-primitive_gco_2_dict_string
|
||||
FACET_PKG xo_printable2
|
||||
INPUT idl/IPrintable_DPrimitive_gco_2_dict_string.json5
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-procedure2-facetimpl-procedure-primitive_gco_3_dict_string_gco
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
mode: "implementation",
|
||||
output_cpp_dir: "src/procedure2/facet",
|
||||
output_hpp_dir: "include/xo/procedure2",
|
||||
output_impl_subdir: "detail",
|
||||
includes: [
|
||||
//<xo/procedure2/GCObjectConversion_DPrimitive_gco_2_gco_gco.hpp>
|
||||
"<xo/alloc2/GCObject.hpp>",
|
||||
"<xo/alloc2/Allocator.hpp>",
|
||||
],
|
||||
local_types: [ ],
|
||||
namespace1: "xo",
|
||||
namespace2: "scm",
|
||||
facet_idl: "idl/GCObject.json5",
|
||||
brief: "provide AGCobject interface for Primitive (dict x string) -> gco",
|
||||
using_doxygen: true,
|
||||
repr: "DPrimitive_gco_2_dict_string",
|
||||
doc: [ "implement AGCObject for DPrimitive (dict x string) -> gco" ],
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
mode: "implementation",
|
||||
output_cpp_dir: "src/procedure2/facet",
|
||||
output_hpp_dir: "include/xo/procedure2",
|
||||
output_impl_subdir: "detail",
|
||||
includes: [
|
||||
"<xo/printable2/Printable.hpp>",
|
||||
"<xo/printable2/detail/IPrintable_Xfer.hpp>",
|
||||
],
|
||||
local_types: [ ],
|
||||
namespace1: "xo",
|
||||
namespace2: "scm",
|
||||
facet_idl: "idl/Printable.json5",
|
||||
brief: "provide APrintable interface for DPrimitive (dict x string) -> gco",
|
||||
using_doxygen: true,
|
||||
repr: "DPrimitive_gco_2_dict_string",
|
||||
doc: [ "implement APrintable for DPrimitive (dict x string) -> gco" ],
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
mode: "implementation",
|
||||
output_cpp_dir: "src/procedure2/facet",
|
||||
output_hpp_dir: "include/xo/procedure2",
|
||||
output_impl_subdir: "detail",
|
||||
includes: [
|
||||
"<xo/procedure2/RuntimeContext.hpp>",
|
||||
"<xo/procedure2/detail/IRuntimeContext_Xfer.hpp>",
|
||||
"<xo/procedure2/Procedure.hpp>",
|
||||
"<xo/procedure2/detail/IProcedure_Xfer.hpp>",
|
||||
],
|
||||
local_types: [ ],
|
||||
namespace1: "xo",
|
||||
namespace2: "scm",
|
||||
facet_idl: "idl/Procedure.json5",
|
||||
brief: "provide AProcedure interface for Primitive (dict x string) -> gco",
|
||||
using_doxygen: true,
|
||||
repr: "DPrimitive_gco_2_dict_string",
|
||||
doc: [ "implement AProcedure for DPrimitive (dict x string) -> gco" ],
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/** @file DPrimitive_gco_2_dict_string.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/object2/Dictionary.hpp>
|
||||
#include <xo/stringtable2/String.hpp>
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include "DPrimitive.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
using xo::mm::AGCObject;
|
||||
using xo::facet::obj;
|
||||
|
||||
using DPrimitive_gco_2_dict_string
|
||||
= Primitive<obj<AGCObject> (*)(obj<ARuntimeContext>,
|
||||
obj<AGCObject,DDictionary>,
|
||||
obj<AGCObject,DString>)>;
|
||||
}
|
||||
}
|
||||
|
||||
/* end DPrimitive_gco_2_dict_string.hpp */
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
#include "Primitive_gco_0.hpp"
|
||||
#include "Primitive_gco_1_gco.hpp"
|
||||
#include "Primitive_gco_2_gco_gco.hpp"
|
||||
#include "Primitive_gco_2_dict_string.hpp"
|
||||
#include "Primitive_gco_3_dict_string_gco.hpp"
|
||||
|
||||
namespace xo {
|
||||
|
|
@ -34,6 +35,9 @@ namespace xo {
|
|||
/** create primitive for creating a dictionary instance **/
|
||||
static DPrimitive_gco_0 * make_dict_make_pm(obj<AAllocator> mm);
|
||||
|
||||
/** create primitive for creating a dictionary instance **/
|
||||
static DPrimitive_gco_2_dict_string * make_dict_lookup_pm(obj<AAllocator> mm);
|
||||
|
||||
/** create primitive that upserts a key,value pair into a dictionary **/
|
||||
static DPrimitive_gco_3_dict_string_gco * make_dict_upsert_pm(obj<AAllocator> mm);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
/** @file Primitive_gco_2_dict_string.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#include "DPrimitive_gco_2_dict_string.hpp"
|
||||
#include "detail/IProcedure_DPrimitive_gco_2_dict_string.hpp"
|
||||
#include "detail/IGCObject_DPrimitive_gco_2_dict_string.hpp"
|
||||
#include "detail/IPrintable_DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
/* end Primitive_gco_2_dict_string.hpp */
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/** @file IGCObject_DPrimitive_gco_2_dict_string.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DPrimitive_gco_2_dict_string.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DPrimitive_gco_2_dict_string.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DPrimitive_gco_2_dict_string; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DPrimitive_gco_2_dict_string>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DPrimitive_gco_2_dict_string,
|
||||
xo::scm::IGCObject_DPrimitive_gco_2_dict_string>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DPrimitive_gco_2_dict_string
|
||||
**/
|
||||
class IGCObject_DPrimitive_gco_2_dict_string {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dprimitive_gco_2_dict_string-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using ACollector = xo::mm::AGCObject::ACollector;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dprimitive_gco_2_dict_string-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DPrimitive_gco_2_dict_string & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DPrimitive_gco_2_dict_string & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DPrimitive_gco_2_dict_string & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DPrimitive_gco_2_dict_string.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DPrimitive_gco_2_dict_string.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DPrimitive_gco_2_dict_string.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DPrimitive_gco_2_dict_string; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DPrimitive_gco_2_dict_string>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DPrimitive_gco_2_dict_string,
|
||||
xo::scm::IPrintable_DPrimitive_gco_2_dict_string>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DPrimitive_gco_2_dict_string
|
||||
**/
|
||||
class IPrintable_DPrimitive_gco_2_dict_string {
|
||||
public:
|
||||
/** @defgroup scm-printable-dprimitive_gco_2_dict_string-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dprimitive_gco_2_dict_string-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DPrimitive_gco_2_dict_string & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/** @file IProcedure_DPrimitive_gco_2_dict_string.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IProcedure_DPrimitive_gco_2_dict_string.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IProcedure_DPrimitive_gco_2_dict_string.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Procedure.hpp"
|
||||
#include <xo/procedure2/RuntimeContext.hpp>
|
||||
#include <xo/procedure2/detail/IRuntimeContext_Xfer.hpp>
|
||||
#include <xo/procedure2/Procedure.hpp>
|
||||
#include <xo/procedure2/detail/IProcedure_Xfer.hpp>
|
||||
#include "DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IProcedure_DPrimitive_gco_2_dict_string; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AProcedure,
|
||||
xo::scm::DPrimitive_gco_2_dict_string>
|
||||
{
|
||||
using ImplType = xo::scm::IProcedure_Xfer
|
||||
<xo::scm::DPrimitive_gco_2_dict_string,
|
||||
xo::scm::IProcedure_DPrimitive_gco_2_dict_string>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IProcedure_DPrimitive_gco_2_dict_string
|
||||
**/
|
||||
class IProcedure_DPrimitive_gco_2_dict_string {
|
||||
public:
|
||||
/** @defgroup scm-procedure-dprimitive_gco_2_dict_string-type-traits **/
|
||||
///@{
|
||||
using AGCObject = xo::scm::AProcedure::AGCObject;
|
||||
using Copaque = xo::scm::AProcedure::Copaque;
|
||||
using Opaque = xo::scm::AProcedure::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-procedure-dprimitive_gco_2_dict_string-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** true iff procedure takes n arguments **/
|
||||
static bool is_nary(const DPrimitive_gco_2_dict_string & self) noexcept;
|
||||
/** number of arguments. -1 for n-ary **/
|
||||
static std::int32_t n_args(const DPrimitive_gco_2_dict_string & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** invoke procedure; assume arguments satisfy type system **/
|
||||
static obj<AGCObject> apply_nocheck(DPrimitive_gco_2_dict_string & self, obj<ARuntimeContext> rcx, const DArray * args);
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -23,6 +23,9 @@ set(SELF_SRCS
|
|||
facet/IGCObject_DPrimitive_gco_2_gco_gco.cpp
|
||||
facet/IProcedure_DPrimitive_gco_2_gco_gco.cpp
|
||||
facet/IPrintable_DPrimitive_gco_2_gco_gco.cpp
|
||||
facet/IGCObject_DPrimitive_gco_2_dict_string.cpp
|
||||
facet/IProcedure_DPrimitive_gco_2_dict_string.cpp
|
||||
facet/IPrintable_DPrimitive_gco_2_dict_string.cpp
|
||||
facet/IGCObject_DPrimitive_gco_3_dict_string_gco.cpp
|
||||
facet/IProcedure_DPrimitive_gco_3_dict_string_gco.cpp
|
||||
facet/IPrintable_DPrimitive_gco_3_dict_string_gco.cpp
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
**/
|
||||
|
||||
#include "ObjectPrimitives.hpp"
|
||||
#include <xo/object2/RuntimeError.hpp>
|
||||
#include <xo/object2/Dictionary.hpp>
|
||||
#include <xo/object2/Sequence.hpp>
|
||||
#include <xo/object2/List.hpp>
|
||||
|
|
@ -100,6 +101,35 @@ namespace xo {
|
|||
return DPrimitive_gco_0::_make(mm, "dict_make", &xfer_dict_make);
|
||||
}
|
||||
|
||||
// ----- dict_at -----
|
||||
|
||||
obj<AGCObject>
|
||||
xfer_dict_lookup(obj<ARuntimeContext> rcx,
|
||||
obj<AGCObject,DDictionary> dict,
|
||||
obj<AGCObject,DString> key)
|
||||
{
|
||||
auto opt = dict->lookup(key.data());
|
||||
|
||||
if (opt) {
|
||||
return opt.value();
|
||||
} else {
|
||||
DString * src_fn = DString::from_cstr(rcx.allocator(), "dict_lookup");
|
||||
DString * error = DString::printf(rcx.allocator(),
|
||||
100,
|
||||
"no value in dict for key [%s]", key.data()->data());
|
||||
|
||||
return obj<AGCObject,DRuntimeError>
|
||||
(DRuntimeError::_make(rcx.allocator(),
|
||||
src_fn, error));
|
||||
}
|
||||
}
|
||||
|
||||
DPrimitive_gco_2_dict_string *
|
||||
ObjectPrimitives::make_dict_lookup_pm(obj<AAllocator> mm)
|
||||
{
|
||||
return DPrimitive_gco_2_dict_string::_make(mm, "dict_lookup", &xfer_dict_lookup);
|
||||
}
|
||||
|
||||
// ----- dict_upsert -----
|
||||
|
||||
obj<AGCObject>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
/** @file IGCObject_DPrimitive_gco_2_dict_string.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DPrimitive_gco_2_dict_string.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DPrimitive_gco_2_dict_string.json5]
|
||||
**/
|
||||
|
||||
#include "detail/IGCObject_DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IGCObject_DPrimitive_gco_2_dict_string::shallow_size(const DPrimitive_gco_2_dict_string & self) noexcept -> size_type
|
||||
{
|
||||
return self.shallow_size();
|
||||
}
|
||||
|
||||
auto
|
||||
IGCObject_DPrimitive_gco_2_dict_string::shallow_copy(const DPrimitive_gco_2_dict_string & self, obj<AAllocator> mm) noexcept -> Opaque
|
||||
{
|
||||
return self.shallow_copy(mm);
|
||||
}
|
||||
|
||||
auto
|
||||
IGCObject_DPrimitive_gco_2_dict_string::forward_children(DPrimitive_gco_2_dict_string & self, obj<ACollector> gc) noexcept -> size_type
|
||||
{
|
||||
return self.forward_children(gc);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IGCObject_DPrimitive_gco_2_dict_string.cpp */
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
/** @file IPrintable_DPrimitive_gco_2_dict_string.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DPrimitive_gco_2_dict_string.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DPrimitive_gco_2_dict_string.json5]
|
||||
**/
|
||||
|
||||
#include "detail/IPrintable_DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IPrintable_DPrimitive_gco_2_dict_string::pretty(const DPrimitive_gco_2_dict_string & self, const ppindentinfo & ppii) -> bool
|
||||
{
|
||||
return self.pretty(ppii);
|
||||
}
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IPrintable_DPrimitive_gco_2_dict_string.cpp */
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/** @file IProcedure_DPrimitive_gco_2_dict_string.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IProcedure_DPrimitive_gco_2_dict_string.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IProcedure_DPrimitive_gco_2_dict_string.json5]
|
||||
**/
|
||||
|
||||
#include "detail/IProcedure_DPrimitive_gco_2_dict_string.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IProcedure_DPrimitive_gco_2_dict_string::is_nary(const DPrimitive_gco_2_dict_string & self) noexcept -> bool
|
||||
{
|
||||
return self.is_nary();
|
||||
}
|
||||
|
||||
auto
|
||||
IProcedure_DPrimitive_gco_2_dict_string::n_args(const DPrimitive_gco_2_dict_string & self) noexcept -> std::int32_t
|
||||
{
|
||||
return self.n_args();
|
||||
}
|
||||
|
||||
auto
|
||||
IProcedure_DPrimitive_gco_2_dict_string::apply_nocheck(DPrimitive_gco_2_dict_string & self, obj<ARuntimeContext> rcx, const DArray * args) -> obj<AGCObject>
|
||||
{
|
||||
return self.apply_nocheck(rcx, args);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IProcedure_DPrimitive_gco_2_dict_string.cpp */
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
#include "Primitive_gco_0.hpp"
|
||||
#include "Primitive_gco_1_gco.hpp"
|
||||
#include "Primitive_gco_2_gco_gco.hpp"
|
||||
#include "Primitive_gco_2_dict_string.hpp"
|
||||
#include "Primitive_gco_3_dict_string_gco.hpp"
|
||||
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
|
|
@ -40,6 +41,10 @@ namespace xo {
|
|||
FacetRegistry::register_impl<AGCObject, DPrimitive_gco_2_gco_gco>();
|
||||
FacetRegistry::register_impl<APrintable, DPrimitive_gco_2_gco_gco>();
|
||||
|
||||
FacetRegistry::register_impl<AProcedure, DPrimitive_gco_2_dict_string>();
|
||||
FacetRegistry::register_impl<AGCObject, DPrimitive_gco_2_dict_string>();
|
||||
FacetRegistry::register_impl<APrintable, DPrimitive_gco_2_dict_string>();
|
||||
|
||||
FacetRegistry::register_impl<AProcedure, DPrimitive_gco_3_dict_string_gco>();
|
||||
FacetRegistry::register_impl<AGCObject, DPrimitive_gco_3_dict_string_gco>();
|
||||
FacetRegistry::register_impl<APrintable, DPrimitive_gco_3_dict_string_gco>();
|
||||
|
|
@ -48,6 +53,7 @@ namespace xo {
|
|||
log && log(xtag("DPrimitive_gco_0.tseq", typeseq::id<DPrimitive_gco_0>()));
|
||||
log && log(xtag("DPrimitive_gco_1_gco.tseq", typeseq::id<DPrimitive_gco_1_gco>()));
|
||||
log && log(xtag("DPrimitive_gco_2_gco_gco.tseq", typeseq::id<DPrimitive_gco_2_gco_gco>()));
|
||||
log && log(xtag("DPrimitive_gco_2_dict_string.tseq", typeseq::id<DPrimitive_gco_2_dict_string>()));
|
||||
log && log(xtag("DPrimitive_gco_3_dict_string_gco.tseq", typeseq::id<DPrimitive_gco_3_dict_string_gco>()));
|
||||
|
||||
log && log(xtag("ARuntimeContext.tseq", typeseq::id<ARuntimeContext>()));
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ namespace xo {
|
|||
ok = ok & install_aux(sink, ObjectPrimitives::make_nth_pm(mm), flags);
|
||||
ok = ok & install_aux(sink, ObjectPrimitives::make_cons_pm(mm), flags);
|
||||
ok = ok & install_aux(sink, ObjectPrimitives::make_dict_make_pm(mm), flags);
|
||||
ok = ok & install_aux(sink, ObjectPrimitives::make_dict_lookup_pm(mm), flags);
|
||||
ok = ok & install_aux(sink, ObjectPrimitives::make_dict_upsert_pm(mm), flags);
|
||||
ok = ok & install_aux(sink, ObjectPrimitives::make_fn_n_args_pm(mm), flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
#include "procedure2_register_types.hpp"
|
||||
|
||||
#include "Primitive_gco_0.hpp"
|
||||
//#include "detail/IGCObject_DPrimitive_gco_0.hpp"
|
||||
#include "detail/IGCObject_DPrimitive_gco_1_gco.hpp"
|
||||
#include "detail/IGCObject_DPrimitive_gco_2_gco_gco.hpp"
|
||||
#include "detail/IGCObject_DPrimitive_gco_2_dict_string.hpp"
|
||||
#include "detail/IGCObject_DPrimitive_gco_3_dict_string_gco.hpp"
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
|
||||
|
|
@ -16,7 +16,6 @@ namespace xo {
|
|||
using xo::mm::ACollector;
|
||||
using xo::mm::AGCObject;
|
||||
using xo::facet::impl_for;
|
||||
using xo::facet::typeseq;
|
||||
using xo::scope;
|
||||
|
||||
namespace scm {
|
||||
|
|
@ -32,6 +31,7 @@ namespace xo {
|
|||
ok &= gc.install_type(impl_for<AGCObject, DPrimitive_gco_0>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DPrimitive_gco_1_gco>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DPrimitive_gco_2_gco_gco>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DPrimitive_gco_2_dict_string>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DPrimitive_gco_3_dict_string_gco>());
|
||||
|
||||
return ok;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue