xo-interpreter2 stack: OUTPUT_CPP_DIR cmake->idl/
This commit is contained in:
parent
19adf834ad
commit
b87a058ae9
6 changed files with 17 additions and 4 deletions
|
|
@ -25,7 +25,6 @@ xo_add_genfacet(
|
|||
INPUT idl/ResourceVisitor.json5
|
||||
OUTPUT_HPP_DIR include/xo/alloc2
|
||||
OUTPUT_IMPL_SUBDIR visitor
|
||||
OUTPUT_CPP_DIR src/alloc2
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
mode: "facet",
|
||||
output_cpp_dir: "src/alloc2",
|
||||
includes: [
|
||||
"\"Allocator.hpp\""
|
||||
],
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public:
|
|||
// const methods
|
||||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/
|
||||
virtual void _drop(Opaque d) const noexcept = 0;
|
||||
/** report memory consumption **/
|
||||
virtual void on_allocator(Copaque data, obj<AAllocator> mm) const noexcept = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,11 @@ namespace mm {
|
|||
|
||||
// from AResourceVisitor
|
||||
|
||||
// const methods
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
[[noreturn]] void _drop(Opaque) const noexcept override { _fatal(); }
|
||||
|
||||
// const methods
|
||||
[[noreturn]] void on_allocator(Copaque, obj<AAllocator>) const noexcept override { _fatal(); }
|
||||
|
||||
// nonconst methods
|
||||
|
|
|
|||
|
|
@ -39,8 +39,11 @@ namespace mm {
|
|||
|
||||
// from AResourceVisitor
|
||||
|
||||
// const methods
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
void _drop(Opaque d) const noexcept override { _dcast(d).~DRepr(); }
|
||||
|
||||
// const methods
|
||||
void on_allocator(Copaque data, obj<AAllocator> mm) const noexcept override {
|
||||
return I::on_allocator(_dcast(data), mm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,13 @@ public:
|
|||
/** @defgroup mm-resourcevisitor-router-methods **/
|
||||
///@{
|
||||
|
||||
// const methods
|
||||
// explicit injected content
|
||||
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
void _drop() const noexcept { O::iface()->_drop(O::data()); }
|
||||
|
||||
// const methods
|
||||
void on_allocator(obj<AAllocator> mm) const noexcept {
|
||||
return O::iface()->on_allocator(O::data(), mm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue