AYON Usd Resolver  0.1.0
Loading...
Searching...
No Matches
resolverContextCache Class Reference

this class handles everything related to asset caching More...

#include <resolverContextCache.h>

Collaboration diagram for resolverContextCache:

Public Member Functions

 resolverContextCache ()
 
 ~resolverContextCache ()
 
void insert (assetIdent &sourceAssetIdent)
 move the pair into the preCache by using the move operator it will also check if there is enough space in the preCache and move the preCache if needed. More...
 
void migratePreCacheIntoAyonCache ()
 move the precache into the AyonCache in order to free the precache More...
 
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. More...
 
void setCacheFromPinningFile (const std::string &pinningFilePath)
 set up the cache from a pinning file More...
 
void removeCachedObject (const std::string &key)
 this function allows the deletion of an entry in the cache More...
 
void removeCachedObject (const std::string &key, const cacheName &selectedCache)
 delete an entry in a selected cache. More...
 
void clearCache ()
 clear the complete cache More...
 
void printCache () const
 print out every object in the cache for debugging More...
 
bool isCacheStatic () const
 

Private Attributes

std::unordered_set< assetIdent, assetIdentHashm_PreCache
 
std::unordered_set< assetIdent, assetIdentHashm_AyonCache
 
std::unordered_set< assetIdent, assetIdentHashm_CommonCache
 
std::shared_mutex m_PreCachesharedMutex
 
std::shared_mutex m_AyonCachesharedMutex
 
std::shared_mutex m_CommonCachesharedMutex
 
std::optional< AyonApi > m_ayon
 
bool m_static_cache
 
std::optional< pinningFileHandlerm_pinningFileHandler
 

Detailed Description

this class handles everything related to asset caching

Constructor & Destructor Documentation

◆ resolverContextCache()

PXR_NAMESPACE_USING_DIRECTIVE resolverContextCache::resolverContextCache ( )

◆ ~resolverContextCache()

resolverContextCache::~resolverContextCache ( )

Member Function Documentation

◆ clearCache()

void resolverContextCache::clearCache ( )

clear the complete cache

◆ getAsset()

assetIdent resolverContextCache::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.

then the function will resolve the path against ayon if even that doesn't work it will return an empty path

Parameters
assetIdentifier
Returns
Here is the call graph for this function:

◆ insert()

void resolverContextCache::insert ( assetIdent sourceAssetIdent)

move the pair into the preCache by using the move operator it will also check if there is enough space in the preCache and move the preCache if needed.

This function is both locking and blocking so no access will be granted to ayonCache or preCache for the scope of this function

Parameters
sourcePairthe data that you want to add to the cache as an std::pair
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCacheStatic()

bool resolverContextCache::isCacheStatic ( ) const

◆ migratePreCacheIntoAyonCache()

void resolverContextCache::migratePreCacheIntoAyonCache ( )

move the precache into the AyonCache in order to free the precache

Here is the caller graph for this function:

◆ printCache()

void resolverContextCache::printCache ( ) const

print out every object in the cache for debugging

◆ removeCachedObject() [1/2]

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

this function allows the deletion of an entry in the cache

Parameters
keythe asset identifier / uri of the usd object.

◆ removeCachedObject() [2/2]

void resolverContextCache::removeCachedObject ( const std::string &  key,
const cacheName selectedCache 
)

delete an entry in a selected cache.

the PreCache will always we searched for the entry.

Parameters
keythe asset identifier / uri of the usd object.
selectedCacheenum that allows you to select the cache (cacheName enum)

◆ setCacheFromPinningFile()

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

set up the cache from a pinning file

Parameters
pinningFilePath

Member Data Documentation

◆ m_ayon

std::optional<AyonApi> resolverContextCache::m_ayon
private

◆ m_AyonCache

std::unordered_set<assetIdent, assetIdentHash> resolverContextCache::m_AyonCache
private

◆ m_AyonCachesharedMutex

std::shared_mutex resolverContextCache::m_AyonCachesharedMutex
mutableprivate

◆ m_CommonCache

std::unordered_set<assetIdent, assetIdentHash> 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<assetIdent, assetIdentHash> resolverContextCache::m_PreCache
private

◆ m_PreCachesharedMutex

std::shared_mutex resolverContextCache::m_PreCachesharedMutex
mutableprivate

◆ m_static_cache

bool resolverContextCache::m_static_cache
private

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