24 #ifndef PXR_USD_USD_STAGE_CACHE_CONTEXT_H
25 #define PXR_USD_USD_STAGE_CACHE_CONTEXT_H
28 #include "pxr/usd/usd/api.h"
29 #include "pxr/base/tf/stacked.h"
33 PXR_NAMESPACE_OPEN_SCOPE
39 struct Usd_NonPopulatingStageCacheWrapper {
40 explicit Usd_NonPopulatingStageCacheWrapper(
const UsdStageCache &cache)
53 template <
class StageCache>
54 Usd_NonPopulatingStageCacheWrapper
55 UsdUseButDoNotPopulateCache(StageCache &cache) {
56 return Usd_NonPopulatingStageCacheWrapper(cache);
59 enum UsdStageCacheContextBlockType
68 UsdBlockStageCachePopulation,
127 , _isReadOnlyCache(false)
128 , _blockType(Usd_NoBlock) {}
133 : _roCache(&holder.cache)
134 , _isReadOnlyCache(true)
135 , _blockType(Usd_NoBlock) {}
140 : _blockType(blockType) {}
145 static std::vector<const UsdStageCache *> _GetReadOnlyCaches();
146 static std::vector<const UsdStageCache *> _GetReadableCaches();
147 static std::vector<UsdStageCache *> _GetWritableCaches();
154 bool _isReadOnlyCache;
155 UsdStageCacheContextBlockType _blockType;
159 PXR_NAMESPACE_CLOSE_SCOPE
161 #endif // PXR_USD_USD_STAGE_CACHE_CONTEXT_H
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
UsdStageCacheContext(UsdStageCache &cache)
Bind a cache for calls to UsdStage::Open() to read from and write to.
A context object that lets the UsdStage::Open() API read from or read from and write to a UsdStageCac...
A strongly concurrency safe collection of UsdStageRefPtr s, enabling sharing across multiple clients ...
UsdStageCacheContext(Usd_NonPopulatingStageCacheWrapper holder)
Bind a cache for calls to UsdStage::Open() to read from.
UsdStageCacheContext(UsdStageCacheContextBlockType blockType)
Disable cache use completely (with UsdBlockStageCaches) or only for writing (with UsdBlockStageCacheW...