From 4a227e0523391bc026bf96c3c31d44a39cac1701 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 7 Oct 2025 14:32:48 -0400 Subject: [WARP] Format UI plugin --- plugins/warp/ui/shared/fetcher.h | 45 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'plugins/warp/ui/shared/fetcher.h') diff --git a/plugins/warp/ui/shared/fetcher.h b/plugins/warp/ui/shared/fetcher.h index 917ac912..52d0a0e2 100644 --- a/plugins/warp/ui/shared/fetcher.h +++ b/plugins/warp/ui/shared/fetcher.h @@ -12,43 +12,44 @@ enum WarpFetchCompletionStatus { - KeepCallback, - RemoveCallback, + KeepCallback, + RemoveCallback, }; // Responsible for fetching data from the containers, to later be queried from the container interface. class WarpFetcher { - LoggerRef m_logger; + LoggerRef m_logger; - std::mutex m_requestMutex; - std::vector m_pendingRequests; - std::unordered_set m_processedGuids; + std::mutex m_requestMutex; + std::vector m_pendingRequests; + std::unordered_set m_processedGuids; - // List of callbacks to call when done fetching data, assume that others are using this as well. - std::vector > m_completionCallbacks; + // List of callbacks to call when done fetching data, assume that others are using this as well. + std::vector> m_completionCallbacks; public: - explicit WarpFetcher(); + explicit WarpFetcher(); - // The global fetcher instance, this is used for the fetch dialog and the sidebar. - static std::shared_ptr Global(); + // The global fetcher instance, this is used for the fetch dialog and the sidebar. + static std::shared_ptr Global(); - std::atomic m_requestInProgress = false; + std::atomic m_requestInProgress = false; - void AddCompletionCallback(std::function cb) - { - std::lock_guard lock(m_requestMutex); - m_completionCallbacks.push_back(std::move(cb)); - } + void AddCompletionCallback(std::function cb) + { + std::lock_guard lock(m_requestMutex); + m_completionCallbacks.push_back(std::move(cb)); + } - void AddPendingFunction(const FunctionRef &func); + void AddPendingFunction(const FunctionRef& func); - void FetchPendingFunctions(const std::vector& allowedTags); + void FetchPendingFunctions(const std::vector& allowedTags); + + void ClearProcessed(); - void ClearProcessed(); private: - std::vector FlushPendingFunctions(); + std::vector FlushPendingFunctions(); - void ExecuteCompletionCallback(); + void ExecuteCompletionCallback(); }; -- cgit v1.3.1