All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TfErrorTransport Class Reference

A facility for transporting errors from thread to thread. More...

Public Types

typedef TfDiagnosticMgr::ErrorList ErrorList
 

Public Member Functions

 TfErrorTransport ()
 Construct an empty TfErrorTransport. More...
 
void Post ()
 Post all contained errors to the current thread's error list, leaving this TfErrorTransport empty. More...
 
bool IsEmpty () const
 Return true if this TfErrorTransport contains no errors, false otherwise. More...
 
void swap (TfErrorTransport &other)
 Swap this TfErrorTransport's content with other. More...
 

Friends

class TfErrorMark
 

Detailed Description

A facility for transporting errors from thread to thread.

Typical use is to create a TfErrorMark in the thread that is the error source (e.g. the child thread), then call TfErrorMark::Transport() or TfErrorMark::TransportTo() to lift generated errors out into a TfErrorTransport object. Later the thread that wants to sink those errors (e.g. the parent thread) invokes TfErrorTransport::Post() to post all contained errors to its own thread's error list.

Definition at line 46 of file errorTransport.h.

Constructor & Destructor Documentation

TfErrorTransport ( )
inline

Construct an empty TfErrorTransport.

Definition at line 52 of file errorTransport.h.

Member Function Documentation

bool IsEmpty ( ) const
inline

Return true if this TfErrorTransport contains no errors, false otherwise.

Definition at line 63 of file errorTransport.h.

void Post ( )
inline

Post all contained errors to the current thread's error list, leaving this TfErrorTransport empty.

Definition at line 56 of file errorTransport.h.

void swap ( TfErrorTransport other)
inline

Swap this TfErrorTransport's content with other.

This provides a lightweight way to move the contents of one TfErrorTransport to another.

Definition at line 68 of file errorTransport.h.


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