libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
BloombergLP::bmqpi::DTSpan::Baggage Class Referencefinal

A set of key-values used to describe a DTSpan.

#include <bmqpi_dtspan.h>

Public Types

typedef MapType::const_iterator const_iterator
 

Public Member Functions

 Baggage (bslma::Allocator *allocator=0)
 
const_iterator begin () const
 Returns a const-iterator used to iterate over key-values. More...
 
const_iterator end () const
 Returns a const-iterator representing the end of key-values. More...
 
bool has (const bsl::string &key) const
 
bsl::string_view get (const bsl::string &key, const bsl::string_view &dflt="") const
 
void put (const bsl::string_view &key, const bsl::string_view &value)
 
bool erase (const bsl::string &key)
 

Member Typedef Documentation

◆ const_iterator

typedef MapType::const_iterator BloombergLP::bmqpi::DTSpan::Baggage::const_iterator

Constructor & Destructor Documentation

◆ Baggage()

BloombergLP::bmqpi::DTSpan::Baggage::Baggage ( bslma::Allocator *  allocator = 0)

Member Function Documentation

◆ begin()

const_iterator BloombergLP::bmqpi::DTSpan::Baggage::begin ( ) const

◆ end()

const_iterator BloombergLP::bmqpi::DTSpan::Baggage::end ( ) const

◆ has()

bool BloombergLP::bmqpi::DTSpan::Baggage::has ( const bsl::string &  key) const

Returns whether this object holds a value associated with the specified key.

◆ get()

bsl::string_view BloombergLP::bmqpi::DTSpan::Baggage::get ( const bsl::string &  key,
const bsl::string_view &  dflt = "" 
) const

Returns the value currently associated with key, or dflt if no associated value is currently held.

Beware that if key is not found and the returned string_view outlives dflt, then the string_view will reference a deallocated address.

◆ put()

void BloombergLP::bmqpi::DTSpan::Baggage::put ( const bsl::string_view &  key,
const bsl::string_view &  value 
)

Stores the specified value associated with the specified key. Note that if such a key was already stored, then its associated value will be replaced by the supplied one.

◆ erase()

bool BloombergLP::bmqpi::DTSpan::Baggage::erase ( const bsl::string &  key)

Erases any value currently associated with key, and returns whether any such value was previously held.


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