Skip to content

Commit

Permalink
Refactor[BMQT]: make QueueOptions rule-of-three complaint (bloomberg#371
Browse files Browse the repository at this point in the history
)


Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
  • Loading branch information
678098 authored and alexander-e1off committed Oct 24, 2024
1 parent 189a784 commit 59c30a3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/groups/bmq/bmqt/bmqt_queueoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class QueueOptions {

// MANIPULATORS

/// Assign to this object the value of the specified `rhs` object.
QueueOptions& operator=(const QueueOptions& rhs);

/// 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
Expand Down Expand Up @@ -256,6 +259,20 @@ bsl::ostream& operator<<(bsl::ostream& stream, const QueueOptions& rhs);
// ------------------

// MANIPULATORS

inline QueueOptions& QueueOptions::operator=(const QueueOptions& rhs)
{
if (this != &rhs) {
d_info = rhs.d_info;
d_suspendsOnBadHostHealth = rhs.d_suspendsOnBadHostHealth;
d_hadSubscriptions = rhs.d_hadSubscriptions;
d_subscriptions = Subscriptions(rhs.d_subscriptions,
this->d_allocator_p);
}

return *this;
}

inline QueueOptions& QueueOptions::setMaxUnconfirmedMessages(int value)
{
d_info.setMaxUnconfirmedMessages(value);
Expand Down

0 comments on commit 59c30a3

Please sign in to comment.