HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GusdStageCacheWriter Class Reference

#include <stageCache.h>

+ Inheritance diagram for GusdStageCacheWriter:

Public Member Functions

 GusdStageCacheWriter (GusdStageCache &cache=GusdStageCache::GetInstance())
 
 GusdStageCacheWriter (const GusdStageCacheWriter &)=delete
 
GusdStageCacheWriteroperator= (const GusdStageCacheWriter &)=delete
 
void FindStages (const UT_StringSet &paths, UT_Set< UsdStageRefPtr > &stages)
 
void Clear ()
 
exint ClearEntriesFromDisk ()
 
void Clear (const UT_StringSet &paths)
 
void ReloadStages (const UT_StringSet &paths)
 Reload all stages matching the given paths. More...
 
- Public Member Functions inherited from GusdStageCacheReader
 GusdStageCacheReader (GusdStageCache &cache=GusdStageCache::GetInstance())
 Construct a reader for the cache singleton. More...
 
 GusdStageCacheReader (const GusdStageCacheReader &)=delete
 
GusdStageCacheReaderoperator= (const GusdStageCacheReader &)=delete
 
 ~GusdStageCacheReader ()
 
UsdStageRefPtr Find (const UT_StringRef &path, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), const GusdStageEditPtr &edit=nullptr) const
 Find an existing stage on the cache. More...
 
UsdStageRefPtr FindOrOpen (const UT_StringRef &path, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), const GusdStageEditPtr &edit=nullptr, UT_ErrorSeverity sev=UT_ERROR_ABORT)
 
void InsertStage (UsdStageRefPtr &stage, const UT_StringRef &path, const GusdStageOpts &opts, const GusdStageEditPtr &edit)
 
DEP_MicroNodeGetStageMicroNode (const UsdStagePtr &stage)
 
PrimStagePair GetPrim (const UT_StringRef &path, const SdfPath &primPath, const GusdStageEditPtr &stageEdit=GusdStageEditPtr(), const GusdStageOpts &opts=GusdStageOpts::LoadAll(), UT_ErrorSeverity sev=UT_ERROR_ABORT)
 
bool GetPrims (const GusdDefaultArray< UT_StringHolder > &filePaths, const UT_Array< SdfPath > &primPaths, const GusdDefaultArray< GusdStageEditPtr > &edits, UsdPrim *prims, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), UT_ErrorSeverity sev=UT_ERROR_ABORT)
 
PrimStagePair GetPrimWithVariants (const UT_StringRef &path, const SdfPath &primPath, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), UT_ErrorSeverity sev=UT_ERROR_ABORT)
 
PrimStagePair GetPrimWithVariants (const UT_StringRef &path, const UT_StringRef &primPath, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), UT_ErrorSeverity sev=UT_ERROR_ABORT)
 
PrimStagePair GetPrimWithVariants (const UT_StringRef &path, const SdfPath &primPath, const SdfPath &variants, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), UT_ErrorSeverity sev=UT_ERROR_ABORT)
 Different variations of the above the variants are stored separately. More...
 
PrimStagePair GetPrimWithVariants (const UT_StringRef &path, const UT_StringRef &primPath, const UT_StringRef &variants, const GusdStageOpts &opts=GusdStageOpts::LoadAll(), UT_ErrorSeverity sev=UT_ERROR_ABORT)
 

Additional Inherited Members

- Public Types inherited from GusdStageCacheReader
using PrimStagePair = std::pair< UsdPrim, UsdStageRefPtr >
 
- Protected Member Functions inherited from GusdStageCacheReader
 GusdStageCacheReader (GusdStageCache &cache, bool writer)
 
- Protected Attributes inherited from GusdStageCacheReader
GusdStageCache_cache
 
const bool _writer
 

Detailed Description

Write accessor for a stage cache. Write accessors have all of the capabilities of readers, and can also remove elements from the cache and manipulate child data caches. Writers gain exclusive locks to the cache, and should be used sparingly.

Definition at line 341 of file stageCache.h.

Constructor & Destructor Documentation

GusdStageCacheWriter::GusdStageCacheWriter ( GusdStageCache cache = GusdStageCache::GetInstance())
GusdStageCacheWriter::GusdStageCacheWriter ( const GusdStageCacheWriter )
delete

Member Function Documentation

void GusdStageCacheWriter::Clear ( )

Reloading And Clearing

During active sessions, the contents of a cache may be refreshed by either reloading a subset of the stages that it contains, or by removing stage entries from the cache. In either case, if a stage is reloaded or evicted from the cache, and if that stage has a micro node (see: GusdStageCacheReader::GetMicroNode), then that micro node, and any OP_Node instances that reference it, are dirtied. This means that any nodes whose cook is based on data from a cached stage will properly update in response to Clear()/Reload() actions.

Dirty state propagation is not thread safe, and should only be called at a safe point on the main thread, such as through a callback triggered by a UI button. Also note that there may be side effects from reloading stages that affect stages from other caches. See Reloading for more information on the caveats of reloading. Clear out all cached items. Note that layers are owned by a different cache, and may stay active beyond this point.

void GusdStageCacheWriter::Clear ( const UT_StringSet paths)

Variant of Clear() that causes any stages whose root layer has an asset path in the paths set to be removed from the cache.

exint GusdStageCacheWriter::ClearEntriesFromDisk ( )

Variant of Clear() that does not remove cached stages from LOPs. Returns the number of entries that were removed.

void GusdStageCacheWriter::FindStages ( const UT_StringSet paths,
UT_Set< UsdStageRefPtr > &  stages 
)

Find all stages on the cache matching the given paths. Multiple stages may be found for each path.

GusdStageCacheWriter& GusdStageCacheWriter::operator= ( const GusdStageCacheWriter )
delete
void GusdStageCacheWriter::ReloadStages ( const UT_StringSet paths)

Reload all stages matching the given paths.


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