Files
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

65 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
#include "Delegates/Delegate.h"
#include "ITargetDeviceService.h"
#include "Templates/SharedPointer.h"
class FDeviceManagerModel;
/**
* Implements a view model for the messaging debugger.
*/
class FDeviceManagerModel
{
public:
/**
* Get the device service that is currently selected in the device browser.
*
* @return The selected device service.
*/
TSharedPtr<ITargetDeviceService, ESPMode::ThreadSafe> GetSelectedDeviceService() const
{
return SelectedDeviceService;
}
/**
* Select the specified device service (or none if nullptr).
*
* @param DeviceService The device service to select.
*/
void SelectDeviceService(const TSharedPtr<ITargetDeviceService, ESPMode::ThreadSafe>& DeviceService)
{
if (SelectedDeviceService != DeviceService)
{
SelectedDeviceService = DeviceService;
SelectedDeviceServiceChangedEvent.Broadcast();
}
}
public:
/**
* Get an event delegate that is invoked when the selected device service has changed.
*
* @return The event delegate.
*/
DECLARE_EVENT(FDeviceManagerModel, FOnSelectedDeviceServiceChanged);
FOnSelectedDeviceServiceChanged& OnSelectedDeviceServiceChanged()
{
return SelectedDeviceServiceChangedEvent;
}
private:
/** The currently selected target device service. */
TSharedPtr<ITargetDeviceService, ESPMode::ThreadSafe> SelectedDeviceService;
/** An event delegate that is invoked when the selected message has changed. */
FOnSelectedDeviceServiceChanged SelectedDeviceServiceChangedEvent;
};