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"
33PXR_NAMESPACE_OPEN_SCOPE
39struct Usd_NonPopulatingStageCacheWrapper {
40 explicit Usd_NonPopulatingStageCacheWrapper(
const UsdStageCache &cache)
53template <
class StageCache>
54Usd_NonPopulatingStageCacheWrapper
55UsdUseButDoNotPopulateCache(StageCache &cache) {
56 return Usd_NonPopulatingStageCacheWrapper(cache);
59enum 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;
159PXR_NAMESPACE_CLOSE_SCOPE
A context object that lets the UsdStage::Open() API read from or read from and write to a UsdStageCac...
UsdStageCacheContext(Usd_NonPopulatingStageCacheWrapper holder)
Bind a cache for calls to UsdStage::Open() to read from.
UsdStageCacheContext(UsdStageCache &cache)
Bind a cache for calls to UsdStage::Open() to read from and write to.
UsdStageCacheContext(UsdStageCacheContextBlockType blockType)
Disable cache use completely (with UsdBlockStageCaches) or only for writing (with UsdBlockStageCacheW...
A strongly concurrency safe collection of UsdStageRefPtr s, enabling sharing across multiple clients ...
The outermost container for scene description, which owns and presents composed prims as a scenegraph...