split classes into files

This commit is contained in:
2019-03-07 18:46:00 +01:00
parent 8a581ed59e
commit 3e16341cf2
10 changed files with 1048 additions and 813 deletions

23
src/serializer.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "pch.h"
#include "serializer.h"
Serializer::Type::Ref Serializer::instanciate(const std::string& key)
{
if (m_ctor_table.find(key) != m_ctor_table.end())
return m_ctor_table[key]();
return nullptr;
}
std::map<std::string /*key*/, std::function<Serializer::Type::Ref()>> Serializer::m_ctor_table =
{
{ "VlLs", [] { return std::make_shared<Serializer::List>(); } },
{ "TEXT", [] { return std::make_shared<Serializer::String>(); } },
{ "Objc", [] { return std::make_shared<Serializer::Descriptor>(); } },
{ "UntF", [] { return std::make_shared<Serializer::UnitFloat>(); } },
{ "bool", [] { return std::make_shared<Serializer::Boolean>(); } },
{ "long", [] { return std::make_shared<Serializer::Integer>(); } },
{ "doub", [] { return std::make_shared<Serializer::Double>(); } },
{ "enum", [] { return std::make_shared<Serializer::Enum>(); } },
{ "tdta", [] { return std::make_shared<Serializer::RawData>(); } },
};