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


C++ TSharedPtr::CleanUp方法代码示例

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


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

示例1: RemoveAndDestroyTab

void SDockingTabWell::RemoveAndDestroyTab(const TSharedRef<SDockTab>& TabToRemove, SDockingNode::ELayoutModification RemovalMethod)
{
	int32 TabIndex = Tabs.Find(TabToRemove);

	if (TabIndex != INDEX_NONE)
	{
		const TSharedPtr<SDockingTabStack> ParentTabStack = ParentTabStackPtr.Pin();

		// Remove the old tab from the list of tabs and activate the new tab.
		{
			BringTabToFront(TabIndex);
			Tabs.RemoveAt(TabIndex);
			// We no longer have a tab in the foreground.
			// This is important because BringTabToFront triggers notifications based on the difference in active tab indexes.
			ForegroundTabIndex = INDEX_NONE;

			// Now bring the last tab that we were on to the foreground
			BringTabToFront(FMath::Max(TabIndex-1, 0));
		}
		
		if ( ensure(ParentTabStack.IsValid()) )
		{
			TSharedPtr<SDockingArea> DockAreaPtr = ParentTabStack->GetDockArea();

			ParentTabStack->OnTabClosed( TabToRemove );
			
			// We might be closing down an entire dock area, if this is a major tab.
			// Use this opportunity to save its layout
			if (RemovalMethod == SDockingNode::TabRemoval_Closed)
			{
				if (DockAreaPtr.IsValid())
				{
					DockAreaPtr->GetTabManager()->GetPrivateApi().OnTabClosing( TabToRemove );
				}
			}

			if (Tabs.Num() == 0)
			{
				ParentTabStack->OnLastTabRemoved();
			}
			else
			{
				RefreshParentContent();
			}

			if (DockAreaPtr.IsValid())
			{
				DockAreaPtr->CleanUp( RemovalMethod );
			}
		}
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:52,代码来源:SDockingTabWell.cpp

示例2: Main


//.........这里部分代码省略.........
		{
			UE_LOG( LogGatherTextCommandlet, Error, TEXT("Source Control error: %s"), *SCCErrorStr.ToString() );
			return -1;
		}
	}

	// Basic helper that can be used only to gather a new manifest for writing
	TSharedRef<FLocTextHelper> CommandletGatherManifestHelper = MakeShareable(new FLocTextHelper(MakeShareable(new FLocFileSCCNotifies(CommandletSourceControlInfo))));
	CommandletGatherManifestHelper->LoadManifest(ELocTextHelperLoadFlags::Create);

	int32 NumSteps = (ConfigFile->Find("CommonSettings") != NULL) ? ConfigFile->Num() - 1 :  ConfigFile->Num();

	//Execute each step defined in the config file.
	for( int32 i=0; i<NumSteps ; ++i )
	{
		FString SectionName = FString::Printf(TEXT("GatherTextStep%d"),i);
		FConfigSection* CurrCommandletSection = ConfigFile->Find(SectionName);
		if( NULL == CurrCommandletSection )
		{
			UE_LOG(LogGatherTextCommandlet, Error, TEXT("Could not find %s"),*SectionName);
			continue;
		}

		FString CommandletClassName = GConfig->GetStr( *SectionName, TEXT("CommandletClass"), GatherTextConfigPath ) + TEXT("Commandlet");

		UClass* CommandletClass = FindObject<UClass>(ANY_PACKAGE,*CommandletClassName,false);
		if (!CommandletClass)
		{
			UE_LOG(LogGatherTextCommandlet, Error,TEXT("The commandlet name %s in section %s is invalid."), *CommandletClassName, *SectionName);
			continue;
		}

		UGatherTextCommandletBase* Commandlet = NewObject<UGatherTextCommandletBase>(GetTransientPackage(), CommandletClass);
		check(Commandlet);
		Commandlet->AddToRoot();
		Commandlet->Initialize( CommandletGatherManifestHelper, CommandletSourceControlInfo );

		// Execute the commandlet.
		double CommandletExecutionStartTime = FPlatformTime::Seconds();

		UE_LOG(LogGatherTextCommandlet, Log,TEXT("Executing %s: %s"), *SectionName, *CommandletClassName);
		
		
		FString GeneratedCmdLine = FString::Printf(TEXT("-Config=\"%s\" -Section=%s"), *GatherTextConfigPath , *SectionName);

		// Add all the command params with the exception of config
		for(auto ParamIter = ParamVals.CreateConstIterator(); ParamIter; ++ParamIter)
		{
			const FString& Key = ParamIter.Key();
			const FString& Val = ParamIter.Value();
			if(Key != TEXT("config"))
			{
				GeneratedCmdLine += FString::Printf(TEXT(" -%s=%s"), *Key , *Val);
			}	
		}

		// Add all the command switches
		for(auto SwitchIter = Switches.CreateConstIterator(); SwitchIter; ++SwitchIter)
		{
			const FString& Switch = *SwitchIter;
			GeneratedCmdLine += FString::Printf(TEXT(" -%s"), *Switch);
		}

		if( 0 != Commandlet->Main( GeneratedCmdLine ) )
		{
			UE_LOG(LogGatherTextCommandlet, Error,TEXT("%s-%s reported an error."),*SectionName, *CommandletClassName);
			if( CommandletSourceControlInfo.IsValid() )
			{
				FText SCCErrorStr;
				if( !CommandletSourceControlInfo->CleanUp( SCCErrorStr ) )
				{
					UE_LOG(LogGatherTextCommandlet, Error, TEXT("%s"), *SCCErrorStr.ToString());
				}
			}
			return -1;
		}

		UE_LOG(LogGatherTextCommandlet, Log,TEXT("Completed %s: %s"), *SectionName, *CommandletClassName);
	}

	if( CommandletSourceControlInfo.IsValid() && !bDisableSubmit )
	{
		FText SCCErrorStr;
		if( CommandletSourceControlInfo->CheckinFiles( GetChangelistDescription(GatherTextConfigPath), SCCErrorStr ) )
		{
			UE_LOG(LogGatherTextCommandlet, Log,TEXT("Submitted Localization files."));
		}
		else
		{
			UE_LOG(LogGatherTextCommandlet, Error, TEXT("%s"), *SCCErrorStr.ToString());
			if( !CommandletSourceControlInfo->CleanUp( SCCErrorStr ) )
			{
				UE_LOG(LogGatherTextCommandlet, Error, TEXT("%s"), *SCCErrorStr.ToString());
			}
			return -1;
		}
	}

	return 0;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:101,代码来源:GatherTextCommandlet.cpp


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