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

#include <diagnosticTransport.h>

Public Member Functions

 TfDiagnosticTransport ()=default
 Construct an empty TfDiagnosticTransport. More...
 
 TfDiagnosticTransport (TfDiagnosticTransport &&)=default
 
TfDiagnosticTransportoperator= (TfDiagnosticTransport &&)=default
 
 TfDiagnosticTransport (const TfDiagnosticTransport &)=delete
 
TfDiagnosticTransportoperator= (const TfDiagnosticTransport &)=delete
 
bool IsEmpty () const
 Return true if this transport contains no diagnostics. More...
 
void Post ()
 

Friends

class TfDiagnosticTrap
 

Detailed Description

A facility for transporting diagnostics from thread to thread.

Typical use is to install a TfDiagnosticTrap in a child thread to intercept diagnostics, then call TfDiagnosticTrap::Transport() to move the accumulated diagnostics into a TfDiagnosticTransport. The parent thread then calls Post() after joining to re-post the transported diagnostics to its own thread, where they will be caught by any active TfDiagnosticTrap or forwarded to diagnostic delegates.

Example usage:

tbb::concurrent_vector<TfDiagnosticTransport> transports;
// In each child task:
DoWork();
if (!trap.IsClean()) {
transports.push_back(trap.Transport());
}
// After joining, on the parent thread:
for (auto &transport : transports) {
transport.Post();
}
Note
TfDiagnosticTransport has no thread affinity of its own. Post() should be called on the thread that should receive the diagnostics.

Definition at line 61 of file diagnosticTransport.h.

Constructor & Destructor Documentation

TfDiagnosticTransport::TfDiagnosticTransport ( )
default

Construct an empty TfDiagnosticTransport.

TfDiagnosticTransport::TfDiagnosticTransport ( TfDiagnosticTransport &&  )
default
TfDiagnosticTransport::TfDiagnosticTransport ( const TfDiagnosticTransport )
delete

Member Function Documentation

bool TfDiagnosticTransport::IsEmpty ( ) const
inline

Return true if this transport contains no diagnostics.

Definition at line 74 of file diagnosticTransport.h.

TfDiagnosticTransport& TfDiagnosticTransport::operator= ( TfDiagnosticTransport &&  )
default
TfDiagnosticTransport& TfDiagnosticTransport::operator= ( const TfDiagnosticTransport )
delete
void TfDiagnosticTransport::Post ( )
inline

Post all contained diagnostics to the current thread in the order they were originally issued, leaving this transport empty.

Definition at line 80 of file diagnosticTransport.h.

Friends And Related Function Documentation

friend class TfDiagnosticTrap
friend

Definition at line 85 of file diagnosticTransport.h.


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