forked from microsoft/winget-cli
/
ResumeFlow.h
36 lines (31 loc) · 1.22 KB
/
ResumeFlow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include "ExecutionContext.h"
namespace AppInstaller::CLI::Workflow
{
// Applies a checkpoint to the context workflow.
// Required Args: None
// Inputs: Context data, command arguments, client version
// Outputs: None
struct Checkpoint : public WorkflowTask
{
Checkpoint(std::string_view checkpointName, std::vector<Execution::Data> contextData) :
WorkflowTask("Checkpoint"),
m_checkpointName(checkpointName),
m_contextData(std::move(contextData)) {}
void operator()(Execution::Context& context) const override;
private:
std::string_view m_checkpointName;
std::vector<Execution::Data> m_contextData;
};
// Registers the resume command to execute upon reboot if applicable. This task always executes even if context terminates.
// Required Args: None
// Inputs: None
// Outputs: None
struct RegisterStartupAfterReboot : public WorkflowTask
{
RegisterStartupAfterReboot() : WorkflowTask("RegisterStartupAfterReboot", /* executeAlways*/ true) {}
void operator()(Execution::Context & context) const override;
};
}