xo-object2: + IGCObject_DArray
This commit is contained in:
parent
17f090d933
commit
fbd3064e73
6 changed files with 136 additions and 0 deletions
|
|
@ -148,6 +148,18 @@ xo_add_genfacetimpl(
|
||||||
OUTPUT_CPP_DIR src/object2
|
OUTPUT_CPP_DIR src/object2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# note: manual target; generated code committed to git
|
||||||
|
xo_add_genfacetimpl(
|
||||||
|
TARGET xo-object2-facetimpl-gcobject-array
|
||||||
|
FACET_PKG xo_gc
|
||||||
|
FACET GCObject
|
||||||
|
REPR Array
|
||||||
|
INPUT idl/IGCObject_DArray.json5
|
||||||
|
OUTPUT_HPP_DIR include/xo/object2
|
||||||
|
OUTPUT_IMPL_SUBDIR array
|
||||||
|
OUTPUT_CPP_DIR src/object2
|
||||||
|
)
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
# must complete definition of expression lib before configuring examples
|
# must complete definition of expression lib before configuring examples
|
||||||
|
|
|
||||||
15
idl/IGCObject_DArray.json5
Normal file
15
idl/IGCObject_DArray.json5
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
mode: "implementation",
|
||||||
|
includes: [
|
||||||
|
"<xo/gc/GCObject.hpp>",
|
||||||
|
"<xo/alloc2/Allocator.hpp>"
|
||||||
|
],
|
||||||
|
local_types: [ ],
|
||||||
|
namespace1: "xo",
|
||||||
|
namespace2: "scm",
|
||||||
|
facet_idl: "idl/GCObject.json5",
|
||||||
|
brief: "provide AGCObject interface for DArray",
|
||||||
|
using_doxygen: true,
|
||||||
|
repr: "DArray",
|
||||||
|
doc: [ "implement AGCObject for DArray" ],
|
||||||
|
}
|
||||||
67
include/xo/object2/array/IGCObject_DArray.hpp
Normal file
67
include/xo/object2/array/IGCObject_DArray.hpp
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
/** @file IGCObject_DArray.hpp
|
||||||
|
*
|
||||||
|
* Generated automagically from ingredients:
|
||||||
|
* 1. code generator:
|
||||||
|
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||||
|
* arguments:
|
||||||
|
* --input [idl/IGCObject_DArray.json5]
|
||||||
|
* 2. jinja2 template for abstract facet .hpp file:
|
||||||
|
* [iface_facet_repr.hpp.j2]
|
||||||
|
* 3. idl for facet methods
|
||||||
|
* [idl/IGCObject_DArray.json5]
|
||||||
|
**/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "GCObject.hpp"
|
||||||
|
#include <xo/gc/GCObject.hpp>
|
||||||
|
#include <xo/alloc2/Allocator.hpp>
|
||||||
|
#include "DArray.hpp"
|
||||||
|
|
||||||
|
namespace xo { namespace scm { class IGCObject_DArray; } }
|
||||||
|
|
||||||
|
namespace xo {
|
||||||
|
namespace facet {
|
||||||
|
template <>
|
||||||
|
struct FacetImplementation<xo::mm::AGCObject,
|
||||||
|
xo::scm::DArray>
|
||||||
|
{
|
||||||
|
using ImplType = xo::mm::IGCObject_Xfer
|
||||||
|
<xo::scm::DArray,
|
||||||
|
xo::scm::IGCObject_DArray>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace xo {
|
||||||
|
namespace scm {
|
||||||
|
/** @class IGCObject_DArray
|
||||||
|
**/
|
||||||
|
class IGCObject_DArray {
|
||||||
|
public:
|
||||||
|
/** @defgroup scm-gcobject-darray-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-darray-methods **/
|
||||||
|
///@{
|
||||||
|
// const methods
|
||||||
|
/** memory consumption for this instance **/
|
||||||
|
static size_type shallow_size(const DArray & self) noexcept;
|
||||||
|
/** copy instance using allocator **/
|
||||||
|
static Opaque shallow_copy(const DArray & self, obj<AAllocator> mm) noexcept;
|
||||||
|
|
||||||
|
// non-const methods
|
||||||
|
/** during GC: forward immdiate children **/
|
||||||
|
static size_type forward_children(DArray & self, obj<ACollector> gc) noexcept;
|
||||||
|
///@}
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*namespace scm*/
|
||||||
|
} /*namespace xo*/
|
||||||
|
|
||||||
|
/* end */
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
set(SELF_LIB xo_object2)
|
set(SELF_LIB xo_object2)
|
||||||
set(SELF_SRCS
|
set(SELF_SRCS
|
||||||
|
IGCObject_DArray.cpp
|
||||||
IGCObject_DFloat.cpp
|
IGCObject_DFloat.cpp
|
||||||
IGCObject_DInteger.cpp
|
IGCObject_DInteger.cpp
|
||||||
IGCObject_DList.cpp
|
IGCObject_DList.cpp
|
||||||
|
|
|
||||||
39
src/object2/IGCObject_DArray.cpp
Normal file
39
src/object2/IGCObject_DArray.cpp
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
/** @file IGCObject_DArray.cpp
|
||||||
|
*
|
||||||
|
* Generated automagically from ingredients:
|
||||||
|
* 1. code generator:
|
||||||
|
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||||
|
* arguments:
|
||||||
|
* --input [idl/IGCObject_DArray.json5]
|
||||||
|
* 2. jinja2 template for abstract facet .hpp file:
|
||||||
|
* [iface_facet_any.hpp.j2]
|
||||||
|
* 3. idl for facet methods
|
||||||
|
* [idl/IGCObject_DArray.json5]
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "array/IGCObject_DArray.hpp"
|
||||||
|
|
||||||
|
namespace xo {
|
||||||
|
namespace scm {
|
||||||
|
auto
|
||||||
|
IGCObject_DArray::shallow_size(const DArray & self) noexcept -> size_type
|
||||||
|
{
|
||||||
|
return self.shallow_size();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto
|
||||||
|
IGCObject_DArray::shallow_copy(const DArray & self, obj<AAllocator> mm) noexcept -> Opaque
|
||||||
|
{
|
||||||
|
return self.shallow_copy(mm);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto
|
||||||
|
IGCObject_DArray::forward_children(DArray & self, obj<ACollector> gc) noexcept -> size_type
|
||||||
|
{
|
||||||
|
return self.forward_children(gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
} /*namespace scm*/
|
||||||
|
} /*namespace xo*/
|
||||||
|
|
||||||
|
/* end IGCObject_DArray.cpp */
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include "object2_register_facets.hpp"
|
#include "object2_register_facets.hpp"
|
||||||
|
|
||||||
|
#include <xo/object2/array/IGCObject_DArray.hpp>
|
||||||
#include <xo/object2/list/IGCObject_DList.hpp>
|
#include <xo/object2/list/IGCObject_DList.hpp>
|
||||||
#include <xo/object2/number/IGCObject_DFloat.hpp>
|
#include <xo/object2/number/IGCObject_DFloat.hpp>
|
||||||
#include <xo/object2/number/IGCObject_DInteger.hpp>
|
#include <xo/object2/number/IGCObject_DInteger.hpp>
|
||||||
|
|
@ -53,6 +54,7 @@ namespace xo {
|
||||||
FacetRegistry::register_impl<AGCObject, DString>();
|
FacetRegistry::register_impl<AGCObject, DString>();
|
||||||
FacetRegistry::register_impl<APrintable, DString>();
|
FacetRegistry::register_impl<APrintable, DString>();
|
||||||
|
|
||||||
|
FacetRegistry::register_impl<AGCObject, DArray>();
|
||||||
FacetRegistry::register_impl<ASequence, DArray>();
|
FacetRegistry::register_impl<ASequence, DArray>();
|
||||||
|
|
||||||
log && log(xtag("DList.tseq", typeseq::id<DList>()));
|
log && log(xtag("DList.tseq", typeseq::id<DList>()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue