24 #ifndef PXR_USD_PCP_CACHE_H
25 #define PXR_USD_PCP_CACHE_H
44 #include <unordered_set>
52 class Pcp_Dependencies;
156 using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
205 const std::vector<std::string>& layersToUnmute,
290 template <
class ChildrenPredicate,
class PayloadPredicate>
293 const ChildrenPredicate &childrenPred,
294 const PayloadPredicate &payloadPred) {
296 childrenPred, payloadPred,
297 "Pcp",
"ComputePrimIndexesInParallel");
303 template <
class ChildrenPredicate,
class PayloadPredicate>
306 const ChildrenPredicate &childrenPred,
307 const PayloadPredicate &payloadPred,
308 const char *mallocTag1,
309 const char *mallocTag2) {
311 childrenPred, payloadPred,
312 mallocTag1, mallocTag2);
317 template <
class ChildrenPredicate,
class PayloadPredicate>
320 const ChildrenPredicate &childrenPred,
321 const PayloadPredicate &payloadPred) {
322 _UntypedIndexingChildrenPredicate cp(&childrenPred);
323 _UntypedIndexingPayloadPredicate pp(&payloadPred);
324 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
325 "Pcp",
"ComputePrimIndexesInParallel");
331 template <
class ChildrenPredicate,
class PayloadPredicate>
334 const ChildrenPredicate &childrenPred,
335 const PayloadPredicate &payloadPred,
336 const char *mallocTag1,
337 const char *mallocTag2) {
338 _UntypedIndexingChildrenPredicate cp(&childrenPred);
339 _UntypedIndexingPayloadPredicate pp(&payloadPred);
340 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
341 mallocTag1, mallocTag2);
377 const SdfSpecHandle &stopProperty,
378 bool includeStopProperty,
396 const SdfSpecHandle &stopProperty,
397 bool includeStopProperty,
415 const PcpLayerStackPtrVector&
438 bool filterForExistingCachesOnly)
const;
456 bool filterForExistingCachesOnly)
const;
468 const SdfLayerHandle&
layer,
469 SdfPath* allowedPathInLayer)
const;
514 const SdfPath &primIndexPath)
const;
581 struct _ParallelIndexer;
596 struct _UntypedIndexingChildrenPredicate {
597 _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
598 template <
class Pred>
599 explicit _UntypedIndexingChildrenPredicate(
const Pred *pred)
600 : pred(pred), invoke(_Invoke<Pred>) {}
604 return invoke(pred, index, childNamesToCompose);
607 template <
class Pred>
610 return (*static_cast<const Pred *>(pred))(
index, namesToCompose);
618 struct _UntypedIndexingPayloadPredicate {
619 template <
class Pred>
620 explicit _UntypedIndexingPayloadPredicate(
const Pred *pred)
621 : pred(pred), invoke(_Invoke<Pred>) {}
623 inline bool operator()(
const SdfPath &path)
const {
624 return invoke(pred, path);
627 template <
class Pred>
628 static bool _Invoke(
const void *pred,
const SdfPath &path) {
629 return (*static_cast<const Pred *>(pred))(
path);
632 bool (*invoke)(
const void *,
const SdfPath &);
637 _ComputePrimIndexWithCompatibleInputs(
650 void _ComputePrimIndexesInParallel(
653 _UntypedIndexingChildrenPredicate childrenPred,
654 _UntypedIndexingPayloadPredicate payloadPred,
655 const char *mallocTag1,
656 const char *mallocTag2);
659 void _RemovePrimAndPropertyCaches(
const SdfPath& root,
694 PcpLayerStackRefPtr _layerStack;
703 typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
708 _LayerStackCache _layerStackCache;
709 _PrimIndexCache _primIndexCache;
710 _PropertyIndexCache _propertyIndexCache;
711 std::unique_ptr<Pcp_Dependencies> _primDependencies;
714 std::unique_ptr<_ParallelIndexer> _parallelIndexer;
719 #endif // PXR_USD_PCP_CACHE_H
PCP_API bool CanHaveOpinionForSite(const SdfPath &localPcpSitePath, const SdfLayerHandle &layer, SdfPath *allowedPathInLayer) const
void ComputePrimIndexesInParallel(const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred)
PCP_API bool IsPayloadIncluded(const SdfPath &path) const
Return true if the payload is included for the given path.
PCP_API void Reload(PcpChanges *changes)
PCP_API bool IsLayerMuted(const std::string &layerIdentifier) const
PCP_API const PcpPropertyIndex & ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors)
PCP_API const std::string & GetFileFormatTarget() const
Returns the file format target this cache is configured for.
PCP_API PcpDependencyVector FindSiteDependencies(const PcpLayerStackPtr &siteLayerStack, const SdfPath &sitePath, PcpDependencyFlags depMask, bool recurseOnSite, bool recurseOnIndex, bool filterForExistingCachesOnly) const
PCP_API bool HasAnyDynamicFileFormatArgumentDependencies() const
PCP_API void RequestLayerMuting(const std::vector< std::string > &layersToMute, const std::vector< std::string > &layersToUnmute, PcpChanges *changes=nullptr)
PCP_API SdfLayerHandleSet GetUsedRootLayers() const
Returns set of all root layers used by this cache.
std::set< SdfHandleTo< SdfLayer >::Handle > SdfLayerHandleSet
PCP_API bool IsUsd() const
Return true if the cache is configured in Usd mode.
PCP_API const std::vector< std::string > & GetMutedLayers() const
PCP_API const PcpPrimIndex & ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors)
PCP_API std::vector< std::string > GetInvalidSublayerIdentifiers() const
void ComputePrimIndexesInParallel(const SdfPath &path, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred, const char *mallocTag1, const char *mallocTag2)
std::vector< PcpDependency > PcpDependencyVector
PCP_API const PcpDynamicFileFormatDependencyData & GetDynamicFileFormatArgumentDependencyData(const SdfPath &primIndexPath) const
PCP_API bool IsInvalidAssetPath(const std::string &resolvedAssetPath) const
friend const PcpPrimIndex & Pcp_ComputePrimIndexWithCompatibleInputs(PcpCache &cache, const SdfPath &path, const PcpPrimIndexInputs &inputs, PcpErrorVector *allErrors)
void ComputePrimIndexesInParallel(const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred, const char *mallocTag1, const char *mallocTag2)
PCP_API void ComputeAttributeConnectionPaths(const SdfPath &attributePath, SdfPathVector *paths, bool localOnly, const SdfSpecHandle &stopProperty, bool includeStopProperty, SdfPathVector *deletedPaths, PcpErrorVector *allErrors)
PCP_API const PcpPropertyIndex * FindPropertyIndex(const SdfPath &propPath) const
PCP_API void Apply(const PcpCacheChanges &changes, PcpLifeboat *lifeboat)
std::unordered_set< SdfPath, SdfPath::Hash > PayloadSet
Returns the payloads requested for inclusion.
PCP_API PcpLayerStackRefPtr ComputeLayerStack(const PcpLayerStackIdentifier &identifier, PcpErrorVector *allErrors)
PCP_API void RequestPayloads(const SdfPathSet &pathsToInclude, const SdfPathSet &pathsToExclude, PcpChanges *changes=NULL)
std::vector< TfToken > TfTokenVector
Convenience types.
PCP_API void ReloadReferences(PcpChanges *changes, const SdfPath &primPath)
friend class Pcp_Statistics
PCP_API const PcpLayerStackPtrVector & FindAllLayerStacksUsingLayer(const SdfLayerHandle &layer) const
Returns every computed & cached layer stack that includes layer.
PCP_API bool IsInvalidSublayerIdentifier(const std::string &identifier) const
SDF_DECLARE_HANDLES(SdfSpec)
std::vector< PcpErrorBasePtr > PcpErrorVector
PCP_API PcpLayerStackPtr GetLayerStack() const
PCP_API PcpLayerStackPtr FindLayerStack(const PcpLayerStackIdentifier &identifier) const
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
PCP_API const PcpPrimIndex * FindPrimIndex(const SdfPath &primPath) const
PCP_API void SetVariantFallbacks(const PcpVariantFallbackMap &map, PcpChanges *changes=NULL)
std::set< class SdfPath > SdfPathSet
A set of SdfPaths.
GLsizei const GLchar *const * path
PCP_API std::map< SdfPath, std::vector< std::string >, SdfPath::FastLessThan > GetInvalidAssetPaths() const
GLsizei const GLchar *const * string
TF_DECLARE_WEAK_AND_REF_PTRS(PcpLayerStack)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
PCP_API PcpVariantFallbackMap GetVariantFallbacks() const
PCP_API PcpLayerStackIdentifier GetLayerStackIdentifier() const
Get the identifier of the layerStack used for composition.
PCP_API SdfLayerHandleSet GetUsedLayers() const
Returns set of all layers used by this cache.
GLint GLboolean GLint layer
#define PXR_NAMESPACE_CLOSE_SCOPE
PCP_API PcpPrimIndexInputs GetPrimIndexInputs()
PCP_API bool IsPossibleDynamicFileFormatArgumentField(const TfToken &field) const
void ComputePrimIndexesInParallel(const SdfPath &path, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred)
PCP_API void ComputeRelationshipTargetPaths(const SdfPath &relationshipPath, SdfPathVector *paths, bool localOnly, const SdfSpecHandle &stopProperty, bool includeStopProperty, SdfPathVector *deletedPaths, PcpErrorVector *allErrors)
PCP_API PayloadSet const & GetIncludedPayloads() const
Returns the payloads requested for inclusion.
unsigned int PcpDependencyFlags
A typedef for a bitmask of flags from PcpDependencyType.
PCP_API void PrintStatistics() const
Prints various statistics about the data stored in this cache.
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
GLenum const void * paths