zengine-old/engine/3rdparty/zlib/include/refl/detail/field.h

27 lines
547 B
C
Raw Normal View History

2024-04-03 17:58:02 +08:00
#pragma once
#include "UTemplate/Type.hpp"
#include <variant>
#include <functional>
using Ubpa::Name;
using Ubpa::type_name;
namespace refl {
class UClass;
2024-04-06 23:50:17 +08:00
using Offset = uint32_t;
2024-04-07 21:15:34 +08:00
using Method = void(*)(...);
2024-04-05 16:03:58 +08:00
enum FieldFlag:uint32_t {
2024-04-06 23:50:17 +08:00
FIELD_NONE_FLAG = 0,
FIELD_MEMBER_FLAG = 1 << 0,
FIELD_ATTRIBUTE_FLAG = 1 << 1,
FIELD_METHOD_FLAG = 1 << 2,
2024-04-05 16:03:58 +08:00
};
2024-04-03 17:58:02 +08:00
struct FieldPtr {
using Data = std::variant<
2024-04-07 21:15:34 +08:00
Offset, // offset
Method // method
2024-04-03 17:58:02 +08:00
>;
Name name;
const UClass* type;
Data data;
2024-04-05 16:03:58 +08:00
uint32_t flag;
2024-04-03 17:58:02 +08:00
};
}