1#ifndef AR_AYONUSDRESOLVER_RESOLVER_CONTEXT_CACHE_H
2#define AR_AYONUSDRESOLVER_RESOLVER_CONTEXT_CACHE_H
8#include <unordered_map>
10#include "AyonCppApi.h"
11#include "../cache/assetIdentDef.h"
12#include <nlohmann/json.hpp>
21 const std::unordered_map<std::string, std::string> &rootReplaceData);
cache element class used to represent an Usd asset in cache for the resolver
Definition: assetIdentDef.h:16
Definition: resolverContextCache.h:18
std::unordered_map< std::string, std::string > m_rootReplaceData
Definition: resolverContextCache.h:30
std::filesystem::path m_pinningFilePath
Definition: resolverContextCache.h:27
assetIdent getAssetData(const std::string &resolveKey)
return assetIdent populated with root rootReplaceData from the pinning file using the pinning file da...
Definition: resolverContextCache.cpp:66
~pinningFileHandler()=default
nlohmann::json m_pinningFileData
Definition: resolverContextCache.h:28
this class handles everything related to asset caching
Definition: resolverContextCache.h:38
bool isCacheStatic() const
Definition: resolverContextCache.cpp:367
std::optional< AyonApi > m_ayon
Definition: resolverContextCache.h:111
std::unordered_set< assetIdent, assetIdentHash > m_CommonCache
Definition: resolverContextCache.h:105
bool m_static_cache
Definition: resolverContextCache.h:112
void printCache() const
print out every object in the cache for debugging
Definition: resolverContextCache.cpp:112
std::optional< pinningFileHandler > m_pinningFileHandler
Definition: resolverContextCache.h:114
std::shared_mutex m_CommonCachesharedMutex
Definition: resolverContextCache.h:109
resolverContextCache()
Definition: resolverContextCache.cpp:88
void insert(assetIdent &sourceAssetIdent)
move the pair into the preCache by using the move operator it will also check if there is enough spac...
Definition: resolverContextCache.cpp:141
void migratePreCacheIntoAyonCache()
move the precache into the AyonCache in order to free the precache
Definition: resolverContextCache.cpp:155
assetIdent getAsset(const std::string &assetIdentifier, const cacheName &selectedCache, const bool &isAyonPath)
return a struct by first searching through the selected cacheName if no cache hit.
Definition: resolverContextCache.cpp:166
~resolverContextCache()
Definition: resolverContextCache.cpp:106
std::shared_mutex m_PreCachesharedMutex
Definition: resolverContextCache.h:107
void setCacheFromPinningFile(const std::string &pinningFilePath)
set up the cache from a pinning file
void removeCachedObject(const std::string &key)
this function allows the deletion of an entry in the cache
Definition: resolverContextCache.cpp:261
std::unordered_set< assetIdent, assetIdentHash > m_PreCache
Definition: resolverContextCache.h:103
std::unordered_set< assetIdent, assetIdentHash > m_AyonCache
Definition: resolverContextCache.h:104
std::shared_mutex m_AyonCachesharedMutex
Definition: resolverContextCache.h:108
void clearCache()
clear the complete cache
Definition: resolverContextCache.cpp:355
Definition: wrapResolverTokens.cpp:14
cacheName
Definition: resolverContextCache.h:16
@ COMMONCACHE
Definition: resolverContextCache.h:16
@ AYONCACHE
Definition: resolverContextCache.h:16