2024-04-25 21:45:41 +08:00
|
|
|
#pragma once
|
|
|
|
|
#include "any.h"
|
2024-05-12 23:44:11 +08:00
|
|
|
#include <unordered_map>
|
2024-04-25 21:45:41 +08:00
|
|
|
namespace refl {
|
2024-05-12 23:44:11 +08:00
|
|
|
|
2024-04-25 21:45:41 +08:00
|
|
|
using ConvertFunc = bool (*)(Any&, const Any&);
|
2024-05-12 23:44:11 +08:00
|
|
|
using ConvertMap = std::unordered_map<const UClass*, ConvertFunc>;
|
2024-04-25 21:45:41 +08:00
|
|
|
class Convert {
|
|
|
|
|
protected:
|
|
|
|
|
static ConvertMap BuildClassMap();
|
|
|
|
|
public:
|
|
|
|
|
static bool ToString(Any& dst,const Any& src);
|
|
|
|
|
static bool Construct(Any& dst, const Any& src);
|
|
|
|
|
inline static ConvertMap ClassMap = BuildClassMap();
|
|
|
|
|
};
|
|
|
|
|
}
|