24 #ifndef PXR_USD_SDF_PATH_EXPRESSION_H
25 #define PXR_USD_SDF_PATH_EXPRESSION_H
95 bool IsStretch()
const {
96 return predicateIndex == -1 && text.empty();
100 int predicateIndex = -1;
101 bool isLiteral =
false;
103 friend bool operator==(Component
const &l, Component
const &
r) {
104 return std::tie(l.text, l.predicateIndex, l.isLiteral) ==
105 std::tie(r.text, r.predicateIndex, r.isLiteral);
108 friend bool operator!=(Component
const &l, Component
const &r) {
112 template <
class HashState>
114 h.Append(c.text, c.predicateIndex, c.isLiteral);
117 friend void swap(Component &l, Component &r) {
118 auto lt = std::tie(l.text, l.predicateIndex, l.isLiteral);
119 auto rt = std::tie(r.text, r.predicateIndex, r.isLiteral);
162 SdfPath const &GetPrefix()
const & {
168 return std::move(_prefix);
177 void SetPrefix(
SdfPath const &p) {
185 std::vector<Component>
const &GetComponents()
const & {
189 std::vector<Component> GetComponents() && {
193 std::vector<SdfPredicateExpression>
const &
194 GetPredicateExprs()
const & {
198 std::vector<SdfPredicateExpression>
199 GetPredicateExprs() && {
203 bool IsProperty()
const {
208 explicit operator bool()
const {
209 return !_prefix.IsEmpty();
213 template <
class HashState>
214 friend void TfHashAppend(HashState &
h, PathPattern
const &pat) {
215 h.Append(pat._prefix, pat._components,
216 pat._predExprs, pat._isProperty);
220 operator==(PathPattern
const &l, PathPattern
const &
r) {
221 return std::tie(l._prefix, l._components,
222 l._predExprs, l._isProperty) ==
223 std::tie(r._prefix, r._components,
224 r._predExprs, r._isProperty);
228 operator!=(PathPattern
const &l, PathPattern
const &r) {
232 friend void swap(PathPattern &l, PathPattern &r) {
234 l._prefix, l._components, l._predExprs, l._isProperty);
236 r._prefix, r._components, r._predExprs, r._isProperty);
241 std::vector<Component> _components;
242 std::vector<SdfPredicateExpression> _predExprs;
267 template <
class HashState>
269 h.Append(er.path, er.name);
274 return std::tie(l.path, l.name) == std::tie(r.path, r.name);
283 auto lt = std::tie(l.path, l.name);
284 auto rt = std::tie(r.path, r.name);
427 void WalkWithOpStack(
428 TfFunctionRef<
void (std::vector<std::pair<Op, int>>
const &)> logic,
435 ReplacePrefix(
SdfPath const &oldPrefix,
436 SdfPath const &newPrefix)
const & {
444 ReplacePrefix(
SdfPath const &oldPrefix,
451 bool IsAbsolute()
const;
456 MakeAbsolute(
SdfPath const &anchor)
const & {
464 MakeAbsolute(
SdfPath const &anchor) &&;
468 bool ContainsExpressionReferences()
const {
469 return !_refs.empty();
476 bool ContainsWeakerExpressionReference()
const;
523 bool IsComplete()
const {
524 return !ContainsExpressionReferences() && IsAbsolute();
534 bool IsEmpty()
const {
539 explicit operator bool()
const {
550 template <
class HashState>
552 h.Append(expr._ops, expr._refs, expr._patterns, expr._parseError);
556 friend std::ostream &
561 return std::tie(l._ops, l._refs, l._patterns, l._parseError) ==
562 std::tie(r._ops, r._refs, r._patterns, r._parseError);
571 auto lt = std::tie(l._ops, l._refs, l._patterns, l._parseError);
572 auto rt = std::tie(r._ops, r._refs, r._patterns, r._parseError);
576 std::vector<Op> _ops;
577 std::vector<ExpressionReference> _refs;
578 std::vector<PathPattern> _patterns;
588 #endif // PXR_USD_SDF_PATH_EXPRESSION_H
void TfHashAppend(HashState &h, const T &ptr)
GLsizei const GLchar *const * string
GLsizei const GLchar *const * path
void swap(T &lhs, T &rhs)
std::ostream & operator<<(std::ostream &ostr, const DataType &a)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
GLfloat GLfloat GLfloat GLfloat h
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate and *a name There is also one special expression _ which means *the weaker expression when composing expressions together See * ComposeOver() and ResolveReferences() for more information.**These building blocks may be joined as mentioned above
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)