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


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

本文整理汇总了C++中TArray::Top方法的典型用法代码示例。如果您正苦于以下问题:C++ TArray::Top方法的具体用法?C++ TArray::Top怎么用?C++ TArray::Top使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TArray的用法示例。


在下文中一共展示了TArray::Top方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MoveTemp

	TArray<FChunkPart> FDataStructure::GetFinalDataStructure()
	{
		if (DataStructure.Top().PartSize == 0)
		{
			DataStructure.Pop(false);
		}
		return MoveTemp(DataStructure);
	}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:8,代码来源:DataScanner.cpp

示例2: CompleteCurrentChunk

	void FDataStructure::CompleteCurrentChunk()
	{
		DataStructure.AddZeroed();
		FChunkPart& PreviousPart = DataStructure[DataStructure.Num() - 2];

		// Create next chunk
		NewChunkGuid = FGuid::NewGuid();
		DataStructure.Top().DataOffset = PreviousPart.DataOffset + PreviousPart.PartSize;
		DataStructure.Top().ChunkGuid = NewChunkGuid;
	}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:10,代码来源:DataScanner.cpp

示例3: Construct

	void STextPropertyWidget::Construct(const FArguments& Arguments, const TSharedRef<IPropertyHandle>& InPropertyHandle)
	{
		PropertyHandle = InPropertyHandle;

		const auto& GetTextValue = [this]() -> FText
		{
			FText TextValue;

			TArray<const void*> RawData;
			PropertyHandle->AccessRawData(RawData);
			if (RawData.Num() == 1)
			{
				const FText* RawDatum = reinterpret_cast<const FText*>(RawData.Top());
				if (RawDatum)
				{
					TextValue = *RawDatum;
				}
			}
			else if(RawData.Num() > 1)
			{
				TextValue = NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values");
			}
			else
			{
				TextValue = FText::GetEmpty();
			}

			return TextValue;
		};

		const auto& OnTextCommitted = [this](const FText& NewText, ETextCommit::Type CommitInfo)
		{
			PropertyHandle->NotifyPreChange();

			TArray<void*> RawData;
			PropertyHandle->AccessRawData(RawData);
			for (void* const RawDatum : RawData)
			{
				FText& PropertyValue = *(reinterpret_cast<FText* const>(RawDatum));

				// FText::FromString on the result of FText::ToString is intentional. For now, we want to nuke any namespace/key info and let it get regenerated from scratch,
				// rather than risk adopting whatever came through some chain of calls. This will be replaced when preserving of identity is implemented.
				PropertyValue = FText::FromString(NewText.ToString());
			}
			
			PropertyHandle->NotifyPostChange();
		};

		ChildSlot
			[
				SNew(SEditableTextBox)
				.Text_Lambda(GetTextValue)
				.OnTextCommitted_Lambda(OnTextCommitted)
			];
	}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:55,代码来源:TextCustomization.cpp

示例4: PushKnownChunk

	void FDataStructure::PushKnownChunk(const FGuid& PotentialMatch, uint32 NumDataInWindow)
	{
		if (DataStructure.Top().PartSize > 0)
		{
			// Add for matched
			DataStructure.AddUninitialized();
			// Add for next
			DataStructure.AddUninitialized();

			// Fill out info
			FChunkPart& PreviousChunkPart = DataStructure[DataStructure.Num() - 3];
			FChunkPart& MatchedChunkPart = DataStructure[DataStructure.Num() - 2];
			FChunkPart& NextChunkPart = DataStructure[DataStructure.Num() - 1];

			MatchedChunkPart.DataOffset = PreviousChunkPart.DataOffset + PreviousChunkPart.PartSize;
			MatchedChunkPart.PartSize = NumDataInWindow;
			MatchedChunkPart.ChunkOffset = 0;
			MatchedChunkPart.ChunkGuid = PotentialMatch;

			NextChunkPart.DataOffset = MatchedChunkPart.DataOffset + MatchedChunkPart.PartSize;
			NextChunkPart.ChunkGuid = PreviousChunkPart.ChunkGuid;
			NextChunkPart.ChunkOffset = PreviousChunkPart.ChunkOffset + PreviousChunkPart.PartSize;
			NextChunkPart.PartSize = 0;
		}
		else
		{
			// Add for next
			DataStructure.AddZeroed();

			// Fill out info
			FChunkPart& MatchedChunkPart = DataStructure[DataStructure.Num() - 2];
			FChunkPart& NextChunkPart = DataStructure[DataStructure.Num() - 1];

			NextChunkPart.ChunkOffset = MatchedChunkPart.ChunkOffset;
			NextChunkPart.ChunkGuid = NewChunkGuid;
			NextChunkPart.DataOffset = MatchedChunkPart.DataOffset + NumDataInWindow;

			MatchedChunkPart.PartSize = NumDataInWindow;
			MatchedChunkPart.ChunkOffset = 0;
			MatchedChunkPart.ChunkGuid = PotentialMatch;
		}
	}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:42,代码来源:DataScanner.cpp

示例5: Construct

	void STextPropertyWidget::Construct(const FArguments& InArgs, const TSharedRef<IPropertyHandle>& InPropertyHandle, const TSharedPtr<IPropertyUtilities>& InPropertyUtilities)
	{
		PropertyHandle = InPropertyHandle;
		PropertyUtilities = InPropertyUtilities;

		const auto& GetTextValue = [this]() -> FText
		{
			FText TextValue;

			TArray<const void*> RawData;
			PropertyHandle->AccessRawData(RawData);
			if (RawData.Num() == 1)
			{
				const FText* RawDatum = reinterpret_cast<const FText*>(RawData.Top());
				if (RawDatum)
				{
					TextValue = *RawDatum;
				}
			}
			else if(RawData.Num() > 1)
			{
				TextValue = MultipleValuesText;
			}
			else
			{
				TextValue = FText::GetEmpty();
			}

			return TextValue;
		};

		const auto& OnTextCommitted = [this](const FText& NewText, ETextCommit::Type CommitInfo)
		{
			TArray<void*> RawData;
			PropertyHandle->AccessRawData(RawData);

			// Don't commit the Multiple Values text if there are multiple properties being set
			if (RawData.Num() > 0 && (RawData.Num() == 1 || NewText.ToString() != MultipleValuesText.ToString()))
			{
				PropertyHandle->NotifyPreChange();

				for (void* const RawDatum : RawData)
				{
					FText& PropertyValue = *(reinterpret_cast<FText* const>(RawDatum));

					// FText::FromString on the result of FText::ToString is intentional. For now, we want to nuke any namespace/key info and let it get regenerated from scratch,
					// rather than risk adopting whatever came through some chain of calls. This will be replaced when preserving of identity is implemented.
					PropertyValue = FText::FromString(NewText.ToString());
				}

				PropertyHandle->NotifyPostChange();
				PropertyHandle->NotifyFinishedChangingProperties();
			}
		};

		TSharedPtr<SHorizontalBox> HorizontalBox;

		bool bIsPassword = PropertyHandle->GetBoolMetaData("PasswordField");
		bIsMultiLine = PropertyHandle->GetBoolMetaData("MultiLine");
		if(bIsMultiLine)
		{
			ChildSlot
				[
					SAssignNew(HorizontalBox, SHorizontalBox)
					+SHorizontalBox::Slot()
					.FillWidth(1.0f)
					[
						SNew( SBox )
						.MaxDesiredHeight(300.f)
						[
							SAssignNew(MultiLineWidget, SMultiLineEditableTextBox)
							.Text_Lambda(GetTextValue)
							.Font(InArgs._Font)
							.SelectAllTextWhenFocused(false)
							.ClearKeyboardFocusOnCommit(false)
							.OnTextCommitted_Lambda(OnTextCommitted)
							.SelectAllTextOnCommit(false)
							.IsReadOnly(this, &STextPropertyWidget::IsReadOnly)
							.AutoWrapText(true)
							.ModiferKeyForNewLine(EModifierKey::Shift)
							.IsPassword(bIsPassword)
						]
					]
				];

			PrimaryWidget = MultiLineWidget;
		}
		else
		{
			ChildSlot
				[
					SAssignNew(HorizontalBox, SHorizontalBox)
					+SHorizontalBox::Slot()
					.FillWidth(1.0f)
					[
						SAssignNew( SingleLineWidget, SEditableTextBox )
						.Text_Lambda(GetTextValue)
						.Font( InArgs._Font )
						.SelectAllTextWhenFocused( true )
						.ClearKeyboardFocusOnCommit(false)
//.........这里部分代码省略.........
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:101,代码来源:TextCustomization.cpp

示例6: PushUnknownByte

	void FDataStructure::PushUnknownByte()
	{
		DataStructure.Top().PartSize++;
	}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:4,代码来源:DataScanner.cpp


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