libbmq 2f89e4a12c66e1eef53d27df596a2d59742f6a67
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BloombergLP::bmqpi::DTContext Class Referenceabstract

A pure interface for a context with a notion of a current span.

#include <bmqpi_dtcontext.h>

Public Member Functions

virtual ~DTContext ()
 Destructor.
 
virtual bsl::shared_ptr< bmqpi::DTSpanspan () const =0
 
virtual bslma::ManagedPtr< void > scope (const bsl::shared_ptr< DTSpan > &newSpan)=0
 

Constructor & Destructor Documentation

◆ ~DTContext()

virtual BloombergLP::bmqpi::DTContext::~DTContext ( )
virtual

Member Function Documentation

◆ span()

virtual bsl::shared_ptr< bmqpi::DTSpan > BloombergLP::bmqpi::DTContext::span ( ) const
pure virtual

Returns the current DTSpan for the calling thread according to this DTContext, or an empty shared_ptr if no span is currently set.

◆ scope()

virtual bslma::ManagedPtr< void > BloombergLP::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.


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