(18)UE5 接口里的两个宏 GENERATED_UINTERFACE_BODY() 与 GENERATED_IINTERFACE_BODY()

(34)先是 GENERATED_UINTERFACE_BODY( )

cpp 复制代码
UINTERFACE(MinimalAPI, meta=(CannotImplementInterfaceInBlueprint))
class UNavAgentInterface : public UInterface  // GENERATED_UINTERFACE_BODY()
{
	// GENERATED_UINTERFACE_BODY() 这个宏展开后,就是下面的代码
	__pragma (warning(push)) 
	__pragma (warning(disable: 4995)) 
	__pragma (warning(disable: 4996)) 
private: 
	static void StaticRegisterNativesUNavAgentInterface(); 

	friend struct Z_Construct_UClass_UNavAgentInterface_Statics; 

public: 
private: 
	UNavAgentInterface& operator=(UNavAgentInterface&&); 

	UNavAgentInterface& operator=(const UNavAgentInterface&); 

	__declspec(dllimport) static UClass* GetPrivateStaticClass(); 

public: 
	static constexpr EClassFlags StaticClassFlags = EClassFlags((CLASS_Abstract | CLASS_Interface | CLASS_Intrinsic)); 
	
	typedef UInterface Super; 
	typedef UNavAgentInterface ThisClass;

	inline static UClass* StaticClass() {	return GetPrivateStaticClass();	} 
	
	inline static const TCHAR* StaticPackage() { return L"/Script/Engine";	} 
	
	inline static EClassCastFlags StaticClassCastFlags() {	return CASTCLASS_None;	} 
	
	inline 
	void* operator new(const size_t InSize, EInternal InInternalOnly, 
		UObject* InOuter = (UObject*)GetTransientPackage(), 
		FName InName = NAME_None, EObjectFlags InSetFlags = RF_NoFlags) {
		return StaticAllocateObject(StaticClass(), InOuter, InName, InSetFlags);
	} 
	
	inline void* operator new(const size_t InSize, EInternal* InMem) {	return (void*)InMem; } 
	
	inline void operator delete(void* InMem) {	::operator delete(InMem);	} 
	
	friend FArchive& operator<<(FArchive& Ar, UNavAgentInterface*& Res) { return Ar << (UObject*&)Res;	} 
	
	friend void operator<<(FStructuredArchive::FSlot InSlot, UNavAgentInterface*& Res) { InSlot << (UObject*&)Res;	} 
	
	__declspec(dllimport) UNavAgentInterface(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); 
	
	static void __DefaultConstructor(const FObjectInitializer& X) {	new((EInternal*)X.GetObj())UNavAgentInterface(X); } 
	
	__declspec(dllimport) UNavAgentInterface(FVTableHelper& Helper);;
	
	static UObject* __VTableCtorCaller(FVTableHelper& Helper) {
		return new (EC_InternalUseOnlyConstructor, (UObject*)GetTransientPackage(), 
			NAME_None, RF_NeedLoad | RF_ClassDefaultObject | RF_TagGarbageTemp) UNavAgentInterface(Helper);
	}; 

private: 
	UNavAgentInterface(UNavAgentInterface&&); 
	UNavAgentInterface(const UNavAgentInterface&); 

public: 
	__declspec(dllimport) virtual ~UNavAgentInterface(); 
	__pragma (warning(pop));
}; // 接口的双反射系统

(35) 原版代码,有这两个宏

(36) 宏展开

(37)

谢谢

相关推荐
四代水门13 天前
UE5实现客户端与服务器时间同步
ue5
智海深蓝15 天前
海上平行战场:态势模拟三维可视化平台
3d·ue5
_守一16 天前
UE5 ListView记录
ue5
成都渲染101云渲染666616 天前
CR15新功能介绍以及CR15云渲染流程
ue5·图形渲染·blender·maya·corona
一锅炖出任易仙17 天前
创梦汤锅学习日记day30
学习·ai·ue5·游戏引擎
OSwich17 天前
【UE5学习笔记】UMG中控件命名规范
笔记·学习·ue5
一锅炖出任易仙18 天前
创梦汤锅学习日记day29
学习·ai·ue5·游戏引擎
吴梓穆18 天前
UE5 C++ 注册 开始重叠和结束重叠事件
开发语言·c++·ue5
妙为19 天前
unreal engine5(UE5)中使用Rider
ue5·游戏引擎·虚幻·rider
归真仙人21 天前
【UE】LineTraceByProfile
ue5·游戏引擎·ue4·unreal engine