HDK
|
#include <errorMark.h>
Public Types | |
typedef TfDiagnosticMgr::ErrorIterator | Iterator |
Public Member Functions | |
TF_API | TfErrorMark () |
TF_API | ~TfErrorMark () |
void | SetMark () |
bool | IsClean () const |
bool | Clear () const |
TfErrorTransport | Transport () const |
void | TransportTo (TfErrorTransport &dest) const |
Iterator | GetBegin (size_t *nErrors=0) const |
Iterator | GetEnd () const |
Iterator | begin () const |
Equivalent to GetBegin() More... | |
Iterator | end () const |
Equivalent to GetEnd() More... | |
Friends | |
class | TfDiagnosticMgr |
Class used to record the end of the error-list.
See page_tf_TfError for a detailed description.
A TfErrorMark
is used as follows:
Another common pattern is
Definition at line 64 of file errorMark.h.
Definition at line 70 of file errorMark.h.
TF_API TfErrorMark::TfErrorMark | ( | ) |
Default constructor.
The default constructor automatically calls SetMark()
at the point of declaration.
TF_API TfErrorMark::~TfErrorMark | ( | ) |
Destroy this ErrorMark.
If this is the last ErrorMark on this thread of execution and there are pending errors, this will report them via the diagnostic delegate (if one is installed) otherwise by printing to stderr.
Equivalent to GetBegin()
Definition at line 170 of file errorMark.h.
|
inline |
Remove all errors in this mark from the error system. Return true if any errors were cleared, false if there were no errors in this mark.
Clear all errors contained in this mark from the error system. Subsequently, these errors will be considered handled.
Definition at line 109 of file errorMark.h.
Equivalent to GetEnd()
Definition at line 173 of file errorMark.h.
|
inline |
Return an iterator to the first error added to the error list after SetMark()
.
If there are no errors on the error list that were not already present when SetMark()
was called, the iterator returned is equal to the iterator returned by TfDiagnosticMgr::GetErrorEnd()
. Otherwise, the iterator points to the earliest error added to the list since SetMark()
was called.
This function takes O(n) time where n is the number of errors from the end of the list to the mark i.e. GetMark()
walks the list from the end until it finds the mark and then returns an iterator to that spot.
If nErrors
is non-NULL, then *nErrors
is set to the number of errors between the returned iterator and the end of the list.
Definition at line 156 of file errorMark.h.
|
inline |
Return an iterator past the last error in the error system.
This iterator is always equivalent to the iterator returned by TfDiagnosticMgr::GetErrorEnd()
.
Definition at line 165 of file errorMark.h.
|
inline |
Return true if no new errors were posted in this thread since the last call to SetMark()
, false otherwise.
When no threads are issuing errors the cost of this function is an atomic integer read and comparison. Otherwise thread-specific data is accessed to make the determination. Thus, this function is fast when diagnostics are not being issued.
Definition at line 99 of file errorMark.h.
|
inline |
Record future errors.
SetMark()
arranges to record future errors in *this
.
Definition at line 88 of file errorMark.h.
|
inline |
Remove all errors in this mark fom the error system and return them in a TfErrorTransport.
This can be used to transfer errors from one thread to another. See TfErrorTransport for more information. As with Clear(), all the removed errors are considered handled for this thread. See also TransportTo().
Definition at line 126 of file errorMark.h.
|
inline |
Remove all errors in this mark fom the error system and return them in a TfErrorTransport.
This is a variant of Transport(). Instead of returning a new TfErrorTransport object it fills an existing one.
Definition at line 137 of file errorMark.h.
|
friend |
Definition at line 176 of file errorMark.h.