Usd Notice Framework  0.7.0
capturePredicate.h
Go to the documentation of this file.
1 #ifndef USD_NOTICE_FRAMEWORK_CAPTURE_PREDICATE_H
2 #define USD_NOTICE_FRAMEWORK_CAPTURE_PREDICATE_H
3 
5 
6 #include "unf/api.h"
7 #include "unf/notice.h"
8 
9 #include <functional>
10 #include <string>
11 #include <vector>
12 
13 namespace unf {
14 
16 using CapturePredicateFunc = std::function<bool(const UnfNotice::StageNotice&)>;
17 
30  public:
43 
45  UNF_API bool operator()(const UnfNotice::StageNotice&) const;
46 
48  UNF_API static CapturePredicate Default();
49 
51  UNF_API static CapturePredicate BlockAll();
52 
53  private:
54  CapturePredicateFunc _function = nullptr;
55 };
56 
57 } // namespace unf
58 
59 #endif // USD_NOTICE_FRAMEWORK_CAPTURE_PREDICATE_H
Predicate functor which indicates whether a notice can be captured during a transaction.
Definition: capturePredicate.h:29
UNF_API bool operator()(const UnfNotice::StageNotice &) const
Invoke boolean predicate on UnfNotice::StageNotice notice.
static UNF_API CapturePredicate BlockAll()
Create a predicate which return false for each notice type.
static UNF_API CapturePredicate Default()
Create a predicate which return true for each notice type.
UNF_API CapturePredicate(const CapturePredicateFunc &)
Create predicate from a function.
Base class for standalone PXR_NS::UsdStage notices.
Definition: notice.h:47
std::function< bool(const UnfNotice::StageNotice &)> CapturePredicateFunc
Convenient alias for function defining whether notice can be captured.
Definition: capturePredicate.h:16