typeindices.hpp: rename typeinfo_v to typelist_v

This commit is contained in:
Nekotekina 2019-09-18 15:30:45 +03:00
parent be61499790
commit c7bf6421f4
3 changed files with 14 additions and 14 deletions

View File

@ -538,7 +538,7 @@ namespace utils
// Recreate, also required if constructed without initialization.
void init()
{
if (!stx::typeinfo_v<typeinfo_base>.count())
if (!stx::typelist_v<typeinfo_base>.count())
{
return;
}
@ -546,12 +546,12 @@ namespace utils
// Recreate and copy some type information
if (m_map == nullptr)
{
m_map = new typemap_head[stx::typeinfo_v<typeinfo_base>.count()]();
m_map = new typemap_head[stx::typelist_v<typeinfo_base>.count()]();
}
else
{
auto type = stx::typeinfo_v<typeinfo_base>.begin();
auto _end = stx::typeinfo_v<typeinfo_base>.end();
auto type = stx::typelist_v<typeinfo_base>.begin();
auto _end = stx::typelist_v<typeinfo_base>.end();
for (uint i = 0; type != _end; i++, ++type)
{
@ -581,8 +581,8 @@ namespace utils
if (m_memory == nullptr)
{
// Determine total size, copy typeinfo
auto type = stx::typeinfo_v<typeinfo_base>.begin();
auto _end = stx::typeinfo_v<typeinfo_base>.end();
auto type = stx::typelist_v<typeinfo_base>.begin();
auto _end = stx::typelist_v<typeinfo_base>.end();
for (uint i = 0; type != _end; i++, ++type)
{
@ -611,7 +611,7 @@ namespace utils
utils::memory_commit(m_memory, m_total);
// Update pointers
for (uint i = 0, n = stx::typeinfo_v<typeinfo_base>.count(); i < n; i++)
for (uint i = 0, n = stx::typelist_v<typeinfo_base>.count(); i < n; i++)
{
if (m_map[i].m_count)
{

View File

@ -73,11 +73,11 @@ namespace stx
{
if (!m_list)
{
m_list = std::make_unique<void*[]>(stx::typeinfo_v<typeinfo>.count());
m_list = std::make_unique<void*[]>(stx::typelist_v<typeinfo>.count());
return;
}
for (auto& type : stx::typeinfo_v<typeinfo>)
for (auto& type : stx::typelist_v<typeinfo>)
{
type.destroy(m_list[type.index()]);
}
@ -86,7 +86,7 @@ namespace stx
// Default initialize all objects if possible and not already initialized
void init() noexcept
{
for (auto& type : stx::typeinfo_v<typeinfo>)
for (auto& type : stx::typelist_v<typeinfo>)
{
type.create(m_list[type.index()]);
}

View File

@ -112,15 +112,15 @@ namespace stx
// Global typecounter instance
template <typename Info>
inline type_counter<Info> typeinfo_v{};
inline type_counter<Info> typelist_v{};
template <typename Info>
type_info<Info>::type_info(Info info, decltype(sizeof(int))) noexcept
: Info(info)
, type(typeinfo_v<Info>.count())
, type(typelist_v<Info>.count())
{
// Update linked list
typeinfo_v<Info>.next->next = this;
typeinfo_v<Info>.next = this;
typelist_v<Info>.next->next = this;
typelist_v<Info>.next = this;
}
}