Loading...
Searching...
No Matches
UsdCollectionMembershipQuery::ExpressionEvaluator Class Reference

Evaluates SdfPathExpressions with objects from a given UsdStage. More...

#include <collectionMembershipQuery.h>

Public Types

using PathExprEval = SdfPathExpressionEval< UsdObject >
 
using IncrementalSearcher = typename PathExprEval::IncrementalSearcher< ObjToPath, PathToObj >
 

Public Member Functions

 ExpressionEvaluator ()=default
 Construct an empty evaluator.
 
SDF_API ExpressionEvaluator (UsdStageWeakPtr const &stage, SdfPathExpression const &expr)
 Construct an evaluator that evalutates expr on objects from statge.
 
bool IsEmpty () const
 Return true if this evaluator has an invalid stage or an empty underlying SdfPathExpressionEval object.
 
UsdStageWeakPtr const & GetStage () const
 Return the stage this object was constructed with, or nullptr if it was default constructed.
 
SDF_API SdfPredicateFunctionResult Match (UsdObject const &object) const
 Return the result of evaluating the expression against object.
 
SDF_API IncrementalSearcher MakeIncrementalSearcher () const
 Create an incremental searcher from this evaluator.
 

Detailed Description

Evaluates SdfPathExpressions with objects from a given UsdStage.

Definition at line 59 of file collectionMembershipQuery.h.

Member Typedef Documentation

◆ IncrementalSearcher

using IncrementalSearcher = typename PathExprEval::IncrementalSearcher<ObjToPath, PathToObj>

Definition at line 75 of file collectionMembershipQuery.h.

◆ PathExprEval

Constructor & Destructor Documentation

◆ ExpressionEvaluator() [1/2]

ExpressionEvaluator ( )
default

Construct an empty evaluator.

◆ ExpressionEvaluator() [2/2]

SDF_API ExpressionEvaluator ( UsdStageWeakPtr const &  stage,
SdfPathExpression const &  expr 
)

Construct an evaluator that evalutates expr on objects from statge.

The expr must be "complete" (see SdfPathExpression::IsComplete()).

Typically these objects are not constructed directly, but instead are created by UsdCollectionAPI::ComputeMembershipQuery() for UsdCollectionMembershipQuery's use. However it is possible to construct them directly if one wishes. Consider calling UsdCollectionAPI::ResolveCompleteMembershipExpression() to produce an approprate expression.

Member Function Documentation

◆ GetStage()

UsdStageWeakPtr const & GetStage ( ) const
inline

Return the stage this object was constructed with, or nullptr if it was default constructed.

Definition at line 103 of file collectionMembershipQuery.h.

◆ IsEmpty()

bool IsEmpty ( ) const
inline

Return true if this evaluator has an invalid stage or an empty underlying SdfPathExpressionEval object.

Definition at line 97 of file collectionMembershipQuery.h.

◆ MakeIncrementalSearcher()

SDF_API IncrementalSearcher MakeIncrementalSearcher ( ) const

Create an incremental searcher from this evaluator.

See SdfPathExpressionEval::IncrementalSearcher for more info and API.

The returned IncrementalSearcher refers to the evaluator object owned by this UsdCollectionMembershipExpressionEval object. This means that the IncrementalSearcher must not be used after this UsdCollectionMembershipExpressionEval object's lifetime ends.

◆ Match()

SDF_API SdfPredicateFunctionResult Match ( UsdObject const &  object) const

Return the result of evaluating the expression against object.


The documentation for this class was generated from the following file: