diff --git a/include/xo/reflect/vector/VectorTdx.hpp b/include/xo/reflect/vector/VectorTdx.hpp index 944c451..84e414b 100644 --- a/include/xo/reflect/vector/VectorTdx.hpp +++ b/include/xo/reflect/vector/VectorTdx.hpp @@ -9,87 +9,87 @@ #include "xo/reflect/EstablishTypeDescr.hpp" namespace xo { - namespace reflect { - /* Extra type-associated information for a vector/array. - */ - class VectorTdx : public TypeDescrExtra { - public: - /* named ctor idiom. create new instance for a vector type */ - //static std::unique_ptr make(); + namespace reflect { + /* Extra type-associated information for a vector/array. + */ + class VectorTdx : public TypeDescrExtra { + public: + /* named ctor idiom. create new instance for a vector type */ + //static std::unique_ptr make(); - // ----- Inherited from TypeDescrExtra ----- + // ----- Inherited from TypeDescrExtra ----- - virtual Metatype metatype() const override { return Metatype::mt_vector; } - virtual uint32_t n_child(void * object) const override = 0; - virtual TaggedPtr child_tp(uint32_t i, void * object) const override = 0; - /* (forbidden) */ - virtual std::string const & struct_member_name(uint32_t i) const override; - }; /*VectorTdx*/ + virtual Metatype metatype() const override { return Metatype::mt_vector; } + virtual uint32_t n_child(void * object) const override = 0; + virtual TaggedPtr child_tp(uint32_t i, void * object) const override = 0; + /* (forbidden) */ + virtual std::string const & struct_member_name(uint32_t i) const override; + }; /*VectorTdx*/ - // ----- StlVectorTdx ----- + // ----- StlVectorTdx ----- - /* require: - * - VectorT.size() - * - VectorT[int] :: lvalue - */ - template - class StlVectorTdx : public VectorTdx { - public: - using target_t = VectorT; + /* require: + * - VectorT.size() + * - VectorT[int] :: lvalue + */ + template + class StlVectorTdx : public VectorTdx { + public: + using target_t = VectorT; - static std::unique_ptr make() { - return std::unique_ptr(new StlVectorTdx()); - } /*make*/ + static std::unique_ptr make() { + return std::unique_ptr(new StlVectorTdx()); + } /*make*/ - virtual uint32_t n_child(void * object) const override { - target_t * vec = reinterpret_cast(object); + virtual uint32_t n_child(void * object) const override { + target_t * vec = reinterpret_cast(object); - return vec->size(); - } /*n_child*/ + return vec->size(); + } /*n_child*/ - virtual TaggedPtr child_tp(uint32_t i, void * object) const override { - target_t * vec = reinterpret_cast(object); + virtual TaggedPtr child_tp(uint32_t i, void * object) const override { + target_t * vec = reinterpret_cast(object); - return establish_most_derived_tp(&((*vec)[i])); - } /*child_tp*/ - }; /*StlVectorTdx*/ + return establish_most_derived_tp(&((*vec)[i])); + } /*child_tp*/ + }; /*StlVectorTdx*/ - // ----- std::array ----- + // ----- std::array ----- - /* coordinates with EstablishTdx>::make(), - * see [reflect/Reflect.hpp] - */ + /* coordinates with EstablishTdx>::make(), + * see [reflect/Reflect.hpp] + */ - template - using StdArrayTdx = StlVectorTdx>; + template + using StdArrayTdx = StlVectorTdx>; - // ----- std::vector ----- + // ----- std::vector ----- - /* coordinates with EstablishTdx>::make() - * see [reflect/Reflect.hpp] - */ - template - class StdVectorTdx : public VectorTdx { - public: - using target_t = std::vector; + /* coordinates with EstablishTdx>::make() + * see [reflect/Reflect.hpp] + */ + template + class StdVectorTdx : public VectorTdx { + public: + using target_t = std::vector; - static std::unique_ptr make() { - return std::unique_ptr(new StdVectorTdx()); - } /*make*/ + static std::unique_ptr make() { + return std::unique_ptr(new StdVectorTdx()); + } /*make*/ - virtual uint32_t n_child(void * object) const override { - target_t * vec = reinterpret_cast(object); + virtual uint32_t n_child(void * object) const override { + target_t * vec = reinterpret_cast(object); - return vec->size(); - } /*n_child*/ + return vec->size(); + } /*n_child*/ - virtual TaggedPtr child_tp(uint32_t i, void * object) const override { - target_t * vec = reinterpret_cast(object); + virtual TaggedPtr child_tp(uint32_t i, void * object) const override { + target_t * vec = reinterpret_cast(object); - return establish_most_derived_tp(&((*vec)[i])); - } - }; /*StdVectorTdx*/ - } /*namespace reflect*/ + return establish_most_derived_tp(&((*vec)[i])); + } + }; /*StdVectorTdx*/ + } /*namespace reflect*/ } /*namespace xo*/