// Copyright (c) Microsoft Corporation. 
// Licensed under the MIT license.

#pragma once

#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"

namespace Simplygon { 
class ISimplygon;
}

/**
 * @brief Module to fetch the ISimplygon factory.
*/
class ISimplygonModule : public IModuleInterface
{
	public:
	/**
		* @brief Get the SimplygonModule.
		* @return Returns a reference to ISimplygonModule.
	*/
	static inline ISimplygonModule& Get()
	{
		return FModuleManager::LoadModuleChecked<ISimplygonModule>("Simplygon");
	}

	/**
	 * @brief Pointer to Simplygon factory for creating simplygon types.
	 * @return A valid pointer or nullptr
	*/
	virtual Simplygon::ISimplygon* GetSDK(bool bValidate = false) = 0;

	/**
	 * Check if the plugin is using local Simplygon path or the global Simplygon environment variable
	 * @return If true, plugin is setup using local Simplygon SDK path
	*/
	virtual bool IsUsingLocalSdkPath() = 0;

	/**
	 * Get the path to Simplygon SDK directory
	 * @return Path to where Simplygon SDK is found
	*/
	virtual FString GetSimplygonSDKPath() = 0;

	virtual void SendTelemetryData(const FString& Json = TEXT("{}"), const FString& Category = TEXT("Plugin")) = 0;

	/*
	* When using rpmalloc for memory allocation. And SIMPLYGON_<VER>_FLAGS="MemoryTracker=<pathtologfile>" is set will dump rpmalloc stats to file.
	*/
	virtual void DumpMemoryStatistics() const = 0;
};
