Files
UnrealEngine/Engine/Plugins/Runtime/Firebase/Source/Public/Firebase.h
2025-05-18 13:04:45 +08:00

44 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
DECLARE_LOG_CATEGORY_EXTERN(LogFirebase, Log, All);
static const char* FIREBASE_MODULE_NAME = "Firebase";
class IFirebaseModuleInterface : public IModuleInterface
{
public:
/**
* Singleton-like access to this module's interface. This is just for convenience!
* Beware of calling this during the shutdown phase - the module might have been unloaded already.
*
* @return Returns singleton instance, loading the module on demand if needed
*/
static IFirebaseModuleInterface& Get()
{
return FModuleManager::LoadModuleChecked<IFirebaseModuleInterface>(FIREBASE_MODULE_NAME);
}
/**
* Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
*
* @return True if the module is loaded and ready to use
*/
static bool IsAvailable()
{
return FModuleManager::Get().IsModuleLoaded(FIREBASE_MODULE_NAME);
}
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
TMulticastDelegate<void(const FString&, const FString&)> OnTokenUpdate;
};