当前位置: 首页>>代码示例>>C++>>正文


C++ TArray::CreateIterator方法代码示例

本文整理汇总了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;
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:14,代码来源:SourceControlTests.cpp

示例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;
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:32,代码来源:AnimationAsset.cpp

示例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;
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:28,代码来源:AnimationGraphSchema.cpp

示例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;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:25,代码来源:EpicSurvey.cpp

示例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.
}
开发者ID:PopCap,项目名称:GameIdea,代码行数:28,代码来源:SourceControlModule.cpp

示例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());
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:28,代码来源:CollisionProfile.cpp

示例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;
					}
				}
			}
		}
	}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:32,代码来源:AutomationEditorCommon.cpp

示例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);
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:29,代码来源:DelegateNodeHandlers.cpp

示例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();
	}
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:33,代码来源:SequencerActorBindingManager.cpp

示例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;
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:33,代码来源:SequencerActorBindingManager.cpp

示例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;
}
开发者ID:game-god,项目名称:WarStruck-Project,代码行数:30,代码来源:ShooterPersistentUser.cpp

示例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();
		}
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:33,代码来源:SAnimCurveViewer.cpp

示例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);
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:27,代码来源:NUTUtilNet.cpp

示例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);
			}
		}
	}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:59,代码来源:UserDefinedStructureCompilerUtils.cpp

示例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();
					}
				}
			}
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:59,代码来源:AssetDeleteModel.cpp


注:本文中的TArray::CreateIterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。