// Copyright Epic Games, Inc. All Rights Reserved. #include "Analysis/MetasoundFrontendAnalyzerAddress.h" #include "MetasoundArrayNodesRegistration.h" #include "MetasoundDataTypeRegistrationMacro.h" #include "MetasoundFrontendDataTypeTraits.h" #include "Misc/AssertionMacros.h" namespace Metasound { namespace Frontend { FAnalyzerAddress::FAnalyzerAddress(const FString& InAddressString) { TArray Tokens; if (ensureAlwaysMsgf(InAddressString.ParseIntoArray(Tokens, METASOUND_ANALYZER_PATH_SEPARATOR) == 7, TEXT("Invalid Analyzer Address String Format"))) { InstanceID = static_cast(FCString::Atoi64(*Tokens[0])); NodeID = FGuid(Tokens[1]); OutputName = *Tokens[2]; DataType = *Tokens[3]; AnalyzerName = *Tokens[4]; AnalyzerInstanceID = FGuid(Tokens[5]); AnalyzerMemberName = *Tokens[6]; } } FName FAnalyzerAddress::GetAddressType() const { return "Analyzer"; } FName FAnalyzerAddress::GetDataType() const { return DataType; } TUniquePtr FAnalyzerAddress::Clone() const { return TUniquePtr(new FAnalyzerAddress(*this)); } uint32 FAnalyzerAddress::GetHash() const { uint32 AddressHash = HashCombineFast(AnalyzerInstanceID.A, GetTypeHashHelper(AnalyzerMemberName)); AddressHash = HashCombineFast(AddressHash, GetTypeHashHelper(AnalyzerName)); AddressHash = HashCombineFast(AddressHash, GetTypeHashHelper(DataType)); AddressHash = HashCombineFast(AddressHash, GetTypeHashHelper(InstanceID)); AddressHash = HashCombineFast(AddressHash, NodeID.A); AddressHash = HashCombineFast(AddressHash, GetTypeHashHelper(OutputName)); return AddressHash; } bool FAnalyzerAddress::IsEqual(const FTransmissionAddress& InOther) const { if (InOther.GetAddressType() != GetAddressType()) { return false; } const FAnalyzerAddress& OtherAddr = static_cast(InOther); return OtherAddr.AnalyzerInstanceID == AnalyzerInstanceID && OtherAddr.AnalyzerMemberName == AnalyzerMemberName && OtherAddr.AnalyzerName == AnalyzerName && OtherAddr.DataType == DataType && OtherAddr.InstanceID == InstanceID && OtherAddr.NodeID == NodeID && OtherAddr.OutputName == OutputName; } FString FAnalyzerAddress::ToString() const { return FString::Join(TArray { *FString::Printf(TEXT("%lld"), InstanceID), *NodeID.ToString(), *OutputName.ToString(), *DataType.ToString(), *AnalyzerName.ToString(), *AnalyzerInstanceID.ToString(), *AnalyzerMemberName.ToString() }, METASOUND_ANALYZER_PATH_SEPARATOR); } } // namespace Frontend template<> struct TEnableArrayNodes { static constexpr bool Value = false; }; template<> struct TEnableTransmissionNodeRegistration { static constexpr bool Value = false; }; template struct TEnableAutoConverterNodeRegistration { static constexpr bool Value = false; }; template<> struct TEnableConstructorVertex { static constexpr bool Value = false; }; REGISTER_METASOUND_DATATYPE(Frontend::FAnalyzerAddress, "AnalyzerAddress"); } // namespace Metasound