FDatasmithUniqueNameProviderBase Class Referenceabstract

Based on a table of frequently used names, this class generates unique names with a good complexity when the number of name is important. More...

#include <DatasmithUtils.h>

Inheritance diagram for FDatasmithUniqueNameProviderBase:
FDatasmithUniqueNameProvider

Public Member Functions

FString GenerateUniqueName (const FString &BaseName)
 Generates a unique name. More...
 
virtual void AddExistingName (const FString &Name)=0
 Register a name as known. More...
 
virtual void RemoveExistingName (const FString &Name)=0
 Remove a name from the list of existing name. More...
 

Protected Member Functions

virtual bool Contains (const FString &Name)=0
 Check if the given name is already registered. More...
 

Detailed Description

Based on a table of frequently used names, this class generates unique names with a good complexity when the number of name is important.

Note
: This abstact class allows various implementation of the cache of known name. Implementation could use a simple TSet, or reuse existing specific cache structure

Member Function Documentation

◆ AddExistingName()

virtual void FDatasmithUniqueNameProviderBase::AddExistingName ( const FString &  Name)
pure virtual

Register a name as known.

Parameters
Namename to register

Implemented in FDatasmithUniqueNameProvider.

◆ Contains()

virtual bool FDatasmithUniqueNameProviderBase::Contains ( const FString &  Name)
protectedpure virtual

Check if the given name is already registered.

Parameters
Namename to test
Returns
true if the name is in the cache

Implemented in FDatasmithUniqueNameProvider.

◆ GenerateUniqueName()

FString FDatasmithUniqueNameProviderBase::GenerateUniqueName ( const FString &  BaseName)

Generates a unique name.

Parameters
BaseNameName that will be suffixed with an index to be unique
Returns
FString unique name. Calling "Contains()" with this name will be false

◆ RemoveExistingName()

virtual void FDatasmithUniqueNameProviderBase::RemoveExistingName ( const FString &  Name)
pure virtual

Remove a name from the list of existing name.

Parameters
Namename to unregister

Implemented in FDatasmithUniqueNameProvider.


The documentation for this class was generated from the following file: