Navigation
API > API/Editor > API/Editor/BlueprintGraph
Contains behavior needed to handle type promotion in blueprints. Creates a map of "Operations" to any of their matching UFunctions so that we can find the best possible match given several pin types.
| Name | FTypePromotion |
| Type | class |
| Header File | /Engine/Source/Editor/BlueprintGraph/Classes/BlueprintTypePromotion.h |
| Include Path | #include "BlueprintTypePromotion.h" |
Syntax
class FTypePromotion : private FNoncopyable
Inheritance Hierarchy
- FNoncopyable → FTypePromotion
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTypePromotion() |
BlueprintTypePromotion.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FTypePromotion() |
BlueprintTypePromotion.h |
Enums
Public
| Name | Remarks |
|---|---|
| ETypeComparisonResult | Represents the possible results when comparing two types for promotion |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FFunctionsList | TArray< UFunction * > | A single operator can have multiple functions associated with it; usually for handling different types (int*int, vs. int*vector), hence this array. | BlueprintTypePromotion.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Instance | FTypePromotion * | BlueprintTypePromotion.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Lock | FCriticalSection | Protects internal data from multi-threaded access. | BlueprintTypePromotion.h | |
| OperatorNodeSpawnerMap | TMap< FName, UBlueprintFunctionNodeSpawner * > | Map of operators to their node spawner so that we can clean up the context menu | BlueprintTypePromotion.h | |
| OperatorTable | TMap< FName, FFunctionsList > | A lookup table, mapping operator strings (like "Add", "Multiply", etc.) to a list of associated functions. | BlueprintTypePromotion.h | |
| PromotionTable | const TMap< FName, TArray< FName > > | A map of 'Type' to its 'available promotions'. See ctor for creation | BlueprintTypePromotion.h |
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ClearNodeSpawners () |
Clear all registered node spawners for operators from the system. | BlueprintTypePromotion.h | |
static UFunction * FindBestMatchingFunc
(
FName Operation, |
Find the function that is the best match given the pins to consider. | BlueprintTypePromotion.h | |
static FTypePromotion & Get() |
Creates a new singleton instance of TypePromotion if there isn't one and returns a reference to it | BlueprintTypePromotion.h | |
static void GetAllFuncsForOp
(
FName Operation, |
Returns all functions for a specific operation. | BlueprintTypePromotion.h | |
static const TSet< FName > & GetAllOpNames() |
Get a set of the supported operator names for type promo. Ex: "Add", "Subtract", "Multiply" | BlueprintTypePromotion.h | |
static const TArray< FName > * GetAvailablePrimitivePromotions
(
const FEdGraphPinType& Type |
Get a pointer to an array of available promotion types to a given pin type | BlueprintTypePromotion.h | |
static const TSet< FName > & GetComparisonOpNames() |
Set of comparison operator names (GreaterThan, LessThan, etc) | BlueprintTypePromotion.h | |
static ETypeComparisonResult GetHigherType
(
const FEdGraphPinType& A, |
Given the two pin types check which pin type is higher. | BlueprintTypePromotion.h | |
| Get the keywords metadata for the given operator name | BlueprintTypePromotion.h | ||
static UBlueprintFunctionNodeSpawner * GetOperatorSpawner
(
FName OpName |
Function node spawner associated with this operation | BlueprintTypePromotion.h | |
| Parse the name of the operator that this function matches to (Add, Subtract, etc) | BlueprintTypePromotion.h | ||
| Get the "Primitive Promotion Table" which represents what base Pin types can be promoted to others. | BlueprintTypePromotion.h | ||
static FEdGraphPinType GetPromotedType
(
const TArray< UEdGraphPin* >& WildcardPins |
Determine what type a given set of wildcard pins would result in | BlueprintTypePromotion.h | |
| Get the user facing version of this operator name | BlueprintTypePromotion.h | ||
static bool HasStructConversion
(
const UEdGraphPin* InputPin, |
Returns true if the given input pin can correctly be converted to the output type as a struct | BlueprintTypePromotion.h | |
static bool IsComparisonFunc
(
UFunction const*const Func |
Returns true if the given function is a comparison operator | BlueprintTypePromotion.h | |
static bool IsComparisonOpName
(
const FName OpName |
Returns true if the given op name is a comparison operator name | BlueprintTypePromotion.h | |
static bool IsFunctionPromotionReady
(
const UFunction*const FuncToConsider |
Returns true if the given function has been registered within the operator table | BlueprintTypePromotion.h | |
static bool IsOperatorSpawnerRegistered
(
UFunction const*const Func |
Returns true if the given function has a registered operator node spawner | BlueprintTypePromotion.h | |
static bool IsPromotableFunction
(
const UFunction* Function |
Returns true if the given function is a candidate to handle type promotion | BlueprintTypePromotion.h | |
static bool IsValidPromotion
(
const FEdGraphPinType& A, |
Returns true if A can be promoted to type B correctly, or if the types are equal | BlueprintTypePromotion.h | |
static void RefreshPromotionTables
(
EReloadCompleteReason Reason |
Clear out the promotion table and rebuild it, reassessing each available UFunction. | BlueprintTypePromotion.h | |
static void RegisterOperatorSpawner
(
FName OpName, |
Keep track of the operator that this function provides so that we don't add multiple to the BP context menu | BlueprintTypePromotion.h | |
static void Shutdown() |
Deletes the singleton instance of type promotion if there is one | BlueprintTypePromotion.h |