xo-alloc2: shallow_copy api + bugfixes [WIP]
This commit is contained in:
parent
e5cb3ff96b
commit
7f792bea9b
6 changed files with 15 additions and 6 deletions
|
|
@ -5,8 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "IAllocator_Any.hpp"
|
||||
#include "RAllocator.hpp"
|
||||
#include "xo/facet/facet_implementation.hpp"
|
||||
#include "xo/facet/typeseq.hpp"
|
||||
#include "xo/facet/obj.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
|
|
@ -28,7 +31,8 @@ namespace xo {
|
|||
virtual int32_t _typeseq() const noexcept = 0;
|
||||
|
||||
virtual size_type shallow_size(Copaque d) const noexcept = 0;
|
||||
virtual Opaque * shallow_copy(Copaque d) const noexcept = 0;
|
||||
virtual Opaque * shallow_copy(Copaque d,
|
||||
obj<AAllocator> mm) const noexcept = 0;
|
||||
virtual size_type forward_children(Opaque d) const noexcept = 0;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,10 @@ namespace xo {
|
|||
// from AGCObject
|
||||
int32_t _typeseq() const noexcept override { return s_typeseq; }
|
||||
|
||||
[[noreturn]] size_type shallow_size() const noexcept override { _fatal(); }
|
||||
[[noreturn]] Opaque * shallow_copy() const noexcept override { _fatal(); }
|
||||
[[noreturn]] size_type forward_children() const noexcept override { _fatal(); }
|
||||
[[noreturn]] size_type shallow_size(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] Opaque * shallow_copy(Copaque,
|
||||
obj<AAllocator>) const noexcept override { _fatal(); }
|
||||
[[noreturn]] size_type forward_children(Opaque) const noexcept override { _fatal(); }
|
||||
|
||||
private:
|
||||
[[noreturn]] static void _fatal();
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ namespace xo {
|
|||
size_type shallow_size(Copaque d) const noexcept override {
|
||||
return I::shallow_copy(_dcast(d));
|
||||
}
|
||||
Opaque * shallow_copy(Copaque d) const noexcept override {
|
||||
return I::shallow_size(_dcast(d));
|
||||
Opaque * shallow_copy(Copaque d, obj<AAllocator> mm) const noexcept override {
|
||||
return I::shallow_size(_dcast(d), mm);
|
||||
}
|
||||
|
||||
// non-const methods
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "AAllocator.hpp"
|
||||
#include "xo/facet/RRouter.hpp"
|
||||
#include <string>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue