forked from Azure/iot-hub-device-update
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent_handler.hpp
60 lines (50 loc) · 1.71 KB
/
content_handler.hpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* @file content_handler.hpp
* @brief Defines ContentHandler interface.
*
* @copyright Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*/
#ifndef ADUC_CONTENT_HANDLER_HPP
#define ADUC_CONTENT_HANDLER_HPP
#include <aduc/c_utils.h>
#include <aduc/contract_utils.h>
#include <aduc/result.h>
// Forward declaration.
struct tagADUC_WorkflowData;
/**
* @interface ContentHandler
* @brief Interface for content specific handler implementations.
*/
class ContentHandler
{
public:
// Delete copy ctor, copy assignment, move ctor and move assignment operators.
ContentHandler(const ContentHandler&) = delete;
ContentHandler& operator=(const ContentHandler&) = delete;
ContentHandler(ContentHandler&&) = delete;
ContentHandler& operator=(ContentHandler&&) = delete;
virtual ADUC_Result Download(const tagADUC_WorkflowData* workflowData) = 0;
virtual ADUC_Result Backup(const tagADUC_WorkflowData* workflowData) = 0;
virtual ADUC_Result Install(const tagADUC_WorkflowData* workflowData) = 0;
virtual ADUC_Result Apply(const tagADUC_WorkflowData* workflowData) = 0;
virtual ADUC_Result Restore(const tagADUC_WorkflowData* workflowData) = 0;
virtual ADUC_Result Cancel(const tagADUC_WorkflowData* workflowData) = 0;
virtual ADUC_Result IsInstalled(const tagADUC_WorkflowData* workflowData) = 0;
virtual ~ContentHandler()
{
}
void SetContractInfo(const ADUC_ExtensionContractInfo& info)
{
contractInfo = info;
}
ADUC_ExtensionContractInfo GetContractInfo() const
{
return contractInfo;
}
protected:
ContentHandler() = default;
private:
ADUC_ExtensionContractInfo contractInfo{};
};
#endif // ADUC_CONTENT_HANDLER_HPP