24 #ifndef PXR_USD_SDF_IDENTITY_H 25 #define PXR_USD_SDF_IDENTITY_H 28 #include "pxr/usd/sdf/api.h" 30 #include "pxr/usd/sdf/path.h" 34 PXR_NAMESPACE_OPEN_SCOPE
36 class Sdf_IdentityRegistry;
37 class Sdf_IdRegistryImpl;
48 Sdf_Identity(Sdf_Identity
const &) =
delete;
49 Sdf_Identity &operator=(Sdf_Identity
const &) =
delete;
53 const SdfLayerHandle &GetLayer()
const;
56 const SdfPath &GetPath()
const {
62 friend void intrusive_ptr_add_ref(Sdf_Identity*);
63 friend void intrusive_ptr_release(Sdf_Identity*);
65 friend class Sdf_IdentityRegistry;
66 friend class Sdf_IdRegistryImpl;
68 Sdf_Identity(Sdf_IdRegistryImpl *regImpl,
const SdfPath &path)
69 : _refCount(0), _path(path), _regImpl(regImpl) {}
72 static void _UnregisterOrDelete(Sdf_IdRegistryImpl *reg, Sdf_Identity *
id);
75 mutable std::atomic_int _refCount;
77 Sdf_IdRegistryImpl *_regImpl;
81 inline void intrusive_ptr_add_ref(PXR_NS::Sdf_Identity* p) {
84 inline void intrusive_ptr_release(PXR_NS::Sdf_Identity* p) {
89 Sdf_Identity *
self = p;
90 Sdf_IdRegistryImpl *reg = p->_regImpl;
91 if (--p->_refCount == 0) {
93 Sdf_Identity::_UnregisterOrDelete(reg,
self);
97 class Sdf_IdentityRegistry :
public boost::noncopyable {
99 Sdf_IdentityRegistry(
const SdfLayerHandle &layer);
100 ~Sdf_IdentityRegistry();
103 const SdfLayerHandle &GetLayer()
const {
111 Sdf_IdentityRefPtr Identify(
const SdfPath &path);
114 void MoveIdentity(
const SdfPath &oldPath,
const SdfPath &newPath);
117 friend class Sdf_Identity;
119 friend class Sdf_IdRegistryImpl;
124 void _UnregisterOrDelete();
128 const SdfLayerHandle _layer;
131 const std::unique_ptr<Sdf_IdRegistryImpl> _impl;
134 PXR_NAMESPACE_CLOSE_SCOPE
136 #endif // PXR_USD_SDF_IDENTITY_H A scene description container that can combine with other such containers to form simple component as...
A path value used to locate objects in layers or scenegraphs.