winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ResumeFlow.h (1247B)


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