From d0ccff195f49712ded3bc015b6619ba8ef685f2d Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 9 Oct 2023 14:03:10 -0400 Subject: [PATCH] bugfix: include path + reindent --- include/xo/reflect/TypeDrivenMap.hpp | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/include/xo/reflect/TypeDrivenMap.hpp b/include/xo/reflect/TypeDrivenMap.hpp index c38c8739..3eb42660 100644 --- a/include/xo/reflect/TypeDrivenMap.hpp +++ b/include/xo/reflect/TypeDrivenMap.hpp @@ -5,42 +5,42 @@ #pragma once -#include "reflect/TypeDescr.hpp" +#include "TypeDescr.hpp" #include namespace xo { - namespace reflect { - /* represents a map :: TypeId -> Value */ - template - class TypeDrivenMap { - public: - Value const * lookup(TypeId id) const { return this->lookup_slot(id); } + namespace reflect { + /* represents a map :: TypeId -> Value */ + template + class TypeDrivenMap { + public: + Value const * lookup(TypeId id) const { return this->lookup_slot(id); } - Value * require(TypeId id) { return this->require_slot(id); } - Value * require(TypeDescr td) { return this->require_slot(td->id()); } - - private: - Value const * lookup_slot(TypeId id) const { - if (this->contents_v_.size() <= id.id()) - return nullptr; + Value * require(TypeId id) { return this->require_slot(id); } + Value * require(TypeDescr td) { return this->require_slot(td->id()); } - return &(this->contents_v_[id.id()]); - } /*lookup_slot*/ + private: + Value const * lookup_slot(TypeId id) const { + if (this->contents_v_.size() <= id.id()) + return nullptr; - Value * require_slot(TypeId id) { - if (this->contents_v_.size() <= id.id()) - this->contents_v_.resize(id.id() + 1); + return &(this->contents_v_[id.id()]); + } /*lookup_slot*/ - return &(this->contents_v_[id.id()]); - } /*require_slot*/ + Value * require_slot(TypeId id) { + if (this->contents_v_.size() <= id.id()) + this->contents_v_.resize(id.id() + 1); - private: - /* since TypeId/s are unique, compact sequence numbers, - * can efficiently store mapping to Values using a vector indexed by TypeId - */ - std::vector contents_v_; - }; /*TypeDrivenMap*/ - } /*namespace reflect*/ + return &(this->contents_v_[id.id()]); + } /*require_slot*/ + + private: + /* since TypeId/s are unique, compact sequence numbers, + * can efficiently store mapping to Values using a vector indexed by TypeId + */ + std::vector contents_v_; + }; /*TypeDrivenMap*/ + } /*namespace reflect*/ } /*namespace xo*/