summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodelbackgroundfetch.h
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-10-16 08:48:50 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-10-16 08:48:50 -0700
commitbd9c0a2e658e183bb8a321cdce546f10b6d76afe (patch)
tree349b40b0120af086837a44cf7046990568f59a97 /indra/newview/llinventorymodelbackgroundfetch.h
parent0bfeb74172b172fc3202d67fab04df25e23591b0 (diff)
parent71d0603773a0d406560fc6add8a61f7e8d3cdb27 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/newview/llinventorymodelbackgroundfetch.h')
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.h75
1 files changed, 50 insertions, 25 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index 00d2908c1b..e7be265a3d 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -47,9 +47,11 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
~LLInventoryModelBackgroundFetch();
public:
- // Start and stop background breadth-first fetching of inventory contents.
+ // Start background breadth-first fetching of inventory contents.
// This gets triggered when performing a filter-search.
- void start(const LLUUID& cat_id = LLUUID::null, BOOL recursive = TRUE);
+ void start(const LLUUID& cat_id = LLUUID::null, bool recursive = true);
+ void scheduleFolderFetch(const LLUUID& cat_id, bool forced = false);
+ void scheduleItemFetch(const LLUUID& item_id, bool forced = false);
BOOL folderFetchActive() const;
bool isEverythingFetched() const; // completing the fetch once per session should be sufficient
@@ -62,16 +64,47 @@ public:
bool inventoryFetchCompleted() const;
bool inventoryFetchInProgress() const;
- void findLostItems();
- void incrFetchCount(S32 fetching);
+ void findLostItems();
+ void incrFetchCount(S32 fetching);
+ void incrFetchFolderCount(S32 fetching);
bool isBulkFetchProcessingComplete() const;
+ bool isFolderFetchProcessingComplete() const;
void setAllFoldersFetched();
- void addRequestAtFront(const LLUUID & id, BOOL recursive, bool is_category);
- void addRequestAtBack(const LLUUID & id, BOOL recursive, bool is_category);
+ typedef boost::function<void()> folders_fetched_callback_t;
+ boost::signals2::connection setFetchCompletionCallback(folders_fetched_callback_t cb);
+
+ void addRequestAtFront(const LLUUID & id, bool recursive, bool is_category);
+ void addRequestAtBack(const LLUUID & id, bool recursive, bool is_category);
protected:
+
+ typedef enum {
+ FT_DEFAULT = 0,
+ FT_FORCED, // request non-recursively even if already loaded
+ FT_CONTENT_RECURSIVE, // request content recursively
+ FT_FOLDER_AND_CONTENT, // request folder, then content recursively
+ FT_RECURSIVE, // request everything recursively
+ } EFetchType;
+ struct FetchQueueInfo
+ {
+ FetchQueueInfo(const LLUUID& id, EFetchType recursive, bool is_category = true)
+ : mUUID(id),
+ mIsCategory(is_category),
+ mFetchType(recursive)
+ {}
+
+ LLUUID mUUID;
+ bool mIsCategory;
+ EFetchType mFetchType;
+ };
+ typedef std::deque<FetchQueueInfo> fetch_queue_t;
+
+ void onAISContentCalback(const LLUUID& request_id, const uuid_vec_t &content_ids, const LLUUID& response_id, EFetchType fetch_type);
+ void onAISFolderCalback(const LLUUID &request_id, const LLUUID &response_id, EFetchType fetch_type);
+ void bulkFetchViaAis();
+ void bulkFetchViaAis(const FetchQueueInfo& fetch_info);
void bulkFetch();
void backgroundFetch();
@@ -80,31 +113,23 @@ protected:
bool fetchQueueContainsNoDescendentsOf(const LLUUID& cat_id) const;
private:
- BOOL mRecursiveInventoryFetchStarted;
- BOOL mRecursiveLibraryFetchStarted;
- BOOL mAllFoldersFetched;
+ bool mRecursiveInventoryFetchStarted;
+ bool mRecursiveLibraryFetchStarted;
+ bool mAllRecursiveFoldersFetched;
+ typedef boost::signals2::signal<void()> folders_fetched_signal_t;
+ folders_fetched_signal_t mFoldersFetchedSignal;
- BOOL mBackgroundFetchActive;
+ bool mBackgroundFetchActive;
bool mFolderFetchActive;
S32 mFetchCount;
+ S32 mLastFetchCount; // for debug
+ S32 mFetchFolderCount;
LLFrameTimer mFetchTimer;
F32 mMinTimeBetweenFetches;
-
- struct FetchQueueInfo
- {
- FetchQueueInfo(const LLUUID& id, BOOL recursive, bool is_category = true)
- : mUUID(id),
- mIsCategory(is_category),
- mRecursive(recursive)
- {}
-
- LLUUID mUUID;
- bool mIsCategory;
- BOOL mRecursive;
- };
- typedef std::deque<FetchQueueInfo> fetch_queue_t;
- fetch_queue_t mFetchQueue;
+ fetch_queue_t mFetchFolderQueue;
+ fetch_queue_t mFetchItemQueue;
+ std::list<LLUUID> mExpectedFolderIds; // for debug, should this track time?
};
#endif // LL_LLINVENTORYMODELBACKGROUNDFETCH_H