本文整理汇总了C++中UClass::GetOutermost方法的典型用法代码示例。如果您正苦于以下问题:C++ UClass::GetOutermost方法的具体用法?C++ UClass::GetOutermost怎么用?C++ UClass::GetOutermost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UClass
的用法示例。
在下文中一共展示了UClass::GetOutermost方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildObjectNameAreaSelectionLabel
void SDetailNameArea::BuildObjectNameAreaSelectionLabel( TSharedRef< SHorizontalBox > SelectionLabelBox, const TWeakObjectPtr<UObject> ObjectWeakPtr, const int32 NumSelectedObjects )
{
check( NumSelectedObjects > 1 || ObjectWeakPtr.IsValid() );
if( NumSelectedObjects == 1 )
{
UClass* ObjectClass = ObjectWeakPtr.Get()->GetClass();
if( ObjectClass != nullptr )
{
SelectionLabelBox->AddSlot()
.AutoWidth()
.VAlign( VAlign_Center )
.HAlign( HAlign_Left )
.Padding( 1.0f, 1.0f, 0.0f, 0.0f )
[
FEditorClassUtils::GetDocumentationLinkWidget(ObjectClass)
];
if( ObjectClass && ObjectClass->ClassGeneratedBy == nullptr && ObjectClass->GetOutermost() )
{
const FString ModuleName = FPackageName::GetShortName(ObjectClass->GetOutermost()->GetFName());
FModuleStatus PackageModuleStatus;
if(FModuleManager::Get().QueryModule(*ModuleName, PackageModuleStatus))
{
if( PackageModuleStatus.bIsGameModule )
{
SelectionLabelBox->AddSlot()
.AutoWidth()
.VAlign(VAlign_Center)
.HAlign(HAlign_Left)
.Padding(6.0f, 1.0f, 0.0f, 0.0f)
[
FEditorClassUtils::GetSourceLink(ObjectClass, ObjectWeakPtr)
];
}
}
}
}
}
else
{
const FText SelectionText = FText::Format( LOCTEXT("MultipleObjectsSelectedFmt", "{0} objects"), FText::AsNumber(NumSelectedObjects) );
SelectionLabelBox->AddSlot()
.VAlign(VAlign_Center)
.HAlign( HAlign_Left )
.FillWidth( 1.0f )
[
SNew(STextBlock)
.Text( SelectionText )
];
}
}
示例2: UpdateBytecodeReferences
void FBlueprintCompileReinstancer::UpdateBytecodeReferences()
{
BP_SCOPED_COMPILER_EVENT_STAT(EKismetReinstancerStats_UpdateBytecodeReferences);
if(ClassToReinstance != NULL)
{
TMap<UObject*, UObject*> FieldMappings;
GenerateFieldMappings(FieldMappings);
for( auto DependentBP = Dependencies.CreateIterator(); DependentBP; ++DependentBP )
{
UClass* BPClass = (*DependentBP)->GeneratedClass;
// Skip cases where the class is junk, or haven't finished serializing in yet
if( (BPClass == ClassToReinstance)
|| (BPClass->GetOutermost() == GetTransientPackage())
|| BPClass->HasAnyClassFlags(CLASS_NewerVersionExists)
|| (BPClass->ClassGeneratedBy && BPClass->ClassGeneratedBy->HasAnyFlags(RF_NeedLoad|RF_BeingRegenerated)) )
{
continue;
}
// For each function defined in this blueprint, run through the bytecode, and update any refs from the old properties to the new
for( TFieldIterator<UFunction> FuncIter(BPClass, EFieldIteratorFlags::ExcludeSuper); FuncIter; ++FuncIter )
{
UFunction* CurrentFunction = *FuncIter;
if( CurrentFunction->Script.Num() > 0 )
{
FArchiveReplaceObjectRef<UObject> ReplaceAr(CurrentFunction, FieldMappings, /*bNullPrivateRefs=*/ false, /*bIgnoreOuterRef=*/ true, /*bIgnoreArchetypeRef=*/ true);
}
}
}
}
}
示例3: AddStaticFunctionsForDependencies
static void AddStaticFunctionsForDependencies(FEmitterLocalContext& Context)
{
auto SourceClass = Context.GetCurrentlyGeneratedClass();
auto OriginalClass = Context.Dependencies.FindOriginalClass(SourceClass);
const FString CppClassName = FEmitHelper::GetCppName(OriginalClass);
// __StaticDependenciesAssets
Context.AddLine(FString::Printf(TEXT("void %s::__StaticDependenciesAssets(TArray<FBlueprintDependencyData>& AssetsToLoad)"), *CppClassName));
Context.AddLine(TEXT("{"));
Context.IncreaseIndent();
auto CreateAssetToLoadString = [&](const UObject* AssetObj) -> FString
{
UClass* AssetType = AssetObj->GetClass();
if (AssetType->IsChildOf<UUserDefinedEnum>())
{
AssetType = UEnum::StaticClass();
}
else if (AssetType->IsChildOf<UUserDefinedStruct>())
{
AssetType = UScriptStruct::StaticClass();
}
else if (AssetType->IsChildOf<UBlueprintGeneratedClass>() && Context.Dependencies.WillClassBeConverted(CastChecked<UBlueprintGeneratedClass>(AssetObj)))
{
AssetType = UDynamicClass::StaticClass();
}
return FString::Printf(TEXT("AssetsToLoad.Add({FName(TEXT(\"%s\")), FName(TEXT(\"%s\")), FName(TEXT(\"%s\")), FName(TEXT(\"%s\"))});")
, *AssetObj->GetOutermost()->GetPathName()
, *AssetObj->GetName()
, *AssetType->GetOutermost()->GetPathName()
, *AssetType->GetName());
};
for (UObject* LocAsset : Context.Dependencies.Assets)
{
Context.AddLine(CreateAssetToLoadString(LocAsset));
}
for (UObject* LocAsset : Context.Dependencies.ConvertedClasses)
{
if (!Context.Dependencies.Assets.Contains(LocAsset))
{
Context.AddLine(CreateAssetToLoadString(LocAsset));
}
}
Context.DecreaseIndent();
Context.AddLine(TEXT("}"));
// Register Helper Struct
const FString RegisterHelperName = FString::Printf(TEXT("FRegisterHelper__%s"), *CppClassName);
Context.AddLine(FString::Printf(TEXT("struct %s"), *RegisterHelperName));
Context.AddLine(TEXT("{"));
Context.IncreaseIndent();
Context.AddLine(FString::Printf(TEXT("%s()"), *RegisterHelperName));
Context.AddLine(TEXT("{"));
Context.IncreaseIndent();
Context.AddLine(FString::Printf(
TEXT("FConvertedBlueprintsDependencies::Get().RegisterClass(TEXT(\"%s\"), &%s::__StaticDependenciesAssets);")
, *OriginalClass->GetOutermost()->GetPathName()
, *CppClassName));
Context.DecreaseIndent();
Context.AddLine(TEXT("}"));
Context.AddLine(FString::Printf(TEXT("static %s Instance;"), *RegisterHelperName));
Context.DecreaseIndent();
Context.AddLine(TEXT("};"));
Context.AddLine(FString::Printf(TEXT("%s %s::Instance;"), *RegisterHelperName, *RegisterHelperName));
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:73,代码来源:BlueprintCompilerCppBackendValueHelper.cpp
示例4: Serialize
void UAssetClassProperty::Serialize( FArchive& Ar )
{
Super::Serialize( Ar );
Ar << MetaClass;
if( !(MetaClass||HasAnyFlags(RF_ClassDefaultObject)) )
{
// If we failed to load the MetaClass and we're not a CDO, that means we relied on a class that has been removed or doesn't exist.
// The most likely cause for this is either an incomplete recompile, or if content was migrated between games that had native class dependencies
// that do not exist in this game. We allow blueprint classes to continue, because compile on load will error out, and stub the class that was using it
UClass* TestClass = dynamic_cast<UClass*>(GetOwnerStruct());
if( TestClass && TestClass->HasAllClassFlags(CLASS_Native) && !TestClass->HasAllClassFlags(CLASS_NewerVersionExists) && (TestClass->GetOutermost() != GetTransientPackage()) )
{
checkf(false, TEXT("Class property tried to serialize a missing class. Did you remove a native class and not fully recompile?"));
}
}
}
示例5: IsStaleFieldAction
//------------------------------------------------------------------------------
bool FBlueprintNodeSpawnerUtils::IsStaleFieldAction(UBlueprintNodeSpawner const* BlueprintAction)
{
bool bHasStaleAssociatedField= false;
const UField* AssociatedField = GetAssociatedField(BlueprintAction);
if (AssociatedField != nullptr)
{
UClass* ClassOwner = AssociatedField->GetOwnerClass();
if (ClassOwner != nullptr)
{
// check to see if this field belongs to a TRASH or REINST class,
// maybe to a class that was thrown out because of a hot-reload?
bHasStaleAssociatedField = ClassOwner->HasAnyClassFlags(CLASS_NewerVersionExists) || (ClassOwner->GetOutermost() == GetTransientPackage());
}
}
return bHasStaleAssociatedField;
}
示例6: Serialize
/** Manipulates the data referenced by this UProperty */
void UInterfaceProperty::Serialize( FArchive& Ar )
{
Super::Serialize( Ar );
Ar << InterfaceClass;
#if USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
if (Ar.IsLoading() || Ar.IsObjectReferenceCollector())
{
if (ULinkerPlaceholderClass* PlaceholderClass = Cast<ULinkerPlaceholderClass>(InterfaceClass))
{
PlaceholderClass->AddReferencingProperty(this);
}
}
#endif // USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
if ( !InterfaceClass && !HasAnyFlags(RF_ClassDefaultObject) )
{
// If we failed to load the InterfaceClass and we're not a CDO, that means we relied on a class that has been removed or doesn't exist.
// The most likely cause for this is either an incomplete recompile, or if content was migrated between games that had native class dependencies
// that do not exist in this game. We allow blueprint classes to continue, because compile-on-load will error out, and stub the class that was using it
UClass* TestClass = dynamic_cast<UClass*>(GetOwnerStruct());
if( TestClass && TestClass->HasAllClassFlags(CLASS_Native) && !TestClass->HasAllClassFlags(CLASS_NewerVersionExists) && (TestClass->GetOutermost() != GetTransientPackage()) )
{
checkf(false, TEXT("Interface property tried to serialize a missing interface. Did you remove a native class and not fully recompile?"));
}
}
}