libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
BloombergLP::bmqt::Subscription Class Reference

Value-semantic type to carry Subscription parameters.

#include <bmqt_subscription.h>

Public Member Functions

 Subscription ()
 Create a new Subscription. More...
 
SubscriptionsetMaxUnconfirmedMessages (int value)
 
SubscriptionsetMaxUnconfirmedBytes (int value)
 
SubscriptionsetConsumerPriority (int value)
 
SubscriptionsetExpression (const SubscriptionExpression &value)
 
int maxUnconfirmedMessages () const
 Get the number for the maxUnconfirmedMessages parameter. More...
 
int maxUnconfirmedBytes () const
 Get the number for the maxUnconfirmedBytes parameter. More...
 
int consumerPriority () const
 Get the number for the consumerPriority parameter. More...
 
const SubscriptionExpressionexpression () const
 
bool hasMaxUnconfirmedMessages () const
 
bool hasMaxUnconfirmedBytes () const
 
bool hasConsumerPriority () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Attributes

static const int k_CONSUMER_PRIORITY_MIN
 Constant representing the minimum valid consumer priority. More...
 
static const int k_CONSUMER_PRIORITY_MAX
 Constant representing the maximum valid consumer priority. More...
 
static const int k_DEFAULT_MAX_UNCONFIRMED_MESSAGES
 
static const int k_DEFAULT_MAX_UNCONFIRMED_BYTES
 
static const int k_DEFAULT_CONSUMER_PRIORITY
 

Constructor & Destructor Documentation

◆ Subscription()

BloombergLP::bmqt::Subscription::Subscription ( )
inline

Member Function Documentation

◆ setMaxUnconfirmedMessages()

Subscription & BloombergLP::bmqt::Subscription::setMaxUnconfirmedMessages ( int  value)
inline

Set the maxUnconfirmedMessages to the specified value. The behavior is undefined unless value >= 0. If the specified value is set to 0, it means that the consumer does not receive any messages. This might be useful when the consumer is shutting down and wants to process only pending messages, or when it is unable to process new messages because of transient issues.

Referenced by BloombergLP::bmqt::QueueOptions::setMaxUnconfirmedMessages().

◆ setMaxUnconfirmedBytes()

Subscription & BloombergLP::bmqt::Subscription::setMaxUnconfirmedBytes ( int  value)
inline

Set the maxUnconfirmedBytes to the specified value. The behavior is undefined unless value >= 0.

Referenced by BloombergLP::bmqt::QueueOptions::setMaxUnconfirmedBytes().

◆ setConsumerPriority()

Subscription & BloombergLP::bmqt::Subscription::setConsumerPriority ( int  value)
inline

Set the consumerPriority to the specified value. The behavior is undefined unless 'k_CONSUMER_PRIORITY_MIN <= value <= k_CONSUMER_PRIORITY_MAX'

Referenced by BloombergLP::bmqt::QueueOptions::setConsumerPriority().

◆ setExpression()

Subscription & BloombergLP::bmqt::Subscription::setExpression ( const SubscriptionExpression value)
inline

◆ maxUnconfirmedMessages()

int BloombergLP::bmqt::Subscription::maxUnconfirmedMessages ( ) const
inline

◆ maxUnconfirmedBytes()

int BloombergLP::bmqt::Subscription::maxUnconfirmedBytes ( ) const
inline

◆ consumerPriority()

int BloombergLP::bmqt::Subscription::consumerPriority ( ) const
inline

◆ expression()

const SubscriptionExpression & BloombergLP::bmqt::Subscription::expression ( ) const
inline

◆ hasMaxUnconfirmedMessages()

bool BloombergLP::bmqt::Subscription::hasMaxUnconfirmedMessages ( ) const
inline

Returns whether maxUnconfirmedMessages has been set for this object, or whether it implicitly holds k_DEFAULT_MAX_UNCONFIRMED_MESSAGES.

Referenced by BloombergLP::bmqt::QueueOptions::hasMaxUnconfirmedMessages().

◆ hasMaxUnconfirmedBytes()

bool BloombergLP::bmqt::Subscription::hasMaxUnconfirmedBytes ( ) const
inline

Returns whether maxUnconfirmedBytes has been set for this object, or whether it implicitly holds k_DEFAULT_MAX_UNCONFIRMED_BYTES.

Referenced by BloombergLP::bmqt::QueueOptions::hasMaxUnconfirmedBytes().

◆ hasConsumerPriority()

bool BloombergLP::bmqt::Subscription::hasConsumerPriority ( ) const
inline

Returns whether consumerPriority has been set for this object, or whether it implicitly holds k_DEFAULT_CONSUMER_PRIORITY.

Referenced by BloombergLP::bmqt::QueueOptions::hasConsumerPriority().

◆ print()

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

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.

References consumerPriority(), maxUnconfirmedBytes(), maxUnconfirmedMessages(), and BloombergLP::bmqt::SubscriptionExpression::print().

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

Member Data Documentation

◆ k_CONSUMER_PRIORITY_MIN

const int BloombergLP::bmqt::Subscription::k_CONSUMER_PRIORITY_MIN
static

◆ k_CONSUMER_PRIORITY_MAX

const int BloombergLP::bmqt::Subscription::k_CONSUMER_PRIORITY_MAX
static

◆ k_DEFAULT_MAX_UNCONFIRMED_MESSAGES

const int BloombergLP::bmqt::Subscription::k_DEFAULT_MAX_UNCONFIRMED_MESSAGES
static

Referenced by maxUnconfirmedMessages().

◆ k_DEFAULT_MAX_UNCONFIRMED_BYTES

const int BloombergLP::bmqt::Subscription::k_DEFAULT_MAX_UNCONFIRMED_BYTES
static

Referenced by maxUnconfirmedBytes().

◆ k_DEFAULT_CONSUMER_PRIORITY

const int BloombergLP::bmqt::Subscription::k_DEFAULT_CONSUMER_PRIORITY
static

Referenced by consumerPriority().


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