本文整理汇总了C++中TArray::CreateIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ TArray::CreateIterator方法的具体用法?C++ TArray::CreateIterator怎么用?C++ TArray::CreateIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TArray
的用法示例。
在下文中一共展示了TArray::CreateIterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendFilename
static void AppendFilename(const FString& InFilename, TArray<FString>& OutBeautifiedNames, TArray<FString>& OutTestCommands)
{
// append the filename to the commands we have passed in
for(auto Iter(OutBeautifiedNames.CreateIterator()); Iter; Iter++)
{
*Iter = FString::Printf(TEXT("%s (%s)"), *InFilename, **Iter);
}
for(auto Iter(OutTestCommands.CreateIterator()); Iter; Iter++)
{
*Iter += TEXT(" ");
*Iter += InFilename;
}
}
示例2: ReplaceSkeleton
bool UAnimationAsset::ReplaceSkeleton(USkeleton* NewSkeleton, bool bConvertSpaces/*=false*/)
{
// if it's not same
if (NewSkeleton != Skeleton)
{
// get all sequences that need to change
TArray<UAnimSequence*> AnimSeqsToReplace;
if (UAnimSequence* AnimSequence = Cast<UAnimSequence>(this))
{
AnimSeqsToReplace.AddUnique(AnimSequence);
}
if (GetAllAnimationSequencesReferred(AnimSeqsToReplace))
{
for (auto Iter = AnimSeqsToReplace.CreateIterator(); Iter; ++Iter)
{
UAnimSequence* AnimSeq = *Iter;
if (AnimSeq && AnimSeq->Skeleton != NewSkeleton)
{
AnimSeq->RemapTracksToNewSkeleton(NewSkeleton, bConvertSpaces);
}
}
}
SetSkeleton(NewSkeleton);
PostEditChange();
MarkPackageDirty();
return true;
}
return false;
}
示例3: GetStateMachineMenuItems
void UAnimationGraphSchema::GetStateMachineMenuItems(FGraphContextMenuBuilder& ContextMenuBuilder) const
{
// Show state machine helpers
if ((ContextMenuBuilder.FromPin == NULL) || ((ContextMenuBuilder.FromPin->Direction == EGPD_Input) && (ContextMenuBuilder.FromPin->PinType.PinCategory == PC_Float)))
{
FString StateCategory(TEXT("State Machines"));
// Create the additional entries to get state information
TArray<UAnimStateNode*> States;
UBlueprint* CurrentBlueprint = FBlueprintEditorUtils::FindBlueprintForGraphChecked(ContextMenuBuilder.CurrentGraph);
FBlueprintEditorUtils::GetAllNodesOfClass(CurrentBlueprint, /*out*/ States);
for (auto StateIt = States.CreateIterator(); StateIt; ++StateIt)
{
UAnimStateNode* StateNode = *StateIt;
UK2Node_TransitionRuleGetter* NodeTemplate = ContextMenuBuilder.CreateTemplateNode<UK2Node_TransitionRuleGetter>();
NodeTemplate->AssociatedStateNode = StateNode;
NodeTemplate->GetterType = ETransitionGetter::ArbitraryState_GetBlendWeight;
const FString OwnerName = StateNode->GetOuter()->GetName();
const FString Title = FString::Printf(TEXT("Current %s for state '%s.%s'"), *UK2Node_TransitionRuleGetter::GetFriendlyName(NodeTemplate->GetterType), *OwnerName, *StateNode->GetStateName());
TSharedPtr<FEdGraphSchemaAction_K2NewNode> Action = FK2ActionMenuBuilder::AddNewNodeAction(ContextMenuBuilder, StateCategory, Title, NodeTemplate->GetTooltip(), 0, NodeTemplate->GetKeywords());
Action->NodeTemplate = NodeTemplate;
}
}
}
示例4:
TSharedPtr< FSurvey > FEpicSurvey::GetBranchSurvey( const FString& Filename )
{
TSharedPtr< FSurvey >* Survey = BranchSurveys.Find(Filename);
if( Survey == NULL )
{
TArray<FCloudFileHeader> Files;
TitleCloud->GetFileList(Files);
for( auto FileIt=Files.CreateIterator(); FileIt; ++FileIt )
{
if( FileIt->FileName == Filename )
{
if( TitleCloud->ReadFile(FileIt->DLName) )
{
Survey = BranchSurveys.Find(Filename);
if( Survey )
{
return *Survey;
}
}
return TSharedPtr< FSurvey >();
}
}
}
return *Survey;
}
示例5: InitializeSourceControlProviders
void FSourceControlModule::InitializeSourceControlProviders()
{
int32 SourceControlCount = IModularFeatures::Get().GetModularFeatureImplementationCount(SourceControlFeatureName);
if( SourceControlCount > 0 )
{
FString PreferredSourceControlProvider = SourceControlSettings.GetProvider();
TArray<ISourceControlProvider*> Providers = IModularFeatures::Get().GetModularFeatureImplementations<ISourceControlProvider>(SourceControlFeatureName);
for(auto It(Providers.CreateIterator()); It; It++)
{
ISourceControlProvider* Provider = *It;
if(PreferredSourceControlProvider == Provider->GetName().ToString())
{
CurrentSourceControlProvider = Provider;
break;
}
}
// no provider found of this name, default to the first one
if( CurrentSourceControlProvider == NULL )
{
CurrentSourceControlProvider = &DefaultSourceControlProvider;
}
}
check(CurrentSourceControlProvider);
CurrentSourceControlProvider->Init(false); // Don't force a connection here, as its synchronous. Let the user establish a connection.
}
示例6: LoadCustomResponses
int32 UCollisionProfile::LoadCustomResponses(FCollisionResponseTemplate& Template, const UEnum* CollisionChannelEnum, TArray<FResponseChannel>& CustomResponses) const
{
int32 NumOfItemsCustomized=0;
// now loads all custom setups
for (auto ChannelIter = CustomResponses.CreateIterator(); ChannelIter; ++ChannelIter)
{
FResponseChannel& Custom = *ChannelIter;
bool bValueFound=false;
int32 EnumIndex = ReturnContainerIndexFromChannelName(Custom.Channel);
if (EnumIndex != INDEX_NONE)
{
// use the enum index to set to response to channel
Template.ResponseToChannels.EnumArray[EnumIndex] = Custom.Response;
bValueFound = true;
++NumOfItemsCustomized;
}
else
{
// print error
UE_LOG(LogCollisionProfile, Warning, TEXT("Profile (%s) - Custom Channel Name = \'%s\' hasn't been found"),
*Template.Name.ToString(), *Custom.Channel.ToString());
}
}
return (NumOfItemsCustomized == CustomResponses.Num());
}
示例7: GetLaunchOnDeviceID
void GetLaunchOnDeviceID(FString& OutDeviceID, const FString& InMapName)
{
UAutomationTestSettings const* AutomationTestSettings = GetDefault<UAutomationTestSettings>();
check(AutomationTestSettings);
OutDeviceID = "None";
FString LaunchOnDeviceId;
for (auto LaunchIter = AutomationTestSettings->LaunchOnSettings.CreateConstIterator(); LaunchIter; LaunchIter++)
{
FString LaunchOnSettings = LaunchIter->DeviceID;
FString LaunchOnMap = FPaths::GetBaseFilename(LaunchIter->LaunchOnTestmap.FilePath);
if (LaunchOnMap.Equals(InMapName))
{
// shared devices section
TSharedPtr<ITargetDeviceServicesModule> TargetDeviceServicesModule = StaticCastSharedPtr<ITargetDeviceServicesModule>(FModuleManager::Get().LoadModule(TEXT("TargetDeviceServices")));
// for each platform...
TArray<ITargetDeviceProxyPtr> DeviceProxies;
TargetDeviceServicesModule->GetDeviceProxyManager()->GetProxies(FName(*LaunchOnSettings), true, DeviceProxies);
// for each proxy...
for (auto DeviceProxyIt = DeviceProxies.CreateIterator(); DeviceProxyIt; ++DeviceProxyIt)
{
ITargetDeviceProxyPtr DeviceProxy = *DeviceProxyIt;
if (DeviceProxy->IsConnected())
{
OutDeviceID = DeviceProxy->GetTargetDeviceId((FName)*LaunchOnSettings);
break;
}
}
}
}
}
示例8: Compile
void FKCHandler_ClearDelegate::Compile(FKismetFunctionContext& Context, UEdGraphNode* Node)
{
UK2Node_BaseMCDelegate* DelegateNode = CastChecked<UK2Node_BaseMCDelegate>(Node);
UEdGraphPin* SelfPin = CompilerContext.GetSchema()->FindSelfPin(*DelegateNode, EEdGraphPinDirection::EGPD_Input);
check(SelfPin);
TArray<UEdGraphPin*> Links = SelfPin->LinkedTo;
if(!Links.Num())
{
Links.Add(SelfPin);
}
for (auto NetIt = Links.CreateIterator(); NetIt; ++NetIt)
{
UEdGraphPin* NetPin = *NetIt;
check(NetPin);
FBlueprintCompiledStatement& AddStatement = Context.AppendStatementForNode(DelegateNode);
AddStatement.Type = KCST_ClearMulticastDelegate;
FBPTerminal** VarDelegate = InnerTermMap.Find(FDelegateOwnerId(NetPin, DelegateNode));
check(VarDelegate && *VarDelegate);
AddStatement.LHS = *VarDelegate;
}
GenerateSimpleThenGoto(Context, *DelegateNode, DelegateNode->FindPin(CompilerContext.GetSchema()->PN_Then));
FNodeHandlingFunctor::Compile(Context, DelegateNode);
}
示例9: DeselectAllPuppetObjects
void FSequencerActorBindingManager::DeselectAllPuppetObjects()
{
TArray< AActor* > ActorsToDeselect;
for( auto MovieSceneIter( InstanceToPuppetObjectsMap.CreateConstIterator() ); MovieSceneIter; ++MovieSceneIter )
{
const TArray< TSharedRef<FPuppetActorInfo> >& PuppetObjects = MovieSceneIter.Value();
for( auto PuppetObjectIter( PuppetObjects.CreateConstIterator() ); PuppetObjectIter; ++PuppetObjectIter )
{
if( PuppetObjectIter->Get().GetType() == EPuppetObjectType::Actor )
{
TSharedRef< FPuppetActorInfo > PuppetActorInfo = StaticCastSharedRef< FPuppetActorInfo >( *PuppetObjectIter );
AActor* PuppetActor = PuppetActorInfo->PuppetActor.Get();
if( PuppetActor != NULL )
{
ActorsToDeselect.Add( PuppetActor );
}
}
}
}
if( ActorsToDeselect.Num() > 0 )
{
GEditor->GetSelectedActors()->BeginBatchSelectOperation();
GEditor->GetSelectedActors()->MarkBatchDirty();
for( auto ActorIt( ActorsToDeselect.CreateIterator() ); ActorIt; ++ActorIt )
{
GEditor->GetSelectedActors()->Deselect( *ActorIt );
}
GEditor->GetSelectedActors()->EndBatchSelectOperation();
}
}
示例10: FindPlayMovieSceneNodeInLevelScript
UK2Node_PlayMovieScene* FSequencerActorBindingManager::FindPlayMovieSceneNodeInLevelScript( const UMovieScene* MovieScene ) const
{
// Grab the world object for this editor
check( MovieScene != NULL );
// Search all levels in the specified world
for( TArray<ULevel*>::TConstIterator LevelIter( ActorWorld->GetLevels().CreateConstIterator() ); LevelIter; ++LevelIter )
{
auto* Level = *LevelIter;
if( Level != NULL )
{
// We don't want to create a level script if one doesn't exist yet. We just want to grab the one
// that we already have, if one exists.
const bool bDontCreate = true;
ULevelScriptBlueprint* LSB = Level->GetLevelScriptBlueprint( bDontCreate );
if( LSB != NULL )
{
TArray<UK2Node_PlayMovieScene*> EventNodes;
FBlueprintEditorUtils::GetAllNodesOfClass( LSB, EventNodes );
for( auto FoundNodeIter( EventNodes.CreateIterator() ); FoundNodeIter; ++FoundNodeIter )
{
UK2Node_PlayMovieScene* FoundNode = *FoundNodeIter;
if( FoundNode->GetMovieScene() == MovieScene )
{
return FoundNode;
}
}
}
}
}
return NULL;
}
示例11: IsInvertedYAxisDirty
bool UShooterPersistentUser::IsInvertedYAxisDirty() const
{
bool bIsDirty = false;
if (GEngine)
{
TArray<APlayerController*> PlayerList;
GEngine->GetAllLocalPlayerControllers(PlayerList);
for (auto It = PlayerList.CreateIterator(); It; ++It)
{
APlayerController* PC = *It;
if (!PC || !PC->Player || !PC->PlayerInput)
{
continue;
}
// Update key bindings for the current user only
ULocalPlayer* LocalPlayer = Cast<ULocalPlayer>(PC->Player);
if(!LocalPlayer || LocalPlayer->ControllerId != UserIndex)
{
continue;
}
bIsDirty |= PC->PlayerInput->GetInvertAxis("Lookup") != GetInvertedYAxis();
bIsDirty |= PC->PlayerInput->GetInvertAxis("LookupRate") != GetInvertedYAxis();
}
}
return bIsDirty;
}
示例12: OnAnimCurveWeightChanged
void SAnimCurveListRow::OnAnimCurveWeightChanged( float NewWeight )
{
float NewValidWeight = FMath::Clamp(NewWeight, -MaxMorphWeight, MaxMorphWeight);
Item->Weight = NewValidWeight;
Item->bAutoFillData = false;
TSharedPtr<SAnimCurveViewer> AnimCurveViewer = AnimCurveViewerPtr.Pin();
if (AnimCurveViewer.IsValid())
{
// Add override
AnimCurveViewer->AddAnimCurveOverride(Item->SmartName.DisplayName, Item->Weight);
// ...then any selected rows need changing by the same delta
TArray< TSharedPtr< FDisplayedAnimCurveInfo > > SelectedRows = AnimCurveViewer->AnimCurveListView->GetSelectedItems();
for (auto ItemIt = SelectedRows.CreateIterator(); ItemIt; ++ItemIt)
{
TSharedPtr< FDisplayedAnimCurveInfo > RowItem = (*ItemIt);
if (RowItem != Item) // Don't do "this" row again if it's selected
{
RowItem->Weight = NewValidWeight;
RowItem->bAutoFillData = false;
AnimCurveViewer->AddAnimCurveOverride(RowItem->SmartName.DisplayName, RowItem->Weight);
}
}
if(PreviewScenePtr.IsValid())
{
PreviewScenePtr.Pin()->InvalidateViews();
}
}
}
示例13: CleanupUnitTestWorlds
void NUTNet::CleanupUnitTestWorlds()
{
for (auto It=PendingUnitWorldCleanup.CreateIterator(); It; ++It)
{
UWorld* CurWorld = *It;
// Remove the tick-hook, for this world
int32 TickHookIdx = ActiveTickHooks.IndexOfByPredicate(
[&CurWorld](const FWorldTickHook* CurTickHook)
{
return CurTickHook != NULL && CurTickHook->AttachedWorld == CurWorld;
});
if (TickHookIdx != INDEX_NONE)
{
ActiveTickHooks.RemoveAt(TickHookIdx);
}
GEngine->DestroyWorldContext(CurWorld);
CurWorld->DestroyWorld(false);
}
PendingUnitWorldCleanup.Empty();
// Immediately garbage collect remaining objects, to finish net driver cleanup
CollectGarbage(GARBAGE_COLLECTION_KEEPFLAGS, true);
}
示例14: BuildDependencyMapAndCompile
static void BuildDependencyMapAndCompile(const TArray<UUserDefinedStruct*>& ChangedStructs, FCompilerResultsLog& MessageLog)
{
struct FDependencyMapEntry
{
UUserDefinedStruct* Struct;
TSet<UUserDefinedStruct*> StructuresToWaitFor;
FDependencyMapEntry() : Struct(NULL) {}
void Initialize(UUserDefinedStruct* ChangedStruct, const TArray<UUserDefinedStruct*>& AllChangedStructs)
{
Struct = ChangedStruct;
check(Struct);
auto Schema = GetDefault<UEdGraphSchema_K2>();
for (auto& VarDesc : FStructureEditorUtils::GetVarDesc(Struct))
{
auto StructType = Cast<UUserDefinedStruct>(VarDesc.SubCategoryObject.Get());
if (StructType && (VarDesc.Category == Schema->PC_Struct) && AllChangedStructs.Contains(StructType))
{
StructuresToWaitFor.Add(StructType);
}
}
}
};
TArray<FDependencyMapEntry> DependencyMap;
for (auto Iter = ChangedStructs.CreateConstIterator(); Iter; ++Iter)
{
DependencyMap.Add(FDependencyMapEntry());
DependencyMap.Last().Initialize(*Iter, ChangedStructs);
}
while (DependencyMap.Num())
{
int32 StructureToCompileIndex = INDEX_NONE;
for (int32 EntryIndex = 0; EntryIndex < DependencyMap.Num(); ++EntryIndex)
{
if(0 == DependencyMap[EntryIndex].StructuresToWaitFor.Num())
{
StructureToCompileIndex = EntryIndex;
break;
}
}
check(INDEX_NONE != StructureToCompileIndex);
UUserDefinedStruct* Struct = DependencyMap[StructureToCompileIndex].Struct;
check(Struct);
FUserDefinedStructureCompilerInner::CleanAndSanitizeStruct(Struct);
FUserDefinedStructureCompilerInner::InnerCompileStruct(Struct, GetDefault<UEdGraphSchema_K2>(), MessageLog);
DependencyMap.RemoveAtSwap(StructureToCompileIndex);
for (auto EntryIter = DependencyMap.CreateIterator(); EntryIter; ++EntryIter)
{
(*EntryIter).StructuresToWaitFor.Remove(Struct);
}
}
}
示例15: CheckForReferences
void FPendingDelete::CheckForReferences()
{
if ( bReferencesChecked )
{
return;
}
bReferencesChecked = true;
// Load the asset registry module
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>( TEXT( "AssetRegistry" ) );
AssetRegistryModule.Get().GetReferencers(Object->GetOutermost()->GetFName(), DiskReferences);
// Check and see whether we are referenced by any objects that won't be garbage collected (*including* the undo buffer)
FReferencerInformationList ReferencesIncludingUndo;
bool bReferencedInMemoryOrUndoStack = IsReferenced(Object, GARBAGE_COLLECTION_KEEPFLAGS, true, &ReferencesIncludingUndo);
// Determine the in-memory references, *excluding* the undo buffer
GEditor->Trans->DisableObjectSerialization();
bIsReferencedInMemoryByNonUndo = IsReferenced(Object, GARBAGE_COLLECTION_KEEPFLAGS, true, &MemoryReferences);
GEditor->Trans->EnableObjectSerialization();
// see if this object is the transaction buffer - set a flag so we know we need to clear the undo stack
const int32 TotalReferenceCount = ReferencesIncludingUndo.ExternalReferences.Num() + ReferencesIncludingUndo.InternalReferences.Num();
const int32 NonUndoReferenceCount = MemoryReferences.ExternalReferences.Num() + MemoryReferences.InternalReferences.Num();
bIsReferencedInMemoryByUndo = TotalReferenceCount > NonUndoReferenceCount;
// If the object itself isn't in the transaction buffer, check to see if it's a Blueprint asset. We might have instances of the
// Blueprint in the transaction buffer, in which case we also want to both alert the user and clear it prior to deleting the asset.
if ( !bIsReferencedInMemoryByUndo )
{
UBlueprint* Blueprint = Cast<UBlueprint>( Object );
if ( Blueprint && Blueprint->GeneratedClass )
{
TArray<FReferencerInformation> ExternalMemoryReferences = MemoryReferences.ExternalReferences;
for ( auto RefIt = ExternalMemoryReferences.CreateIterator(); RefIt && !bIsReferencedInMemoryByUndo; ++RefIt )
{
FReferencerInformation& RefInfo = *RefIt;
if ( RefInfo.Referencer->IsA( Blueprint->GeneratedClass ) )
{
if ( IsReferenced( RefInfo.Referencer, GARBAGE_COLLECTION_KEEPFLAGS, true, &ReferencesIncludingUndo ) )
{
GEditor->Trans->DisableObjectSerialization();
FReferencerInformationList ReferencesExcludingUndo;
if ( IsReferenced( RefInfo.Referencer, GARBAGE_COLLECTION_KEEPFLAGS, true, &ReferencesExcludingUndo ) )
{
bIsReferencedInMemoryByUndo = ( ReferencesIncludingUndo.InternalReferences.Num() + ReferencesIncludingUndo.ExternalReferences.Num() ) > ( ReferencesExcludingUndo.InternalReferences.Num() + ReferencesExcludingUndo.ExternalReferences.Num() );
}
GEditor->Trans->EnableObjectSerialization();
}
}
}
}
}
}