2019-12-26 14:45:42 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Modules/ModuleInterface.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Socket subsystem module class
|
|
|
|
|
* Wraps the loading of an socket subsystem by name and allows new services to register themselves for use
|
|
|
|
|
*/
|
|
|
|
|
class FSocketSubsystemModule : public IModuleInterface
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/** Name of the default socket subsystem defined by the platform */
|
|
|
|
|
FName DefaultSocketSubsystem;
|
|
|
|
|
|
|
|
|
|
/** Mapping of all currently loaded subsystems to their name */
|
|
|
|
|
TMap<FName, class ISocketSubsystem*> SocketSubsystems;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Shuts down all registered socket subsystem and unloads their modules
|
|
|
|
|
*/
|
|
|
|
|
virtual void ShutdownSocketSubsystem();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
FSocketSubsystemModule() {}
|
|
|
|
|
virtual ~FSocketSubsystemModule() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Main entry point for accessing a socket subsystem by name
|
|
|
|
|
* Will load the appropriate module if the subsystem isn't currently loaded
|
|
|
|
|
* It's possible that the subsystem doesn't exist and therefore can return NULL
|
|
|
|
|
*
|
|
|
|
|
* @param SubsystemName - name of subsystem as referenced by consumers
|
|
|
|
|
* @return Requested socket subsystem, or NULL if that subsystem was unable to load or doesn't exist
|
|
|
|
|
*/
|
|
|
|
|
virtual class ISocketSubsystem* GetSocketSubsystem(const FName InSubsystemName = NAME_None);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register a new socket subsystem interface with the base level factory provider
|
|
|
|
|
* @param FactoryName - name of subsystem as referenced by consumers
|
|
|
|
|
* @param Factory - instantiation of the socket subsystem interface, this will take ownership
|
|
|
|
|
* @param bMakeDefault - make this subsystem the default
|
|
|
|
|
*/
|
|
|
|
|
virtual void RegisterSocketSubsystem(const FName FactoryName, class ISocketSubsystem* Factory, bool bMakeDefault=false);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Unregister an existing online subsystem interface from the base level factory provider
|
|
|
|
|
* @param FactoryName - name of subsystem as referenced by consumers
|
|
|
|
|
*/
|
|
|
|
|
virtual void UnregisterSocketSubsystem(const FName FactoryName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// IModuleInterface
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called right after the module DLL has been loaded and the module object has been created
|
|
|
|
|
* Overloaded to allow the default subsystem a chance to load
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void StartupModule() override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called before the module is unloaded, right before the module object is destroyed.
|
|
|
|
|
* Overloaded to shut down all loaded online subsystems
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void ShutdownModule() override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Override this to set whether your module is allowed to be unloaded on the fly
|
|
|
|
|
*
|
|
|
|
|
* @return Whether the module supports shutdown separate from the rest of the engine.
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool SupportsDynamicReloading() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Override this to set whether your module would like cleanup on application shutdown
|
|
|
|
|
*
|
|
|
|
|
* @return Whether the module supports shutdown on application exit
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool SupportsAutomaticShutdown() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Public references to the socket subsystem module pointer should use this */
|
|
|
|
|
typedef TSharedPtr<FSocketSubsystemModule> FSocketSubsystemModulePtr;
|
|
|
|
|
|