7 #ifndef PXR_EXEC_ESF_USD_STAGE_DATA_H
8 #define PXR_EXEC_ESF_USD_STAGE_DATA_H
21 #ifdef TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS
22 #include <tbb/concurrent_map.h>
24 #define TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS 1
25 #include <tbb/concurrent_map.h>
26 #undef TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS
29 #include <tbb/concurrent_unordered_map.h>
30 #include <tbb/concurrent_unordered_set.h>
31 #include <tbb/concurrent_vector.h>
78 virtual void _DidObjectsChanged(
95 const UsdStageConstPtr &stage,
114 const UsdStageConstPtr &stage);
121 const UsdStageConstPtr &stage,
129 const UsdStageConstPtr &stage,
133 const UsdStageConstPtr &_GetStage()
const {
return _stage; }
141 void _PopulateConnectionTables();
152 struct _PathRangeLessThan
154 using is_transparent =
void;
160 bool operator()(
const SdfPath &lhs,
const _PathPrefix& rhs)
const {
161 return lhs < rhs.prefix || lhs.
HasPrefix(rhs.prefix);
166 using _OutgoingPathTable =
167 tbb::concurrent_map<SdfPath, SdfPathVector, _PathRangeLessThan>;
170 using _IncomingPathTable =
171 tbb::concurrent_unordered_map<
178 void _GetChangedConnectionTargets(
191 void _UpdateForChangedAttributeConnections(
198 void _UpdateForResync(
209 void _UpdateForChangedPrim(
211 _IncomingPathTable *incomingToRemove,
218 void _UpdateForRemovedAttributes(
220 _IncomingPathTable *incomingToRemove,
221 tbb::concurrent_vector<SdfPath> *ownerAttrsToRemove)
const;
224 void _RemoveIncomingTableEntries(
225 const _IncomingPathTable &incomingToRemove);
233 const UsdStageConstPtr _stage;
236 class _NoticeListener;
237 const std::unique_ptr<_NoticeListener> _noticeListener;
240 std::vector<const ListenerBase *> _listeners;
241 mutable std::mutex _listenersMutex;
243 _OutgoingPathTable _outgoing;
245 _IncomingPathTable _incoming;
static ESFUSD_API std::shared_ptr< EsfUsdStageData > RegisterStage(const UsdStageConstPtr &stage, const ListenerBase *listener)
static ESFUSD_API const SdfPathVector & GetOutgoingConnections(const UsdStageConstPtr &stage, const SdfPath &attrPath)
TF_DECLARE_WEAK_PTRS(UsdStage)
#define PXR_NAMESPACE_OPEN_SCOPE
ESFUSD_API void Unregister(const ListenerBase *listener)
std::vector< class SdfPath > SdfPathVector
static ESFUSD_API EsfUsdStageData & GetStageData(const UsdStageConstPtr &stage)
ESFUSD_API ~EsfUsdStageData()
static ESFUSD_API SdfPathVector GetIncomingConnections(const UsdStageConstPtr &stage, const SdfPath &targetPath)
tbb::concurrent_unordered_set< SdfPath, TfHash > ChangedPathSet
SDF_API bool HasPrefix(const SdfPath &prefix) const
#define PXR_NAMESPACE_CLOSE_SCOPE
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)