7#ifndef PXR_EXEC_ESF_USD_STAGE_DATA_H
8#define PXR_EXEC_ESF_USD_STAGE_DATA_H
14#include "pxr/exec/esfUsd/api.h"
18#include "pxr/usd/sdf/path.h"
20#ifdef TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS
21#include <tbb/concurrent_map.h>
23#define TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS 1
24#include <tbb/concurrent_map.h>
25#undef TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS
28#include <tbb/concurrent_unordered_map.h>
29#include <tbb/concurrent_unordered_set.h>
30#include <tbb/concurrent_vector.h>
34PXR_NAMESPACE_OPEN_SCOPE
66 const UsdStageConstPtr &stage);
78 const UsdStageConstPtr &stage);
109 const UsdStageConstPtr &stage,
117 const UsdStageConstPtr &stage,
121 const SdfPathVector &_GetOutgoingConnections(
124 SdfPathVector _GetIncomingConnections(
127 void _PopulateConnectionTables();
138 struct _PathRangeLessThan
140 using is_transparent = void;
146 bool operator()(
const SdfPath &lhs,
const _PathPrefix& rhs)
const {
147 return lhs < rhs.prefix || lhs.
HasPrefix(rhs.prefix);
152 using _OutgoingPathTable =
153 tbb::concurrent_map<SdfPath, SdfPathVector, _PathRangeLessThan>;
156 using _IncomingPathTable =
157 tbb::concurrent_unordered_map<
164 void _GetChangedConnectionTargets(
167 SdfPathVector *newConnections,
168 SdfPathVector *addedTargetPaths,
169 SdfPathVector *removedTargetPaths)
const;
178 void _UpdateForChangedPrim(
180 _IncomingPathTable *incomingToRemove,
187 void _UpdateForRemovedAttributes(
189 _IncomingPathTable *incomingToRemove,
190 tbb::concurrent_vector<SdfPath> *ownerAttrsToRemove)
const;
194 void _RemoveIncomingTableEntries(
195 const _IncomingPathTable &incomingToRemove);
198 const UsdStageConstPtr _stage;
200 _OutgoingPathTable _outgoing;
202 _IncomingPathTable _incoming;
205PXR_NAMESPACE_CLOSE_SCOPE
Class that holds data that is cached per-stage.
static ESFUSD_API const SdfPathVector & GetOutgoingConnections(const UsdStageConstPtr &stage, const SdfPath &attrPath)
Returns the paths of all objects that are targets of connections owned by the attribute at attrPath.
static ESFUSD_API SdfPathVector GetIncomingConnections(const UsdStageConstPtr &stage, const SdfPath &targetPath)
Returns the paths of all attributes that own connections that target the object at targetPath.
static ESFUSD_API std::shared_ptr< EsfUsdStageData > RegisterStage(const UsdStageConstPtr &stage)
Registers stage as a stage for which cached data should be held, returning a strong reference the cli...
tbb::concurrent_unordered_set< SdfPath, TfHash > ChangedPathSet
A concurent set of paths, used to indicate the set of targets for which incoming connections have cha...
ESFUSD_API void UpdateForResync(const SdfPath &resyncedPath, ChangedPathSet *incomingConnectionsChanged)
Updates attribute connection caches for connections owned by attribute at or under resyncedPath.
static ESFUSD_API EsfUsdStageData & GetStageData(const UsdStageConstPtr &stage)
Get the cached stage data for stage.
ESFUSD_API void UpdateForChangedAttributeConnections(const SdfPath &attrPath, ChangedPathSet *incomingConnectionsChanged)
Updates attribute connection caches for connections owned by the attribute at attrPath.
A path value used to locate objects in layers or scenegraphs.
SDF_API bool HasPrefix(const SdfPath &prefix) const
Return true if both this path and prefix are not the empty path and this path has prefix as a prefix.
A user-extensible hashing mechanism for use with runtime hash tables.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.