major msg -> obj file transfer refactor
mostly done, some things are hacky or not done
This commit is contained in:
31
solanaceae/tox_messages/obj_components_id.inl
Normal file
31
solanaceae/tox_messages/obj_components_id.inl
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "./obj_components.hpp"
|
||||
|
||||
#include <entt/core/type_info.hpp>
|
||||
|
||||
// TODO: move more central
|
||||
#define DEFINE_COMP_ID(x) \
|
||||
template<> \
|
||||
constexpr entt::id_type entt::type_hash<x>::value() noexcept { \
|
||||
using namespace entt::literals; \
|
||||
return #x##_hs; \
|
||||
} \
|
||||
template<> \
|
||||
constexpr std::string_view entt::type_name<x>::value() noexcept { \
|
||||
return #x; \
|
||||
}
|
||||
|
||||
// cross compile(r) stable ids
|
||||
|
||||
DEFINE_COMP_ID(ObjComp::Tox::FileID)
|
||||
DEFINE_COMP_ID(ObjComp::Tox::FileKind)
|
||||
|
||||
// tmp
|
||||
DEFINE_COMP_ID(ObjComp::Tox::TagIncomming)
|
||||
DEFINE_COMP_ID(ObjComp::Tox::TagOutgoing)
|
||||
|
||||
DEFINE_COMP_ID(ObjComp::Ephemeral::ToxTransferFriend)
|
||||
|
||||
#undef DEFINE_COMP_ID
|
||||
|
Reference in New Issue
Block a user