7 #ifndef PXR_BASE_TF_DIAGNOSTIC_TRAP_H
8 #define PXR_BASE_TF_DIAGNOSTIC_TRAP_H
97 template <
class Predicate>
102 while (it.Next([&](
auto const &d) {
103 if (
auto r = TfTryInvoke<bool>(std::forward<Predicate>(pred), d)) {
112 _container = std::move(
result);
113 _OnContentsChanged();
119 TF_API bool IsClean()
const;
122 TF_API bool HasErrors()
const;
125 TF_API bool HasWarnings()
const;
128 TF_API bool HasStatuses()
const;
135 template <
class Predicate>
137 auto it = _container.GetIterator();
138 while (
auto r = it.Next(std::forward<Predicate>(pred))) {
175 template <
class Predicate>
177 auto it = _container.GetIterator();
178 while (
auto r = it.Next(std::forward<Predicate>(pred))) {
190 template <
class Predicate>
193 auto it = _container.GetIterator();
194 while (
auto r = it.Next(std::forward<Predicate>(pred))) {
203 TF_API std::vector<TfError>
const& GetErrors()
const;
206 TF_API std::vector<TfWarning>
const& GetWarnings()
const;
209 TF_API std::vector<TfStatus>
const& GetStatuses()
const;
223 while (it.Next(std::forward<Fn>(fn))) {}
235 TF_API void _OnContentsChanged()
const;
238 bool _active =
false;
243 #endif // PXR_BASE_TF_DIAGNOSTIC_TRAP_H
TF_API void Clear()
Discard all captured diagnostics. They will not be re-posted.
#define PXR_NAMESPACE_OPEN_SCOPE
TF_API TfDiagnosticTrap()
**But if you need a result
bool HasAllMatching(Predicate &&pred) const
TF_API void ClearWarnings()
Discard all captured warnings. They will not be re-posted.
Iterator GetIterator() const
size_t CountMatching(Predicate &&pred) const
size_t EraseMatching(Predicate &&pred)
TF_API void ClearErrors()
Discard all captured errors. They will not be re-posted.
TF_API ~TfDiagnosticTrap()
void ForEach(Fn &&fn) const
TF_API void ClearStatuses()
Discard all captured status messages. They will not be re-posted.
TfDiagnosticTrap & operator=(const TfDiagnosticTrap &)=delete
#define PXR_NAMESPACE_CLOSE_SCOPE
bool HasAnyMatching(Predicate &&pred) const
void Append(TfError const &e)