Quick Links: |
#include <bmqpi_dtcontext.h>
Public Member Functions | |
virtual | ~DTContext () |
virtual bsl::shared_ptr < bmqpi::DTSpan > | span () const =0 |
virtual bslma::ManagedPtr< void > | scope (const bsl::shared_ptr< DTSpan > &newSpan)=0 |
A pure interface for a context with a notion of a current span.
virtual bmqpi::DTContext::~DTContext | ( | ) | [virtual] |
Destructor
virtual bsl::shared_ptr<bmqpi::DTSpan> bmqpi::DTContext::span | ( | ) | const [pure virtual] |
virtual bslma::ManagedPtr<void> bmqpi::DTContext::scope | ( | const bsl::shared_ptr< DTSpan > & | newSpan | ) | [pure virtual] |
Letting previous = span()
on some thread T
, returns an object token
which promises:
span()
will return newSpan
when called on thread T
, following the construction of token
. span()
will return previous
when called on thread T
, following the destruction of token
. Note that if token2 = scope(otherSpan)
is called on thread T
during the lifetime of token
, then span()
will return otherSpan
. After token2
is destroyed, it will again return newSpan
.