Files
UnrealEngineUWP/Engine/Source/Developer/TargetDeviceServices/Private/TargetDeviceProxyManager.h
Max Preussner 3aece47882 Docs: Removed file comments and added missing code documentation
Please note that file comments had no purpose in nearly all cases and just added visual clutter. The two files that had meaningful file comments had their comments moved into the corresponding classes. There are still hundreds of file comments left in other files that will be removed over time.

Also cleaned up some random stuff along the way:
- relative paths to public headers within the same module are no longer necessary (automatically discovered by UBT now)
- header guards are deprecated, use #pragma once instead (all compilers support it now)
- space between multiple template brackets is no longer required (all compilers support >> now)
- NULL to nullptr, OVERRIDE to override
- spelling errors, whitespace, line breaks

[CL 2104067 by Max Preussner in Main branch]
2014-06-12 23:22:18 -04:00

83 lines
2.1 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
/**
* Implements a class which locates devices based on criteria for use in the Launcher.
*/
class FTargetDeviceProxyManager
: public ITargetDeviceProxyManager
{
public:
/**
* Default constructor.
*/
FTargetDeviceProxyManager( );
/**
* Destructor.
*/
virtual ~FTargetDeviceProxyManager( );
public:
// ITargetDeviceProxyLocator interface
virtual ITargetDeviceProxyRef FindOrAddProxy( const FString& DeviceId ) override;
virtual ITargetDeviceProxyPtr FindProxy( const FString& DeviceId ) override;
virtual void GetProxies( const FString& PlatformName, bool IncludeUnshared, TArray<ITargetDeviceProxyPtr>& OutProxies ) override;
DECLARE_DERIVED_EVENT(FTargetDeviceProxyManager, ITargetDeviceProxyManager::FOnTargetDeviceProxyAdded, FOnTargetDeviceProxyAdded);
virtual FOnTargetDeviceProxyAdded& OnProxyAdded( ) override
{
return ProxyAddedDelegate;
}
DECLARE_DERIVED_EVENT(FTargetDeviceProxyManager, ITargetDeviceProxyManager::FOnTargetDeviceProxyRemoved, FOnTargetDeviceProxyRemoved);
virtual FOnTargetDeviceProxyRemoved& OnProxyRemoved( ) override
{
return ProxyRemovedDelegate;
}
protected:
/**
* Removes all target device proxies that timed out.
*/
void RemoveDeadProxies( );
/**
* Pings all target devices on the network.
*/
void SendPing( );
private:
// Handles FTargetDeviceServicePong messages.
void HandlePongMessage( const FTargetDeviceServicePong& Message, const IMessageContextRef& Context );
// Handles ticks from the ticker.
bool HandleTicker( float DeltaTime );
private:
// Holds the message endpoint.
FMessageEndpointPtr MessageEndpoint;
// Holds the collection of proxies.
TMap<FString, FTargetDeviceProxyPtr> Proxies;
private:
// Holds a delegate that is invoked when a target device proxy has been added.
FOnTargetDeviceProxyAdded ProxyAddedDelegate;
// Holds a delegate that is invoked when a target device proxy has been removed.
FOnTargetDeviceProxyRemoved ProxyRemovedDelegate;
// Holds a delegate to be invoked when the widget ticks.
FTickerDelegate TickDelegate;
};