QueueTable.h (1669B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include <winget/SQLiteWrapper.h> 5 #include <vector> 6 #include <tuple> 7 8 namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_2 9 { 10 struct QueueTable 11 { 12 QueueTable(AppInstaller::SQLite::Connection& connection); 13 14 // Creates the queue table. 15 void Create(); 16 17 // Adds the process column to the table. 18 void AddProcessColumn(); 19 20 // Adds a new queue item for the given configuration set and object name. 21 void AddQueueItemWithoutProcess(const GUID& instanceIdentifier, const std::string& objectName); 22 23 // Adds a new queue item for the given configuration set and object name. 24 void AddQueueItemWithProcess(const GUID& instanceIdentifier, const std::string& objectName); 25 26 // Sets the queue item with the given object name as active. 27 void SetActiveQueueItem(const std::string& objectName); 28 29 // Gets all queue items in queue order (item at index 0 is active/next). 30 std::vector<std::tuple<GUID, std::string, std::chrono::system_clock::time_point, DWORD, bool>> GetQueueItemsWithoutProcess(); 31 32 // Gets all queue items in queue order (item at index 0 is active/next). 33 std::vector<std::tuple<GUID, std::string, std::chrono::system_clock::time_point, DWORD, bool>> GetQueueItemsWithProcess(); 34 35 // Removes the queue item with the given object name. 36 void RemoveQueueItem(const std::string& objectName); 37 38 private: 39 AppInstaller::SQLite::Connection& m_connection; 40 }; 41 }