// Implement the GetPrivateStaticClass and the registration info but do not auto register the class. // This is primarily used by UnrealHeaderTool #define IMPLEMENT_CLASS_NO_AUTO_REGISTRATION(TClass) \ FClassRegistrationInfo Z_Registration_Info_UClass_##TClass; \ UClass* TClass::GetPrivateStaticClass() \ { \ if (!Z_Registration_Info_UClass_##TClass.InnerSingleton) \ { \ /* this could be handled with templates, but we want it external to avoid code bloat */ \ GetPrivateStaticClassBody( \ StaticPackage(), \ (TCHAR*)TEXT(#TClass) + 1 + ((StaticClassFlags & CLASS_Deprecated) ? 11 : 0), \ Z_Registration_Info_UClass_##TClass.InnerSingleton, \ StaticRegisterNatives##TClass, \ sizeof(TClass), \ alignof(TClass), \ (EClassFlags)TClass::StaticClassFlags, \ TClass::StaticClassCastFlags(), \ TClass::StaticConfigName(), \ (UClass::ClassConstructorType)InternalConstructor<TClass>, \ (UClass::ClassVTableHelperCtorCallerType)InternalVTableHelperCtorCaller<TClass>, \ &TClass::AddReferencedObjects, \ &TClass::Super::StaticClass, \ &TClass::WithinClass::StaticClass \ ); \ } \ return Z_Registration_Info_UClass_##TClass.InnerSingleton; \ }
/** * Shared function called from the various InitializePrivateStaticClass functions generated my the IMPLEMENT_CLASS macro. */ COREUOBJECT_API voidInitializePrivateStaticClass( class UClass* TClass_Super_StaticClass, class UClass* TClass_PrivateStaticClass, class UClass* TClass_WithinClass_StaticClass, const TCHAR* PackageName, const TCHAR* Name ) { TRACE_LOADTIME_CLASS_INFO(TClass_PrivateStaticClass, Name); NotifyRegistrationEvent(PackageName, Name, ENotifyRegistrationType::NRT_Class, ENotifyRegistrationPhase::NRP_Started);
/** * Force any base classes to be registered first, then call BaseRegister */ voidUStruct::RegisterDependencies() { Super::RegisterDependencies(); if (SuperStruct != NULL) { SuperStruct->RegisterDependencies(); } }
/// <summary> /// Adds the given registration information for the given object. Objects are either classes, structs, or enumerations. /// </summary> /// <param name="InOuterRegister">Returns a fully initialize instance of the object</param> /// <param name="InInnerRegister">Returns an allocated but uninitialized instance of the object. This is used only by UClass.</param> /// <param name="InPackageName">Name of the package</param> /// <param name="InName">Name of the object</param> /// <param name="InInfo">Persistent information about the object</param> /// <param name="InVersion">Version information for this incarnation of the object</param> /// <param name="DeprevatedFieldInfo">Deprecated factory object for the inner register for UClass. Either InInnerRegister or this value must be specified for UClass</param> boolAddRegistration(TType* (*InOuterRegister)(), TType* (*InInnerRegister)(), const TCHAR* InPackageName, const TCHAR* InName, TInfo& InInfo, const TVersion& InVersion, FFieldCompiledInInfo* DeprecatedFieldInfo) { #if WITH_RELOAD const FPackageAndNameKey Key = FPackageAndNameKey{ InPackageName, InName }; TInfo** ExistingInfo = InfoMap.Find(Key);
bool bAdd = true; if (ExistingInfo) { if (IReload* Reload = GetActiveReloadInterface()) { bAdd = Reload->GetEnableReinstancing(bHasChanged); } if (bAdd) { if (!bHasChanged) { // With live coding, the existing might be the same as the new info. // We still invoke the copy method to allow UClasses to clear the singletons. UpdateSingletons(InInfo, **ExistingInfo); } *ExistingInfo = &InInfo; } } else { InfoMap.Add(Key, &InInfo); } if (bAdd) { Registrations.Add(FRegistrant{ InOuterRegister, InInnerRegister, InPackageName, &InInfo, OldSingleton, DeprecatedFieldInfo, bHasChanged }); } return ExistingInfo != nullptr; #else Registrations.Add(FRegistrant{ InOuterRegister, InInnerRegister, InPackageName, &InInfo, DeprecatedFieldInfo }); returnfalse; #endif }
/// <param name="InOuterRegister">Returns a fully initialize instance of the object</param> /// <param name="InInnerRegister">Returns an allocated but uninitialized instance of the object. This is used only by UClass.</param>
virtualvoidStartupModule()override { // Register all classes that have been loaded so far. This is required for CVars to work. UClassRegisterAllCompiledInClasses();