2023-06-16 17:48:20 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "MetasoundDocumentInterface.h"
|
2024-06-27 23:26:57 -04:00
|
|
|
#include "MetasoundFrontendDocumentIdGenerator.h"
|
|
|
|
|
#include "MetasoundFrontendGraph.h"
|
|
|
|
|
#include "MetasoundFrontendProxyDataCache.h"
|
|
|
|
|
#include "MetasoundOperatorBuilder.h"
|
|
|
|
|
#include "MetasoundOperatorBuilderSettings.h"
|
2023-06-16 17:48:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Metasound::Frontend
|
|
|
|
|
{
|
2024-05-08 14:53:53 -04:00
|
|
|
namespace DocumentInterfacePrivate
|
2023-06-16 17:48:20 -04:00
|
|
|
{
|
2024-05-08 14:53:53 -04:00
|
|
|
TUniquePtr<IDocumentBuilderRegistry> Instance;
|
|
|
|
|
}
|
2023-06-16 17:48:20 -04:00
|
|
|
|
2023-09-14 17:47:02 -04:00
|
|
|
IDocumentBuilderRegistry* IDocumentBuilderRegistry::Get()
|
|
|
|
|
{
|
2024-05-08 14:53:53 -04:00
|
|
|
return DocumentInterfacePrivate::Instance.Get();
|
2023-09-14 17:47:02 -04:00
|
|
|
}
|
|
|
|
|
|
2023-09-05 17:54:02 -04:00
|
|
|
IDocumentBuilderRegistry& IDocumentBuilderRegistry::GetChecked()
|
2023-06-16 17:48:20 -04:00
|
|
|
{
|
2024-05-08 14:53:53 -04:00
|
|
|
return *DocumentInterfacePrivate::Instance.Get();
|
2023-06-16 17:48:20 -04:00
|
|
|
}
|
|
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
void IDocumentBuilderRegistry::Deinitialize()
|
2023-06-16 17:48:20 -04:00
|
|
|
{
|
2024-05-08 14:53:53 -04:00
|
|
|
check(DocumentInterfacePrivate::Instance.IsValid());
|
|
|
|
|
DocumentInterfacePrivate::Instance.Reset();
|
|
|
|
|
}
|
2023-06-16 17:48:20 -04:00
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
void IDocumentBuilderRegistry::Initialize(TUniquePtr<IDocumentBuilderRegistry>&& InInstance)
|
|
|
|
|
{
|
|
|
|
|
check(!DocumentInterfacePrivate::Instance.IsValid());
|
|
|
|
|
DocumentInterfacePrivate::Instance = MoveTemp(InInstance);
|
2023-06-16 17:48:20 -04:00
|
|
|
}
|
2023-09-14 16:54:36 -04:00
|
|
|
|
|
|
|
|
IMetaSoundDocumentBuilderRegistry& IMetaSoundDocumentBuilderRegistry::GetChecked()
|
|
|
|
|
{
|
|
|
|
|
return static_cast<IMetaSoundDocumentBuilderRegistry&>(IDocumentBuilderRegistry::GetChecked());
|
|
|
|
|
}
|
2023-09-21 18:24:25 -04:00
|
|
|
} // namespace Metasound::Frontend
|