24 #ifndef PXR_USD_SDF_PATH_NODE_H
25 #define PXR_USD_SDF_PATH_NODE_H
31 #include "pxr/base/tf/mallocTag.h"
33 #include <hboost/noncopyable.hpp>
34 #include <hboost/intrusive_ptr.hpp>
36 #include <tbb/atomic.h>
169 static std::pair<Sdf_PathNode const *, Sdf_PathNode const *>
172 bool stopAtRootPrim);
187 return _containsPrimVariantSelection;
228 template <
class Less>
239 , _elementCount(parent ? parent->_elementCount + 1 : 1)
240 , _nodeType(nodeType)
242 , _containsPrimVariantSelection(
244 (parent && parent->_containsPrimVariantSelection))
245 , _containsTargetPath(nodeType ==
TargetNode ||
247 (parent && parent->_containsTargetPath))
270 template <
class Buffer>
275 template <
class Buffer>
279 template <
class Buffer>
300 template <
class Derived>
301 Derived
const *_Downcast()
const {
302 return static_cast<Derived
const *
>(
this);
306 bool _IsNamespacedImpl()
const;
314 mutable tbb::atomic<unsigned int> _refCount;
316 const short _elementCount;
317 const unsigned char _nodeType;
318 const bool _isAbsolute:1;
319 const bool _containsPrimVariantSelection:1;
320 const bool _containsTargetPath:1;
330 mutable bool _hasToken:1;
335 using Sdf_PathNode::Sdf_PathNode;
336 SDF_API void operator delete (
void *
p);
341 using Sdf_PathNode::Sdf_PathNode;
342 SDF_API void operator delete (
void *
p);
379 const ComparisonType &_GetComparisonValue()
const {
return _name; }
406 const ComparisonType &_GetComparisonValue()
const {
return _name; }
419 template <
class Buffer>
431 return *_variantSelection;
439 std::unique_ptr<VariantSelectionType> _variantSelection;
447 template <
class Buffer>
454 , _targetPath(targetPath) {}
458 const ComparisonType& _GetComparisonValue()
const {
return _targetPath; }
481 const ComparisonType& _GetComparisonValue()
const {
return _name; }
496 template <
class Buffer>
503 , _targetPath(targetPath) {}
507 const ComparisonType& _GetComparisonValue()
const {
return _targetPath; }
522 template <
class Buffer>
533 const ComparisonType& _GetComparisonValue()
const {
return _name; }
548 template <
class Buffer>
567 template <
int nodeType>
598 template <
int nodeType,
class Comp>
603 return Comp()(
static_cast<const Type&
>(lhs)._GetComparisonValue(),
604 static_cast<const Type&
>(rhs)._GetComparisonValue());
608 template <
class Comp>
621 if (nodeType != rhsNodeType) {
622 return Comp()(nodeType, rhsNodeType);
666 return delete _Downcast<Sdf_RootPathNode>();
668 return delete _Downcast<Sdf_PrimPathNode>();
670 return delete _Downcast<Sdf_PrimPropertyPathNode>();
672 return delete _Downcast<Sdf_PrimVariantSelectionNode>();
674 return delete _Downcast<Sdf_TargetPathNode>();
676 return delete _Downcast<Sdf_RelationalAttributePathNode>();
678 return delete _Downcast<Sdf_MapperPathNode>();
680 return delete _Downcast<Sdf_MapperArgPathNode>();
682 return delete _Downcast<Sdf_ExpressionPathNode>();
693 return SdfPathTokens->empty;
696 SdfPathTokens->absoluteIndicator : SdfPathTokens->relativeRoot;
698 return _Downcast<Sdf_PrimPathNode>()->_name;
700 return _Downcast<Sdf_PrimPropertyPathNode>()->_name;
702 return _Downcast<Sdf_PrimVariantSelectionNode>()->_GetNameImpl();
704 return _Downcast<Sdf_RelationalAttributePathNode>()->_name;
706 return _Downcast<Sdf_MapperArgPathNode>()->_name;
708 return SdfPathTokens->expressionIndicator;
719 return _Downcast<Sdf_TargetPathNode>()->_targetPath;
721 return _Downcast<Sdf_MapperPathNode>()->_targetPath;
729 return *_Downcast<Sdf_PrimVariantSelectionNode>()->_variantSelection;
731 return _GetEmptyVariantSelection();
741 return _Downcast<Sdf_PrimPathNode>()->_name;
754 if (p->_refCount.fetch_and_decrement() == 1)
760 #endif // PXR_USD_SDF_PATH_NODE_H
friend struct Sdf_PathNodePrivateAccess
unsigned int GetCurrentRefCount() const
GLboolean GLboolean GLboolean b
void _WriteText(Buffer &out) const
static TfToken _CreatePathToken(Sdf_PathNode const *primPart, Sdf_PathNode const *propPart)
static Sdf_PathPrimNodeHandle FindOrCreatePrimVariantSelection(Sdf_PathNode const *parent, const TfToken &variantSet, const TfToken &variant, TfFunctionRef< bool()> isValid)
static Sdf_PathPropNodeHandle FindOrCreateMapper(Sdf_PathNode const *parent, SdfPath const &targetPath, TfFunctionRef< bool()> isValid)
static SDF_API TfToken GetPathAsToken(Sdf_PathNode const *primPart, Sdf_PathNode const *propPart)
static Sdf_PathPropNodeHandle FindOrCreateTarget(Sdf_PathNode const *parent, SdfPath const &targetPath, TfFunctionRef< bool()> isValid)
static Sdf_PathNode const * GetAbsoluteRootNode()
GLsizei const GLchar *const * path
bool ContainsPrimVariantSelection() const
void _WriteTextImpl(Buffer &out) const
std::pair< TfToken, TfToken > VariantSelectionType
TfToken _GetElementImpl() const
static const NodeType nodeType
GLuint const GLchar * name
Sdf_PathNode(Sdf_PathNode const *parent, NodeType nodeType)
Sdf_ExpressionPathNode Type
static void _WriteTextToBuffer(Sdf_PathNode const *primPart, Sdf_PathNode const *propPart, Buffer &out)
void _WriteTextImpl(Buffer &out) const
void _WriteTextImpl(Buffer &out) const
friend struct Sdf_PathNodePrivateAccess
NodeType GetNodeType() const
friend struct Sdf_PathNodePrivateAccess
static Sdf_PathPrimNodeHandle FindOrCreatePrim(Sdf_PathNode const *parent, const TfToken &name, TfFunctionRef< bool()> isValid)
static const NodeType nodeType
static SDF_API const SdfPath & EmptyPath()
The empty path value, equivalent to SdfPath().
static std::pair< Sdf_PathNode const *, Sdf_PathNode const * > RemoveCommonSuffix(Sdf_PathNode const *a, Sdf_PathNode const *b, bool stopAtRootPrim)
bool operator()(const Sdf_PathNode &lhs, const Sdf_PathNode &rhs) const
static Sdf_PathPropNodeHandle FindOrCreateMapperArg(Sdf_PathNode const *parent, const TfToken &name, TfFunctionRef< bool()> isValid)
Sdf_PrimVariantSelectionNode Type
void _WriteTextImpl(Buffer &out) const
static const NodeType nodeType
const SdfPath & GetTargetPath() const
bool Compare(const Sdf_PathNode &rhs) const
GLboolean GLboolean GLboolean GLboolean a
friend struct Sdf_PathNodePrivateAccess
Sdf_MapperArgPathNode Type
friend struct Sdf_PathNodePrivateAccess
friend struct Sdf_PathNodePrivateAccess
static const NodeType nodeType
const VariantSelectionType & GetVariantSelection() const
static char const * GetDebugText(Sdf_PathNode const *primPart, Sdf_PathNode const *propPart)
static Sdf_PathPropNodeHandle FindOrCreateExpression(Sdf_PathNode const *parent, TfFunctionRef< bool()> isValid)
TfToken GetElement() const
bool IsAbsoluteRoot() const
static const NodeType nodeType
static const NodeType nodeType
static Sdf_PathNode const * GetRelativeRootNode()
hboost::intrusive_ptr< const Sdf_PathNode > Sdf_PathNodeConstRefPtr
bool operator()(T const &a, T const &b) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
const TfToken & GetName() const
void _WriteTextImpl(Buffer &out) const
friend void intrusive_ptr_add_ref(const Sdf_PathNode *)
#define PXR_NAMESPACE_CLOSE_SCOPE
void intrusive_ptr_release(const PXR_NS::Sdf_PathNode *p)
friend struct Sdf_PathNodePrivateAccess
bool operator()(T const &a, T const &b) const
bool IsNamespaced() const
SDF_API void _RemovePathTokenFromTable() const
SDF_API void Sdf_DumpPathStats()
Diagnostic output.
static Sdf_PathPropNodeHandle FindOrCreatePrimProperty(Sdf_PathNode const *parent, const TfToken &name, TfFunctionRef< bool()> isValid)
Sdf_PrimPropertyPathNode Type
friend struct Sdf_PathNodePrivateAccess
static SDF_API Sdf_PathNode const * New(bool isAbsolute)
void intrusive_ptr_add_ref(const PXR_NS::Sdf_PathNode *p)
Sdf_RelationalAttributePathNode Type
static const NodeType nodeType
VariantSelectionType ComparisonType
bool IsAbsolutePath() const
static const NodeType nodeType
friend void intrusive_ptr_release(const Sdf_PathNode *)
const TfToken & _GetNameImpl() const
static SDF_API const TfToken & GetPathToken(Sdf_PathNode const *primPart, Sdf_PathNode const *propPart)
bool ContainsTargetPath() const
size_t GetElementCount() const
friend struct Sdf_PathNodePrivateAccess
Sdf_PathNode const * GetParentNode() const
static const NodeType nodeType
static Sdf_PathPropNodeHandle FindOrCreateRelationalAttribute(Sdf_PathNode const *parent, const TfToken &name, TfFunctionRef< bool()> isValid)