// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text;
namespace Gauntlet
{
///
/// Interface that represents an instance of an app running on a device
///
public interface IAppInstance
{
///
/// Returns true/false if the process has exited for any reason
///
bool HasExited { get; }
///
/// Current StdOut of the process. Not efficient when the process is running. Use GetLogBufferReader() instead.
///
string StdOut { get; }
///
/// Return a new log reader with an internal cursor
///
ILogStreamReader GetLogReader();
///
/// Return a new log buffer reader with an internal cursor. Might not give access to the full log content (usually the last 1024 lines).
/// Use GetLogReader() if you need the log from the beginning.
///
///
ILogStreamReader GetLogBufferReader();
///
/// Write output to file. Return true if there was output data to write.
///
///
///
bool WriteOutputToFile(string FilePath);
///
/// Exit code of the process.
///
int ExitCode { get; }
///
/// Returns true if the process exited due to Kill() being called
///
bool WasKilled { get; }
///
/// Path to commandline used to start the process
///
string CommandLine { get; }
///
/// Path to artifacts from the process
///
string ArtifactPath { get; }
///
/// Device that the app was run on
///
ITargetDevice Device { get; }
///
/// Kills the process if its running (no need to call WaitForExit)
///
void Kill(bool GenerateDumpOnKill = false);
///
/// Waits for the process to exit normally
///
///
int WaitForExit();
}
///
/// Interface used by IAppInstance if they support Suspend/Resume
///
public interface IWithPLMSuspend
{
///
/// Attempt to suspend the running application. Correlates to FCoreDelegates::ApplicationWillEnterBackgroundDelegate
///
bool Suspend();
///
/// Attempts to resume a suspended application. Correlates to FCoreDelegates::ApplicationHasEnteredForegroundDelegate
///
bool Resume();
}
///
/// Interface used by IAppInstance if they support Constrain/Unconstrain
///
public interface IWithPLMConstrain
{
///
/// Attempts to contrain the running application. Correlates to FCoreDelegates::ApplicationWillDeactivateDelegate
///
bool Constrain();
///
/// Attempts to unconstained a constrained application. Correlates to FCoreDelegates::ApplicationHasReactivatedDelegate
///
bool Unconstrain();
}
}