AYON Usd Resolver  1.0.0
Loading...
Searching...
No Matches
ResolverContextCache Class Reference

Handles everything related to asset caching. More...

#include <resolverContextCache.h>

Collaboration diagram for ResolverContextCache:

Public Member Functions

 ResolverContextCache ()
 
 ~ResolverContextCache ()
 
void insert (AssetIdentifier &sourceAssetIdent)
 Move the asset into the preCache. More...
 
void migratePreCacheIntoAyonCache ()
 Move the precache into the AyonCache to free the precache. More...
 
AssetIdentifier getAsset (const std::string &assetIdentifier, const CacheName selectedCache, const bool isAyonPath)
 Return an asset by searching the selected cache. More...
 
void setCacheFromPinningFile (const std::string &pinningFilePath)
 Set up the cache from a pinning file. More...
 
void removeCachedObject (const std::string &key)
 Delete an entry from the cache. More...
 
void removeCachedObject (const std::string &key, const CacheName selectedCache)
 Delete an entry from a selected cache. More...
 
void ClearCache ()
 Clear the complete cache. More...
 
void printCache () const
 Print every object in the cache for debugging. More...
 
bool isCacheStatic () const
 Check if cache is static (no dynamic resolution) More...
 

Private Attributes

std::unordered_set< AssetIdentifier, AssetIdentifierHashm_PreCache
 
std::unordered_set< AssetIdentifier, AssetIdentifierHashm_AyonCache
 
std::unordered_set< AssetIdentifier, AssetIdentifierHashm_CommonCache
 
std::shared_mutex m_PreCacheSharedMutex
 
std::shared_mutex m_AyonCacheSharedMutex
 
std::shared_mutex m_CommonCacheSharedMutex
 
std::optional< std::unique_ptr< AyonApi > > m_ayon
 
bool m_staticCache
 
std::optional< PinningFileHandlerm_pinningFileHandler
 

Detailed Description

Handles everything related to asset caching.

Constructor & Destructor Documentation

◆ ResolverContextCache()

ResolverContextCache::ResolverContextCache ( )
Here is the call graph for this function:

◆ ~ResolverContextCache()

ResolverContextCache::~ResolverContextCache ( )

Member Function Documentation

◆ ClearCache()

void ResolverContextCache::ClearCache ( )

Clear the complete cache.

◆ getAsset()

AssetIdentifier ResolverContextCache::getAsset ( const std::string &  assetIdentifier,
const CacheName  selectedCache,
const bool  isAyonPath 
)

Return an asset by searching the selected cache.

If not found, resolve against AYON. Returns empty path if resolution fails.

Parameters
assetIdentifierThe asset URI to resolve
selectedCacheWhich cache to search first
isAyonPathWhether this is an AYON URI
Returns
AssetIdentifier with resolved path
Here is the call graph for this function:

◆ insert()

void ResolverContextCache::insert ( AssetIdentifier sourceAssetIdent)

Move the asset into the preCache.

Checks space and migrates if needed. This function is both locking and blocking.

Parameters
sourceAssetIdentThe asset data to add to the cache
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCacheStatic()

bool ResolverContextCache::isCacheStatic ( ) const

Check if cache is static (no dynamic resolution)

◆ migratePreCacheIntoAyonCache()

void ResolverContextCache::migratePreCacheIntoAyonCache ( )

Move the precache into the AyonCache to free the precache.

Here is the caller graph for this function:

◆ printCache()

void ResolverContextCache::printCache ( ) const

Print every object in the cache for debugging.

◆ removeCachedObject() [1/2]

void ResolverContextCache::removeCachedObject ( const std::string &  key)

Delete an entry from the cache.

Parameters
keyThe asset identifier/URI

◆ removeCachedObject() [2/2]

void ResolverContextCache::removeCachedObject ( const std::string &  key,
const CacheName  selectedCache 
)

Delete an entry from a selected cache.

PreCache is always searched.

Parameters
keyThe asset identifier/URI
selectedCacheWhich cache to remove from

◆ setCacheFromPinningFile()

void ResolverContextCache::setCacheFromPinningFile ( const std::string &  pinningFilePath)

Set up the cache from a pinning file.

Parameters
pinningFilePathPath to the pinning file

Member Data Documentation

◆ m_ayon

std::optional<std::unique_ptr<AyonApi> > ResolverContextCache::m_ayon
private

◆ m_AyonCache

std::unordered_set<AssetIdentifier, AssetIdentifierHash> ResolverContextCache::m_AyonCache
private

◆ m_AyonCacheSharedMutex

std::shared_mutex ResolverContextCache::m_AyonCacheSharedMutex
mutableprivate

◆ m_CommonCache

std::unordered_set<AssetIdentifier, AssetIdentifierHash> ResolverContextCache::m_CommonCache
private

◆ m_CommonCacheSharedMutex

std::shared_mutex ResolverContextCache::m_CommonCacheSharedMutex
mutableprivate

◆ m_pinningFileHandler

std::optional<PinningFileHandler> ResolverContextCache::m_pinningFileHandler
private

◆ m_PreCache

std::unordered_set<AssetIdentifier, AssetIdentifierHash> ResolverContextCache::m_PreCache
private

◆ m_PreCacheSharedMutex

std::shared_mutex ResolverContextCache::m_PreCacheSharedMutex
mutableprivate

◆ m_staticCache

bool ResolverContextCache::m_staticCache
private

The documentation for this class was generated from the following files: