libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
BloombergLP::bmqt::CorrelationId Class Reference

#include <bmqt_correlationid.h>

Public Types

enum  Type {
  e_NUMERIC , e_POINTER , e_SHARED_PTR , e_AUTO_VALUE ,
  e_UNSET
}
 

Public Member Functions

 CorrelationId ()
 Create a CorrelationId having the default, unset, value. More...
 
 CorrelationId (bsls::Types::Int64 numeric)
 
 CorrelationId (void *pointer)
 
 CorrelationId (const bsl::shared_ptr< void > &sharedPtr)
 
CorrelationIdmakeUnset ()
 Unset the value of this object. More...
 
CorrelationIdsetNumeric (bsls::Types::Int64 numeric)
 
CorrelationIdsetPointer (void *pointer)
 
CorrelationIdsetSharedPointer (const bsl::shared_ptr< void > &sharedPtr)
 
bool isUnset () const
 Return true if the value of this object is unset;. More...
 
bool isNumeric () const
 
bool isPointer () const
 
bool isSharedPtr () const
 
bool isAutoValue () const
 
bsls::Types::Int64 theNumeric () const
 
void * thePointer () const
 
const bsl::shared_ptr< void > & theSharedPtr () const
 
Type type () const
 Return the type of the value of this object. More...
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Member Functions

static CorrelationId autoValue ()
 

Friends

struct CorrelationIdLess
 
bool operator== (const CorrelationId &lhs, const CorrelationId &rhs)
 
bool operator!= (const CorrelationId &lhs, const CorrelationId &rhs)
 
bsl::ostream & operator<< (bsl::ostream &stream, const CorrelationId &rhs)
 
template<class HASH_ALGORITHM >
void hashAppend (HASH_ALGORITHM &hashAlgo, const CorrelationId &value)
 

Detailed Description

This class implements an in-core value-semantic type for correlating an asynchronous result with the original operation.

Member Enumeration Documentation

◆ Type

Enumerator
e_NUMERIC 
e_POINTER 
e_SHARED_PTR 
e_AUTO_VALUE 
e_UNSET 

Constructor & Destructor Documentation

◆ CorrelationId() [1/4]

BloombergLP::bmqt::CorrelationId::CorrelationId ( )
inlineexplicit

◆ CorrelationId() [2/4]

BloombergLP::bmqt::CorrelationId::CorrelationId ( bsls::Types::Int64  numeric)
inlineexplicit

Create a CorrelationId object initialized with the specified numeric integer value.

◆ CorrelationId() [3/4]

BloombergLP::bmqt::CorrelationId::CorrelationId ( void *  pointer)
inlineexplicit

Create a CorrelationId object initialized with the specified pointer value.

◆ CorrelationId() [4/4]

BloombergLP::bmqt::CorrelationId::CorrelationId ( const bsl::shared_ptr< void > &  sharedPtr)
inlineexplicit

Create a CorrelationId object initialized with the specified sharedPtr shared pointer value.

Member Function Documentation

◆ autoValue()

static CorrelationId BloombergLP::bmqt::CorrelationId::autoValue ( )
static

Return a CorrelationId having a unique, automatically assigned opaque value.

◆ makeUnset()

CorrelationId & BloombergLP::bmqt::CorrelationId::makeUnset ( )
inline

◆ setNumeric()

CorrelationId & BloombergLP::bmqt::CorrelationId::setNumeric ( bsls::Types::Int64  numeric)
inline

Set the value of this object value to the specified numeric. Return a reference to this object.

◆ setPointer()

CorrelationId & BloombergLP::bmqt::CorrelationId::setPointer ( void *  pointer)
inline

Set the value of this object value to the specified pointer. Return a reference to this object.

◆ setSharedPointer()

CorrelationId & BloombergLP::bmqt::CorrelationId::setSharedPointer ( const bsl::shared_ptr< void > &  sharedPtr)
inline

Set the value of this object value to the specified sharedPtr. Return a reference to this object.

◆ isUnset()

bool BloombergLP::bmqt::CorrelationId::isUnset ( ) const
inline

Referenced by type().

◆ isNumeric()

bool BloombergLP::bmqt::CorrelationId::isNumeric ( ) const
inline

Return true if the value of this object is an integer value, and otherwise return false.

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()(), theNumeric(), and type().

◆ isPointer()

bool BloombergLP::bmqt::CorrelationId::isPointer ( ) const
inline

Return true if the value of this object is a pointer value, and otherwise return false.

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()(), thePointer(), and type().

◆ isSharedPtr()

bool BloombergLP::bmqt::CorrelationId::isSharedPtr ( ) const
inline

Return true if the value of this object is a shared pointer value, and otherwise return false.

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()(), theSharedPtr(), and type().

◆ isAutoValue()

bool BloombergLP::bmqt::CorrelationId::isAutoValue ( ) const
inline

Return true if the value of this object is an auto correlation value, and otherwise return false.

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()(), and type().

◆ theNumeric()

bsls::Types::Int64 BloombergLP::bmqt::CorrelationId::theNumeric ( ) const
inline

Return the 64-bit integer value of this object. The behavior is undefined unless method isNumeric returns true.

References isNumeric().

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()().

◆ thePointer()

void * BloombergLP::bmqt::CorrelationId::thePointer ( ) const
inline

Return the pointer value of this object. The behavior is undefined unless method isPointer returns true.

References isPointer().

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()().

◆ theSharedPtr()

const bsl::shared_ptr< void > & BloombergLP::bmqt::CorrelationId::theSharedPtr ( ) const
inline

Return the pointer value of this object. The behavior is undefined unless method isSharedPtr returns true.

References isSharedPtr().

Referenced by BloombergLP::bmqt::CorrelationIdLess::operator()().

◆ type()

CorrelationId::Type BloombergLP::bmqt::CorrelationId::type ( ) const
inline

◆ print()

bsl::ostream& BloombergLP::bmqt::CorrelationId::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.

Referenced by BloombergLP::bmqt::operator<<().

Friends And Related Function Documentation

◆ CorrelationIdLess

friend struct CorrelationIdLess
friend

◆ operator==

bool operator== ( const CorrelationId lhs,
const CorrelationId rhs 
)
friend

Return true if rhs object contains the value of the same type as contained in lhs object and the value itself is the same in both objects, return false otherwise.

◆ operator!=

bool operator!= ( const CorrelationId lhs,
const CorrelationId rhs 
)
friend

Return false if rhs object contains the value of the same type as contained in lhs object and the value itself is the same in both objects, return true otherwise.

◆ operator<<

bsl::ostream& operator<< ( bsl::ostream &  stream,
const CorrelationId rhs 
)
friend

Format the specified rhs to the specified output stream and return a reference to the modifiable stream.

◆ hashAppend

template<class HASH_ALGORITHM >
void hashAppend ( HASH_ALGORITHM &  hashAlgo,
const CorrelationId value 
)
friend

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