reflect: insert xo/ subdir into include path
This commit is contained in:
parent
ba95d0a40c
commit
6be9037f10
20 changed files with 179 additions and 184 deletions
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescr.hpp"
|
||||
#include "reflect/TaggedPtr.hpp"
|
||||
#include "TypeDescr.hpp"
|
||||
#include "TaggedPtr.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace reflect {
|
||||
|
|
@ -26,28 +26,28 @@ namespace xo {
|
|||
|
||||
template<typename T>
|
||||
static TypeDescrW establish() {
|
||||
TypeDescrW td = TypeDescrBase::require(&typeid(T),
|
||||
type_name<T>(),
|
||||
nullptr);
|
||||
TypeDescrW td = TypeDescrBase::require(&typeid(T),
|
||||
type_name<T>(),
|
||||
nullptr);
|
||||
|
||||
#ifdef NOT_USING
|
||||
std::function<TaggedPtr (void *)> to_self_tp;
|
||||
std::function<TaggedPtr (void *)> to_self_tp;
|
||||
|
||||
if (std::is_base_of_v<SelfTagging, T>) {
|
||||
/* T is a descendant of SelfTagging (or T = SelfTagging);
|
||||
* use SelfTagging.self_tp()
|
||||
*/
|
||||
to_self_tp = [](void * x) { return reinterpret_cast<T *>(x)->self_tp(); };
|
||||
} else {
|
||||
/* T is not a descendant of SelfTagging.
|
||||
* want to return
|
||||
*/
|
||||
to_self_tp = [td](void * x) { return TaggedPtr(td, x); };
|
||||
}
|
||||
if (std::is_base_of_v<SelfTagging, T>) {
|
||||
/* T is a descendant of SelfTagging (or T = SelfTagging);
|
||||
* use SelfTagging.self_tp()
|
||||
*/
|
||||
to_self_tp = [](void * x) { return reinterpret_cast<T *>(x)->self_tp(); };
|
||||
} else {
|
||||
/* T is not a descendant of SelfTagging.
|
||||
* want to return
|
||||
*/
|
||||
to_self_tp = [td](void * x) { return TaggedPtr(td, x); };
|
||||
}
|
||||
|
||||
td->assign_to_self_tp(to_self_tp);
|
||||
td->assign_to_self_tp(to_self_tp);
|
||||
#endif
|
||||
return td;
|
||||
return td;
|
||||
}
|
||||
}; /*EstablishTypeDescr*/
|
||||
|
||||
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/SelfTagging.hpp"
|
||||
#include "reflect/EstablishTypeDescr.hpp"
|
||||
#include "reflect/atomic/AtomicTdx.hpp"
|
||||
#include "reflect/pointer/PointerTdx.hpp"
|
||||
#include "reflect/vector/VectorTdx.hpp"
|
||||
#include "reflect/struct/StructTdx.hpp"
|
||||
#include "SelfTagging.hpp"
|
||||
#include "EstablishTypeDescr.hpp"
|
||||
#include "atomic/AtomicTdx.hpp"
|
||||
#include "pointer/PointerTdx.hpp"
|
||||
#include "vector/VectorTdx.hpp"
|
||||
#include "struct/StructTdx.hpp"
|
||||
#include "refcnt/Refcounted.hpp"
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
|
@ -73,11 +73,11 @@ namespace xo {
|
|||
class TaggedPtrMaker<SelfTagging> {
|
||||
public:
|
||||
static TaggedPtr make_tp(SelfTagging * x) {
|
||||
return x->self_tp();
|
||||
return x->self_tp();
|
||||
} /*make_tp*/
|
||||
|
||||
static TaggedRcptr make_rctp(SelfTagging * x) {
|
||||
return x->self_tp();
|
||||
return x->self_tp();
|
||||
} /*make_rctp*/
|
||||
}; /*TaggedPtrMaker*/
|
||||
|
||||
|
|
@ -117,31 +117,31 @@ namespace xo {
|
|||
*/
|
||||
template<typename T>
|
||||
static TypeDescrW require() {
|
||||
TypeDescrW retval_td = EstablishTypeDescr::establish<T>();
|
||||
TypeDescrW retval_td = EstablishTypeDescr::establish<T>();
|
||||
|
||||
/* mark TypeDescr for T as complete (even though it isn't quite yet),
|
||||
* so that when we encounter recursive types, reflection terminates.
|
||||
* For example consider type resulting from code like
|
||||
*
|
||||
* typename T;
|
||||
* using T = std::vector<T *>;
|
||||
*
|
||||
*/
|
||||
if (retval_td->mark_complete()) {
|
||||
/* control here on 2nd+later calls to require<T>().
|
||||
* in principle can immediately short-circuit.
|
||||
*/
|
||||
} else {
|
||||
/* control comes here the first time require<T>() runs */
|
||||
/* mark TypeDescr for T as complete (even though it isn't quite yet),
|
||||
* so that when we encounter recursive types, reflection terminates.
|
||||
* For example consider type resulting from code like
|
||||
*
|
||||
* typename T;
|
||||
* using T = std::vector<T *>;
|
||||
*
|
||||
*/
|
||||
if (retval_td->mark_complete()) {
|
||||
/* control here on 2nd+later calls to require<T>().
|
||||
* in principle can immediately short-circuit.
|
||||
*/
|
||||
} else {
|
||||
/* control comes here the first time require<T>() runs */
|
||||
|
||||
auto final_tdx = EstablishTdx<T>::make();
|
||||
auto final_tdx = EstablishTdx<T>::make();
|
||||
|
||||
retval_td->assign_tdextra(std::move(final_tdx));
|
||||
retval_td->assign_tdextra(std::move(final_tdx));
|
||||
|
||||
/* also need to require for each child */
|
||||
}
|
||||
/* also need to require for each child */
|
||||
}
|
||||
|
||||
return retval_td;
|
||||
return retval_td;
|
||||
} /*require*/
|
||||
|
||||
/* Use:
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "refcnt/Refcounted.hpp"
|
||||
#include "reflect/TypeDescr.hpp"
|
||||
#include "reflect/TaggedRcptr.hpp"
|
||||
#include "Refcounted.hpp"
|
||||
#include "TypeDescr.hpp"
|
||||
#include "TaggedRcptr.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace reflect {
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/Reflect.hpp"
|
||||
#include "reflect/TypeDescr.hpp"
|
||||
#include "reflect/struct/StructMember.hpp"
|
||||
#include "reflect/struct/StructTdx.hpp"
|
||||
#include "Reflect.hpp"
|
||||
#include "TypeDescr.hpp"
|
||||
#include "struct/StructMember.hpp"
|
||||
#include "struct/StructTdx.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace xo {
|
||||
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
template<typename StructT>
|
||||
struct SelfTagger<StructT, true> {
|
||||
static TaggedPtr self_tp(void * object) {
|
||||
return (reinterpret_cast<StructT *>(object))->self_tp();
|
||||
return (reinterpret_cast<StructT *>(object))->self_tp();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ namespace xo {
|
|||
public:
|
||||
StructReflector() : td_{EstablishTypeDescr::establish<StructT>()} {}
|
||||
~StructReflector() {
|
||||
this->require_complete();
|
||||
this->require_complete();
|
||||
}
|
||||
|
||||
bool is_complete() const { return s_reflected_flag; }
|
||||
|
|
@ -53,60 +53,60 @@ namespace xo {
|
|||
|
||||
template<typename OwnerT, typename MemberT>
|
||||
void reflect_member(std::string const & member_name,
|
||||
MemberT OwnerT::* member_addr) {
|
||||
MemberT OwnerT::* member_addr) {
|
||||
|
||||
auto accessor
|
||||
(GeneralStructMemberAccessor<StructT, OwnerT, MemberT>::make(member_addr));
|
||||
auto accessor
|
||||
(GeneralStructMemberAccessor<StructT, OwnerT, MemberT>::make(member_addr));
|
||||
|
||||
/* used to do this in GeneralStructMemberAccessor<> ctor,
|
||||
* but that introduces #include cycle
|
||||
*/
|
||||
Reflect::require<MemberT>();
|
||||
/* used to do this in GeneralStructMemberAccessor<> ctor,
|
||||
* but that introduces #include cycle
|
||||
*/
|
||||
Reflect::require<MemberT>();
|
||||
|
||||
this->member_v_.emplace_back(member_name, std::move(accessor));
|
||||
this->member_v_.emplace_back(member_name, std::move(accessor));
|
||||
} /*reflect_member*/
|
||||
|
||||
void require_complete() {
|
||||
if(!s_reflected_flag) {
|
||||
s_reflected_flag = true;
|
||||
if(!s_reflected_flag) {
|
||||
s_reflected_flag = true;
|
||||
|
||||
constexpr bool have_to_self_tp = std::is_base_of_v<SelfTagging, StructT>;
|
||||
constexpr bool have_to_self_tp = std::is_base_of_v<SelfTagging, StructT>;
|
||||
|
||||
/* if self-tagging, can use .self_tp() to get most-derived tagged pointer */
|
||||
auto to_self_tp_fn
|
||||
= ([](void * object)
|
||||
{
|
||||
return SelfTagger<StructT, have_to_self_tp>::self_tp(object);
|
||||
});
|
||||
/* if self-tagging, can use .self_tp() to get most-derived tagged pointer */
|
||||
auto to_self_tp_fn
|
||||
= ([](void * object)
|
||||
{
|
||||
return SelfTagger<StructT, have_to_self_tp>::self_tp(object);
|
||||
});
|
||||
|
||||
auto tdx = StructTdx::make(std::move(this->member_v_),
|
||||
have_to_self_tp,
|
||||
to_self_tp_fn);
|
||||
auto tdx = StructTdx::make(std::move(this->member_v_),
|
||||
have_to_self_tp,
|
||||
to_self_tp_fn);
|
||||
|
||||
this->td_->assign_tdextra(std::move(tdx));
|
||||
}
|
||||
this->td_->assign_tdextra(std::move(tdx));
|
||||
}
|
||||
} /*complete*/
|
||||
|
||||
template<typename AncestorT>
|
||||
void adopt_ancestors() {
|
||||
assert(Reflect::is_reflected<AncestorT>());
|
||||
assert(Reflect::is_reflected<AncestorT>());
|
||||
|
||||
TypeDescr ancestor_td = Reflect::require<AncestorT>();
|
||||
TypeDescr ancestor_td = Reflect::require<AncestorT>();
|
||||
|
||||
/* requires that reflection of AncestorT has completed */
|
||||
{
|
||||
assert(ancestor_td->is_struct());
|
||||
assert(ancestor_td->complete_flag());
|
||||
}
|
||||
/* requires that reflection of AncestorT has completed */
|
||||
{
|
||||
assert(ancestor_td->is_struct());
|
||||
assert(ancestor_td->complete_flag());
|
||||
}
|
||||
|
||||
/* for structs,
|
||||
* we know that object argument to TypeDescr::n_child() is unused
|
||||
*/
|
||||
for (uint32_t i = 0, n = ancestor_td->n_child(nullptr); i < n; ++i) {
|
||||
StructMember const & member = ancestor_td->struct_member(i);
|
||||
/* for structs,
|
||||
* we know that object argument to TypeDescr::n_child() is unused
|
||||
*/
|
||||
for (uint32_t i = 0, n = ancestor_td->n_child(nullptr); i < n; ++i) {
|
||||
StructMember const & member = ancestor_td->struct_member(i);
|
||||
|
||||
this->member_v_.push_back(member.for_descendant<StructT, AncestorT>());
|
||||
}
|
||||
this->member_v_.push_back(member.for_descendant<StructT, AncestorT>());
|
||||
}
|
||||
} /*adopt_ancestors*/
|
||||
|
||||
private:
|
||||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescr.hpp"
|
||||
//#include "reflect/EstablishTypeDescr.hpp"
|
||||
#include "TypeDescr.hpp"
|
||||
#include <unordered_set>
|
||||
|
||||
namespace xo {
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TaggedPtr.hpp"
|
||||
#include "TaggedPtr.hpp"
|
||||
// causes #include cycle, reflect/Reflect.hpp includes this header
|
||||
//#include "reflect/Reflect.hpp"
|
||||
#include "refcnt/Refcounted.hpp"
|
||||
|
|
@ -23,19 +23,19 @@ namespace xo {
|
|||
|
||||
public:
|
||||
TaggedRcptr(TypeDescr td, Refcount * x) : TaggedPtr(td, x) {
|
||||
ref::intrusive_ptr_add_ref(x);
|
||||
ref::intrusive_ptr_add_ref(x);
|
||||
}
|
||||
TaggedRcptr(TaggedRcptr const & x) : TaggedPtr(x) {
|
||||
ref::intrusive_ptr_add_ref(x.rc_address());
|
||||
ref::intrusive_ptr_add_ref(x.rc_address());
|
||||
}
|
||||
TaggedRcptr(TaggedRcptr && x) : TaggedPtr(std::move(x)) {
|
||||
/* since we're moving from x, need to make sure x.dtor
|
||||
* doesn't decrement refcount
|
||||
*/
|
||||
x.assign_address(nullptr);
|
||||
/* since we're moving from x, need to make sure x.dtor
|
||||
* doesn't decrement refcount
|
||||
*/
|
||||
x.assign_address(nullptr);
|
||||
}
|
||||
~TaggedRcptr() {
|
||||
ref::intrusive_ptr_release(this->rc_address());
|
||||
ref::intrusive_ptr_release(this->rc_address());
|
||||
}
|
||||
|
||||
/* causes #include cycle, see [reflect/Reflect.hpp] */
|
||||
|
|
@ -46,31 +46,31 @@ namespace xo {
|
|||
#endif
|
||||
|
||||
Refcount * rc_address() const {
|
||||
return reinterpret_cast<Refcount *>(this->address());
|
||||
return reinterpret_cast<Refcount *>(this->address());
|
||||
} /*rc_address*/
|
||||
|
||||
TaggedRcptr & operator=(TaggedRcptr const & rhs) {
|
||||
Refcount * x = rhs.rc_address();
|
||||
Refcount * old = this->rc_address();
|
||||
Refcount * x = rhs.rc_address();
|
||||
Refcount * old = this->rc_address();
|
||||
|
||||
TaggedPtr::operator=(rhs);
|
||||
TaggedPtr::operator=(rhs);
|
||||
|
||||
if (x != old) {
|
||||
intrusive_ptr_release(old);
|
||||
intrusive_ptr_add_ref(x);
|
||||
}
|
||||
if (x != old) {
|
||||
intrusive_ptr_release(old);
|
||||
intrusive_ptr_add_ref(x);
|
||||
}
|
||||
|
||||
return *this;
|
||||
return *this;
|
||||
} /*operator=*/
|
||||
|
||||
TaggedRcptr & operator=(TaggedRcptr && rhs) {
|
||||
/* swap pointers + type descriptions;
|
||||
* then don't need to touch refcounts
|
||||
*/
|
||||
std::swap(this->td_, rhs.td_);
|
||||
std::swap(this->address_, rhs.address_);
|
||||
/* swap pointers + type descriptions;
|
||||
* then don't need to touch refcounts
|
||||
*/
|
||||
std::swap(this->td_, rhs.td_);
|
||||
std::swap(this->address_, rhs.address_);
|
||||
|
||||
return *this;
|
||||
return *this;
|
||||
} /*operator=*/
|
||||
|
||||
void display(std::ostream & os) const;
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
#pragma once
|
||||
|
||||
//#include "reflect/atomic/AtomicTdx.hpp"
|
||||
#include "reflect/TypeDescrExtra.hpp"
|
||||
#include "TypeDescrExtra.hpp"
|
||||
#include "cxxutil/demangle.hpp"
|
||||
#include <iostream>
|
||||
#include <typeinfo>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/Metatype.hpp"
|
||||
#include "Metatype.hpp"
|
||||
#include <string>
|
||||
/* note: this file #include'd into TypeDescr.hpp */
|
||||
#include <cstdint>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescrExtra.hpp"
|
||||
#include "xo/reflect/TypeDescrExtra.hpp"
|
||||
//#include "reflect/TaggedPtr.hpp"
|
||||
#include <memory>
|
||||
|
||||
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescrExtra.hpp"
|
||||
#include "reflect/EstablishTypeDescr.hpp"
|
||||
#include "xo/reflect/TypeDescrExtra.hpp"
|
||||
#include "xo/reflect/EstablishTypeDescr.hpp"
|
||||
#include "indentlog/scope.hpp"
|
||||
|
||||
namespace xo {
|
||||
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescr.hpp"
|
||||
#include "reflect/EstablishTypeDescr.hpp"
|
||||
//#include "reflect/Reflect.hpp"
|
||||
#include "reflect/TaggedPtr.hpp"
|
||||
#include "xo/reflect/TypeDescr.hpp"
|
||||
#include "xo/reflect/EstablishTypeDescr.hpp"
|
||||
#include "xo/reflect/TaggedPtr.hpp"
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ namespace reflect {
|
|||
|
||||
public:
|
||||
GeneralStructMemberAccessor(Memptr memptr) : member_td_{EstablishTypeDescr::establish<MemberT>()},
|
||||
memptr_{memptr} {}
|
||||
memptr_{memptr} {}
|
||||
GeneralStructMemberAccessor(GeneralStructMemberAccessor const & x) = default;
|
||||
virtual ~GeneralStructMemberAccessor() = default;
|
||||
|
||||
|
|
@ -102,7 +101,7 @@ namespace reflect {
|
|||
|
||||
virtual std::unique_ptr<AbstractStructMemberAccessor> clone() const override {
|
||||
return std::unique_ptr<AbstractStructMemberAccessor>
|
||||
(new GeneralStructMemberAccessor(*this));
|
||||
(new GeneralStructMemberAccessor(*this));
|
||||
} /*clone*/
|
||||
|
||||
private:
|
||||
|
|
@ -142,7 +141,7 @@ namespace reflect {
|
|||
static std::unique_ptr<AncestorStructMemberAccessor>
|
||||
adopt(std::unique_ptr<AbstractStructMemberAccessor> ancestor_accessor) {
|
||||
return std::unique_ptr<AncestorStructMemberAccessor>
|
||||
(new AncestorStructMemberAccessor(std::move(ancestor_accessor)));
|
||||
(new AncestorStructMemberAccessor(std::move(ancestor_accessor)));
|
||||
} /*adopt*/
|
||||
|
||||
void * address_impl(StructT * self_addr) const {
|
||||
|
|
@ -171,7 +170,7 @@ namespace reflect {
|
|||
|
||||
virtual std::unique_ptr<AbstractStructMemberAccessor> clone() const override {
|
||||
return std::unique_ptr<AbstractStructMemberAccessor>
|
||||
(new AncestorStructMemberAccessor(std::move(this->ancestor_accessor_->clone())));
|
||||
(new AncestorStructMemberAccessor(std::move(this->ancestor_accessor_->clone())));
|
||||
} /*clone*/
|
||||
|
||||
private:
|
||||
|
|
@ -186,11 +185,11 @@ namespace reflect {
|
|||
public:
|
||||
StructMember() = default;
|
||||
StructMember(std::string const & name,
|
||||
std::unique_ptr<AbstractStructMemberAccessor> accessor)
|
||||
std::unique_ptr<AbstractStructMemberAccessor> accessor)
|
||||
: member_name_{name}, accessor_{std::move(accessor)} {}
|
||||
StructMember(StructMember && x)
|
||||
: member_name_{std::move(x.member_name_)},
|
||||
accessor_{std::move(x.accessor_)} {}
|
||||
accessor_{std::move(x.accessor_)} {}
|
||||
|
||||
static StructMember null();
|
||||
|
||||
|
|
@ -210,8 +209,8 @@ namespace reflect {
|
|||
assert(EstablishTypeDescr::establish<StructT>() == this->get_struct_td());
|
||||
|
||||
return StructMember(this->member_name(),
|
||||
std::move(AncestorStructMemberAccessor<DescendantT, StructT>::adopt
|
||||
(std::move(this->accessor_->clone()))));
|
||||
std::move(AncestorStructMemberAccessor<DescendantT, StructT>::adopt
|
||||
(std::move(this->accessor_->clone()))));
|
||||
} /*for_descendant*/
|
||||
|
||||
StructMember & operator=(StructMember && x) {
|
||||
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescrExtra.hpp"
|
||||
#include "reflect/TaggedPtr.hpp"
|
||||
#include "reflect/struct/StructMember.hpp"
|
||||
#include "xo/reflect/TypeDescrExtra.hpp"
|
||||
#include "xo/reflect/TaggedPtr.hpp"
|
||||
#include "StructMember.hpp"
|
||||
//#include "xo/reflect/struct/StructMember.hpp"
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
|
@ -5,12 +5,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "reflect/TypeDescrExtra.hpp"
|
||||
//#include "reflect/TaggedPtr.hpp"
|
||||
#include "reflect/EstablishTypeDescr.hpp"
|
||||
//#include "reflect/TaggedPtr.hpp"
|
||||
//#include <vector>
|
||||
//#include <memory>
|
||||
#include "xo/reflect/TypeDescrExtra.hpp"
|
||||
#include "xo/reflect/EstablishTypeDescr.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace reflect {
|
||||
|
|
@ -42,19 +38,19 @@ namespace xo {
|
|||
using target_t = VectorT;
|
||||
|
||||
static std::unique_ptr<StlVectorTdx> make() {
|
||||
return std::unique_ptr<StlVectorTdx>(new StlVectorTdx());
|
||||
return std::unique_ptr<StlVectorTdx>(new StlVectorTdx());
|
||||
} /*make*/
|
||||
|
||||
virtual uint32_t n_child(void * object) const override {
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
|
||||
return vec->size();
|
||||
return vec->size();
|
||||
} /*n_child*/
|
||||
|
||||
virtual TaggedPtr child_tp(uint32_t i, void * object) const override {
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
|
||||
return establish_most_derived_tp(&((*vec)[i]));
|
||||
return establish_most_derived_tp(&((*vec)[i]));
|
||||
} /*child_tp*/
|
||||
}; /*StlVectorTdx*/
|
||||
|
||||
|
|
@ -78,19 +74,19 @@ namespace xo {
|
|||
using target_t = std::vector<Element>;
|
||||
|
||||
static std::unique_ptr<StdVectorTdx> make() {
|
||||
return std::unique_ptr<StdVectorTdx>(new StdVectorTdx());
|
||||
return std::unique_ptr<StdVectorTdx>(new StdVectorTdx());
|
||||
} /*make*/
|
||||
|
||||
virtual uint32_t n_child(void * object) const override {
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
|
||||
return vec->size();
|
||||
return vec->size();
|
||||
} /*n_child*/
|
||||
|
||||
virtual TaggedPtr child_tp(uint32_t i, void * object) const override {
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
target_t * vec = reinterpret_cast<target_t *>(object);
|
||||
|
||||
return establish_most_derived_tp(&((*vec)[i]));
|
||||
return establish_most_derived_tp(&((*vec)[i]));
|
||||
}
|
||||
}; /*StdVectorTdx*/
|
||||
} /*namespace reflect*/
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
* author: Roland Conybeare, Aug 2022
|
||||
*/
|
||||
|
||||
#include "reflect/Reflect.hpp"
|
||||
#include "reflect/StructReflector.hpp"
|
||||
#include "xo/reflect/Reflect.hpp"
|
||||
#include "xo/reflect/StructReflector.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* author: Roland Conybeare, Aug 2022
|
||||
*/
|
||||
|
||||
#include "reflect/Reflect.hpp"
|
||||
#include "xo/reflect/Reflect.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
namespace xo {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* author: Roland Conybeare, Aug 2022
|
||||
*/
|
||||
|
||||
#include "reflect/Reflect.hpp"
|
||||
#include "xo/reflect/Reflect.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
namespace xo {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue