#include "hash_map.hh"
#include "xxhash.hh"
#include <memory>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <utility>
#include <vector>
Go to the source code of this file.
|
namespace | openmsx |
| This file implemented 3 utility functions:
|
|
|
#define | REGISTER_CONSTRUCTOR_ARGS_0(C) |
|
#define | REGISTER_CONSTRUCTOR_ARGS_1(C, T1) |
|
#define | REGISTER_CONSTRUCTOR_ARGS_2(C, T1, T2) |
|
#define | REGISTER_CONSTRUCTOR_ARGS_3(C, T1, T2, T3) |
|
#define | REGISTER_POLYMORPHIC_CLASS_HELPER(B, C, N) |
|
#define | REGISTER_POLYMORPHIC_INITIALIZER_HELPER(B, C, N) |
|
#define | REGISTER_BASE_NAME_HELPER(B, N) |
|
#define | REGISTER_POLYMORPHIC_CLASS(BASE, CLASS, NAME) |
|
#define | REGISTER_POLYMORPHIC_CLASS_1(BASE, CLASS, NAME, TYPE1) |
|
#define | REGISTER_POLYMORPHIC_CLASS_2(BASE, CLASS, NAME, TYPE1, TYPE2) |
|
#define | REGISTER_POLYMORPHIC_CLASS_3(BASE, CLASS, NAME, TYPE1, TYPE2, TYPE3) |
|
#define | REGISTER_BASE_CLASS(CLASS, NAME) |
|
#define | REGISTER_BASE_CLASS_1(CLASS, NAME, TYPE1) |
|
#define | REGISTER_BASE_CLASS_2(CLASS, NAME, TYPE1, TYPE2) |
|
#define | REGISTER_BASE_CLASS_3(CLASS, NAME, TYPE1, TYPE2, TYPE3) |
|
#define | REGISTER_POLYMORPHIC_INITIALIZER(BASE, CLASS, NAME) REGISTER_POLYMORPHIC_INITIALIZER_HELPER(BASE,CLASS,NAME) |
|
#define | SERIALIZE_CLASS_VERSION(CLASS, VERSION) |
|
◆ REGISTER_BASE_CLASS
#define REGISTER_BASE_CLASS |
( |
|
CLASS, |
|
|
|
NAME |
|
) |
| |
◆ REGISTER_BASE_CLASS_1
#define REGISTER_BASE_CLASS_1 |
( |
|
CLASS, |
|
|
|
NAME, |
|
|
|
TYPE1 |
|
) |
| |
◆ REGISTER_BASE_CLASS_2
#define REGISTER_BASE_CLASS_2 |
( |
|
CLASS, |
|
|
|
NAME, |
|
|
|
TYPE1, |
|
|
|
TYPE2 |
|
) |
| |
Value:
REGISTER_CONSTRUCTOR_ARGS_2(CLASS,TYPE1,TYPE2)
Definition at line 347 of file serialize_meta.hh.
◆ REGISTER_BASE_CLASS_3
#define REGISTER_BASE_CLASS_3 |
( |
|
CLASS, |
|
|
|
NAME, |
|
|
|
TYPE1, |
|
|
|
TYPE2, |
|
|
|
TYPE3 |
|
) |
| |
Value:
REGISTER_CONSTRUCTOR_ARGS_3(CLASS,TYPE1,TYPE2,TYPE3)
Definition at line 351 of file serialize_meta.hh.
◆ REGISTER_BASE_NAME_HELPER
#define REGISTER_BASE_NAME_HELPER |
( |
|
B, |
|
|
|
N |
|
) |
| |
Value:template<>
struct BaseClassName<
B> \
{
static const char*
getName() {
static constexpr const char*
const name = N;
return name; } };
std::string getName(KeyCode keyCode)
Translate key code to key name.
Definition at line 316 of file serialize_meta.hh.
◆ REGISTER_CONSTRUCTOR_ARGS_0
#define REGISTER_CONSTRUCTOR_ARGS_0 |
( |
|
C | ) |
|
Value:template<>
struct PolymorphicConstructorArgs<
C> \
{ using type = std::tuple<>; };
Definition at line 271 of file serialize_meta.hh.
◆ REGISTER_CONSTRUCTOR_ARGS_1
#define REGISTER_CONSTRUCTOR_ARGS_1 |
( |
|
C, |
|
|
|
T1 |
|
) |
| |
Value:template<>
struct PolymorphicConstructorArgs<
C> \
{ using type = std::tuple<T1>; };
Definition at line 275 of file serialize_meta.hh.
◆ REGISTER_CONSTRUCTOR_ARGS_2
#define REGISTER_CONSTRUCTOR_ARGS_2 |
( |
|
C, |
|
|
|
T1, |
|
|
|
T2 |
|
) |
| |
Value:template<>
struct PolymorphicConstructorArgs<
C> \
{ using type = std::tuple<T1,T2>; };
Definition at line 279 of file serialize_meta.hh.
◆ REGISTER_CONSTRUCTOR_ARGS_3
#define REGISTER_CONSTRUCTOR_ARGS_3 |
( |
|
C, |
|
|
|
T1, |
|
|
|
T2, |
|
|
|
T3 |
|
) |
| |
Value:template<>
struct PolymorphicConstructorArgs<
C> \
{ using type = std::tuple<T1,T2,T3>; };
Definition at line 283 of file serialize_meta.hh.
◆ REGISTER_POLYMORPHIC_CLASS
#define REGISTER_POLYMORPHIC_CLASS |
( |
|
BASE, |
|
|
|
CLASS, |
|
|
|
NAME |
|
) |
| |
◆ REGISTER_POLYMORPHIC_CLASS_1
#define REGISTER_POLYMORPHIC_CLASS_1 |
( |
|
BASE, |
|
|
|
CLASS, |
|
|
|
NAME, |
|
|
|
TYPE1 |
|
) |
| |
◆ REGISTER_POLYMORPHIC_CLASS_2
#define REGISTER_POLYMORPHIC_CLASS_2 |
( |
|
BASE, |
|
|
|
CLASS, |
|
|
|
NAME, |
|
|
|
TYPE1, |
|
|
|
TYPE2 |
|
) |
| |
Value:
REGISTER_CONSTRUCTOR_ARGS_2(CLASS,TYPE1,TYPE2)
Definition at line 331 of file serialize_meta.hh.
◆ REGISTER_POLYMORPHIC_CLASS_3
#define REGISTER_POLYMORPHIC_CLASS_3 |
( |
|
BASE, |
|
|
|
CLASS, |
|
|
|
NAME, |
|
|
|
TYPE1, |
|
|
|
TYPE2, |
|
|
|
TYPE3 |
|
) |
| |
Value:
REGISTER_CONSTRUCTOR_ARGS_3(CLASS,TYPE1,TYPE2,TYPE3)
Definition at line 335 of file serialize_meta.hh.
◆ REGISTER_POLYMORPHIC_CLASS_HELPER
#define REGISTER_POLYMORPHIC_CLASS_HELPER |
( |
|
B, |
|
|
|
C, |
|
|
|
N |
|
) |
| |
Value:static_assert(std::is_base_of_v<B,C>, "must be base and sub class"); \
static
const RegisterLoaderHelper<MemInputArchive, C> registerHelper3##
C(N); \
static
const RegisterSaverHelper <MemOutputArchive, C> registerHelper4##
C(N); \
static
const RegisterLoaderHelper<XmlInputArchive, C> registerHelper5##
C(N); \
static
const RegisterSaverHelper <XmlOutputArchive, C> registerHelper6##
C(N); \
template<>
struct PolymorphicBaseClass<
C> {
using type =
B; };
Definition at line 300 of file serialize_meta.hh.
◆ REGISTER_POLYMORPHIC_INITIALIZER
◆ REGISTER_POLYMORPHIC_INITIALIZER_HELPER
#define REGISTER_POLYMORPHIC_INITIALIZER_HELPER |
( |
|
B, |
|
|
|
C, |
|
|
|
N |
|
) |
| |
Value:static_assert(std::is_base_of_v<B,C>, "must be base and sub class"); \
static
const RegisterInitializerHelper<MemInputArchive, C> registerHelper3##
C(N); \
static
const RegisterSaverHelper <MemOutputArchive, C> registerHelper4##
C(N); \
static
const RegisterInitializerHelper<XmlInputArchive, C> registerHelper5##
C(N); \
static
const RegisterSaverHelper <XmlOutputArchive, C> registerHelper6##
C(N); \
template<>
struct PolymorphicBaseClass<
C> {
using type =
B; };
Definition at line 308 of file serialize_meta.hh.
◆ SERIALIZE_CLASS_VERSION
#define SERIALIZE_CLASS_VERSION |
( |
|
CLASS, |
|
|
|
VERSION |
|
) |
| |
Value:template<> struct SerializeClassVersion<CLASS> \
{ \
static constexpr unsigned value = VERSION; \
};
Definition at line 380 of file serialize_meta.hh.