diff --git a/src/groups/bmq/bmqa/bmqa_session.cpp b/src/groups/bmq/bmqa/bmqa_session.cpp index 719af4f13f..dbc6ce68b0 100644 --- a/src/groups/bmq/bmqa/bmqa_session.cpp +++ b/src/groups/bmq/bmqa/bmqa_session.cpp @@ -246,6 +246,14 @@ int SessionUtil::createApplication(SessionImpl* sessionImpl) static bsls::AtomicInt s_sessionInstanceCount(0); + // Authentication Message + bmqp_ctrlmsg::AuthenticationMessage authenticationMessage; + bmqp_ctrlmsg::AuthenticateRequest& ar = + authenticationMessage.makeAuthenticateRequest(); + bsl::string str = "username:password"; + ar.mechanism() = "basic"; + ar.data() = bsl::vector(str.begin(), str.end()); // hexBinary + // Negotiation Message bmqp_ctrlmsg::NegotiationMessage negotiationMessage; bmqp_ctrlmsg::ClientIdentity& ci = negotiationMessage.makeClientIdentity(); @@ -311,6 +319,7 @@ int SessionUtil::createApplication(SessionImpl* sessionImpl) sessionImpl->d_application_mp.load( new (*(sessionImpl->d_allocator_p)) bmqimp::Application(options, + authenticationMessage, negotiationMessage, eventHandler, sessionImpl->d_allocator_p), diff --git a/src/groups/bmq/bmqimp/README.md b/src/groups/bmq/bmqimp/README.md index 1f1aba482f..98af511403 100644 --- a/src/groups/bmq/bmqimp/README.md +++ b/src/groups/bmq/bmqimp/README.md @@ -13,13 +13,13 @@ its components directly, but rather use the accessor public APIs from 'bmqa'. Component Synopsis ------------------ -Component | Provides ... -----------------------------------|----------------------------------------------------------- -`bmqimp_application` | the top level object to manipulate a session with bmqbrkr. -`bmqimp_brokersession` | the implementation of a session with the bmqbrkr. -`bmqimp_event` | a value-semantic type representing an event. -`bmqimp_eventqueue` | a thread safe queue of pooled bmqimp::Event items. -`bmqpimp_eventsstats` | a mechanism to keep track of Events statistics. -`bmqpimp_queue` | a type object to represent information about a queue. -`bmqimp_stat` | utilities for stat manipulation. -`bmqimp_negotiatedchannelfactory` | a channel factory that negotiates with a peer. +Component | Provides ... +-----------------------------------------|----------------------------------------------------------- +`bmqimp_application` | the top level object to manipulate a session with bmqbrkr. +`bmqimp_brokersession` | the implementation of a session with the bmqbrkr. +`bmqimp_event` | a value-semantic type representing an event. +`bmqimp_eventqueue` | a thread safe queue of pooled bmqimp::Event items. +`bmqpimp_eventsstats` | a mechanism to keep track of Events statistics. +`bmqpimp_queue` | a type object to represent information about a queue. +`bmqimp_stat` | utilities for stat manipulation. +`bmqimp_initialconnectionchannelfactory` | a channel factory that authenticates a peer and negotiates with it. diff --git a/src/groups/bmq/bmqimp/bmqimp_application.cpp b/src/groups/bmq/bmqimp/bmqimp_application.cpp index 1d2185f615..ad4cd6f72b 100644 --- a/src/groups/bmq/bmqimp/bmqimp_application.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_application.cpp @@ -20,6 +20,7 @@ // BMQ #include #include +#include #include #include #include @@ -73,7 +74,7 @@ namespace { // CONSTANTS const double k_RECONNECT_INTERVAL_MS = 500; const int k_RECONNECT_COUNT = bsl::numeric_limits::max(); -const bsls::Types::Int64 k_CHANNEL_LOW_WATERMARK = 512 * 1024; +const bsls::Types::Int64 k_CHANNEL_LOW_WATERMARK = 512 * 1024; const int k_DEFAULT_MAX_MISSED_HEARTBEATS = 10; const int k_DEFAULT_HEARTBEAT_INTERVAL_MS = 1000; @@ -385,7 +386,7 @@ bmqt::GenericResult::Enum Application::startChannel() .setAttemptInterval(attemptInterval) .setAutoReconnect(true); - d_negotiatedChannelFactory.connect( + d_initialConnectionChannelFactory.connect( &status, &d_connectHandle_mp, options, @@ -550,10 +551,11 @@ Application::stateCb(bmqimp::BrokerSession::State::Enum oldState, } Application::Application( - const bmqt::SessionOptions& sessionOptions, - const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, - const EventQueue::EventHandlerCallback& eventHandlerCB, - bslma::Allocator* allocator) + const bmqt::SessionOptions& sessionOptions, + const bmqp_ctrlmsg::AuthenticationMessage& authenticationMessage, + const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, + const EventQueue::EventHandlerCallback& eventHandlerCB, + bslma::Allocator* allocator) : d_allocatorStatContext(bmqst::StatContextConfiguration("Allocators", allocator), allocator) @@ -597,12 +599,15 @@ Application::Application( bdlf::PlaceHolders::_2), // handle allocator), allocator) -, d_negotiatedChannelFactory( - NegotiatedChannelFactoryConfig(&d_statChannelFactory, - negotiationMessage, - sessionOptions.connectTimeout(), - d_blobSpPool_sp.get(), - allocator), +, d_initialConnectionChannelFactory( + InitialConnectionChannelFactoryConfig( + &d_statChannelFactory, + authenticationMessage, + sessionOptions.connectTimeout(), // TODO: different for authn? + negotiationMessage, + sessionOptions.connectTimeout(), + d_blobSpPool_sp.get(), + allocator), allocator) , d_connectHandle_mp() , d_brokerSession(&d_scheduler, @@ -761,9 +766,9 @@ Application::createMonitor(const bsl::shared_ptr& channel) { int maxMissedHeartbeats = k_DEFAULT_MAX_MISSED_HEARTBEATS; - channel->properties().load( - &maxMissedHeartbeats, - NegotiatedChannelFactory::k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS); + channel->properties().load(&maxMissedHeartbeats, + InitialConnectionChannelFactory:: + k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS); bsl::shared_ptr monitor( new (d_allocator) bmqp::HeartbeatMonitor(maxMissedHeartbeats), @@ -784,9 +789,9 @@ void Application::startHeartbeat( int heartbeatIntervalMs = k_DEFAULT_HEARTBEAT_INTERVAL_MS; - channel->properties().load( - &heartbeatIntervalMs, - NegotiatedChannelFactory::k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS); + channel->properties().load(&heartbeatIntervalMs, + InitialConnectionChannelFactory:: + k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS); bsls::TimeInterval interval; interval.addMilliseconds(heartbeatIntervalMs); diff --git a/src/groups/bmq/bmqimp/bmqimp_application.h b/src/groups/bmq/bmqimp/bmqimp_application.h index 4b1b8dd970..8ba19ac18b 100644 --- a/src/groups/bmq/bmqimp/bmqimp_application.h +++ b/src/groups/bmq/bmqimp/bmqimp_application.h @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ namespace bmqimp { class Application { public: // PUBLIC TYPES - typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool; + typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool; typedef bmqp::BlobPoolUtil::BlobSpPoolSp BlobSpPoolSp; private: @@ -134,7 +134,7 @@ class Application { bmqio::StatChannelFactory d_statChannelFactory; - NegotiatedChannelFactory d_negotiatedChannelFactory; + InitialConnectionChannelFactory d_initialConnectionChannelFactory; ChannelFactoryOpHandleMp d_connectHandle_mp; @@ -226,7 +226,8 @@ class Application { const bsl::shared_ptr& monitor); bsl::shared_ptr createMonitor(const bsl::shared_ptr& channel); - void startHeartbeat(const bsl::shared_ptr& channel, + void + startHeartbeat(const bsl::shared_ptr& channel, const bsl::shared_ptr& monitor); void stopHeartbeat(); @@ -249,10 +250,12 @@ class Application { /// negotiation. The application will use the specified /// `eventHandlerCB`. Use the specified `allocator` for all memory /// allocations. - Application(const bmqt::SessionOptions& sessionOptions, - const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, - const EventQueue::EventHandlerCallback& eventHandlerCB, - bslma::Allocator* allocator); + Application( + const bmqt::SessionOptions& sessionOptions, + const bmqp_ctrlmsg::AuthenticationMessage& authenticationMessage, + const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, + const EventQueue::EventHandlerCallback& eventHandlerCB, + bslma::Allocator* allocator); /// Destructor ~Application(); diff --git a/src/groups/bmq/bmqimp/bmqimp_application.t.cpp b/src/groups/bmq/bmqimp/bmqimp_application.t.cpp index 50565ab71b..678b79638d 100644 --- a/src/groups/bmq/bmqimp/bmqimp_application.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_application.t.cpp @@ -45,11 +45,14 @@ static void test1_breathingTest() // Create a default application bmqt::SessionOptions options(bmqtst::TestHelperUtil::allocator()); + bmqp_ctrlmsg::AuthenticationMessage authenticationMessage( + bmqtst::TestHelperUtil::allocator()); bmqp_ctrlmsg::NegotiationMessage negotiationMessage( bmqtst::TestHelperUtil::allocator()); bmqimp::EventQueue::EventHandlerCallback emptyEventHandler; bmqimp::Application obj(options, + authenticationMessage, negotiationMessage, emptyEventHandler, bmqtst::TestHelperUtil::allocator()); @@ -78,11 +81,14 @@ static void test2_startStopTest() // Create a default application, make sure it can start/stop bmqt::SessionOptions options(bmqtst::TestHelperUtil::allocator()); + bmqp_ctrlmsg::AuthenticationMessage authenticationMessage( + bmqtst::TestHelperUtil::allocator()); bmqp_ctrlmsg::NegotiationMessage negotiationMessage( bmqtst::TestHelperUtil::allocator()); bmqimp::EventQueue::EventHandlerCallback emptyEventHandler; bmqimp::Application obj(options, + authenticationMessage, negotiationMessage, emptyEventHandler, bmqtst::TestHelperUtil::allocator()); @@ -130,11 +136,14 @@ static void test3_startStopAsyncTest() // Create a default application, make sure it can start/stop bmqt::SessionOptions options(bmqtst::TestHelperUtil::allocator()); + bmqp_ctrlmsg::AuthenticationMessage authenticationMessage( + bmqtst::TestHelperUtil::allocator()); bmqp_ctrlmsg::NegotiationMessage negotiationMessage( bmqtst::TestHelperUtil::allocator()); bmqimp::EventQueue::EventHandlerCallback emptyEventHandler; bmqimp::Application obj(options, + authenticationMessage, negotiationMessage, emptyEventHandler, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqimp/bmqimp_brokersession.cpp b/src/groups/bmq/bmqimp/bmqimp_brokersession.cpp index 14883fd00c..281af92a39 100644 --- a/src/groups/bmq/bmqimp/bmqimp_brokersession.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_brokersession.cpp @@ -18,7 +18,7 @@ #include // BMQ -#include +#include #include #include #include @@ -409,7 +409,7 @@ void BrokerSession::SessionFsm::setStarted( // Temporary safety switch to control configure request. d_session.d_channel_sp->properties().load( &d_session.d_doConfigureStream, - NegotiatedChannelFactory::k_CHANNEL_PROPERTY_CONFIGURE_STREAM); + InitialConnectionChannelFactory::k_CHANNEL_PROPERTY_CONFIGURE_STREAM); } bmqt::GenericResult::Enum @@ -3621,7 +3621,7 @@ void BrokerSession::processPushEvent(const bmqp::Event& event) d_allocator_p); if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY(rc != 0)) { BSLS_PERFORMANCEHINT_UNLIKELY_HINT; - BALL_LOG_ERROR << "Unable to flatten PUSH event" << " [rc: " << rc + BALL_LOG_ERROR << "Unable to flatten PUSH event [rc: " << rc << ", length: " << event.blob()->length() << ", eventMessageCount: " << eventMessageCount << "]" << bsl::endl @@ -6043,7 +6043,7 @@ void BrokerSession::onOpenQueueResponse( if (d_channel_sp->properties().load( &isMPsEx, - NegotiatedChannelFactory::k_CHANNEL_PROPERTY_MPS_EX)) { + InitialConnectionChannelFactory::k_CHANNEL_PROPERTY_MPS_EX)) { BSLS_ASSERT_SAFE(isMPsEx); queue->setOldStyle(false); } diff --git a/src/groups/bmq/bmqimp/bmqimp_initialconnectionchannelfactory.cpp b/src/groups/bmq/bmqimp/bmqimp_initialconnectionchannelfactory.cpp new file mode 100644 index 0000000000..d5edad106d --- /dev/null +++ b/src/groups/bmq/bmqimp/bmqimp_initialconnectionchannelfactory.cpp @@ -0,0 +1,589 @@ +// Copyright 2019-2023 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// bmqimp_initialconnectionchannelfactory.cpp -*-C++-*- +#include + +#include +// BMQ +#include +#include +#include + +#include +#include +#include +#include + +// BDE +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace BloombergLP { +namespace bmqimp { + +namespace { + +BALL_LOG_SET_NAMESPACE_CATEGORY("BMQIMP.INITIALCONNECTIONCHANNELFACTORY"); + +enum RcEnum { + rc_SUCCESS = 0, + rc_PACKET_ENCODE_FAILURE = -1, + rc_WRITE_FAILURE = -2, + rc_READ_FAILURE = -3, + rc_READ_CALLBACK_FAILURE = -4, + rc_INVALID_MESSAGE_FAILURE = -5, + rc_INVALID_AUTHENTICATION_RESPONSE = -7, + rc_INVALID_BROKER_RESPONSE = -8, + rc_AUTHENTICATION_FAILURE = -9, + rc_NEGOTIATION_FAILURE = -10 +}; + +} // close unnamed namespace + +// ------------------------------------ +// class InitialConnectionChannelFactoryConfig +// ------------------------------------ + +InitialConnectionChannelFactoryConfig::InitialConnectionChannelFactoryConfig( + bmqio::ChannelFactory* base, + const bmqp_ctrlmsg::AuthenticationMessage& authenticationMessage, + const bsls::TimeInterval& authenticationTimeout, + const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, + const bsls::TimeInterval& negotiationTimeout, + BlobSpPool* blobSpPool_p, + bslma::Allocator* basicAllocator) +: d_baseFactory_p(base) +, d_authenticationMessage(authenticationMessage, basicAllocator) +, d_authenticationTimeout(authenticationTimeout) +, d_negotiationMessage(negotiationMessage, basicAllocator) +, d_negotiationTimeout(negotiationTimeout) +, d_blobSpPool_p(blobSpPool_p) +, d_allocator_p(bslma::Default::allocator(basicAllocator)) +{ + // PRECONDITIONS + BSLS_ASSERT(base); +} + +InitialConnectionChannelFactoryConfig::InitialConnectionChannelFactoryConfig( + const InitialConnectionChannelFactoryConfig& original, + bslma::Allocator* basicAllocator) +: d_baseFactory_p(original.d_baseFactory_p) +, d_authenticationMessage(original.d_authenticationMessage, basicAllocator) +, d_authenticationTimeout(original.d_authenticationTimeout) +, d_negotiationMessage(original.d_negotiationMessage, basicAllocator) +, d_negotiationTimeout(original.d_negotiationTimeout) +, d_blobSpPool_p(original.d_blobSpPool_p) +, d_allocator_p(bslma::Default::allocator(basicAllocator)) +{ + // NOTHING +} + +// ------------------------------ +// class InitialConnectionChannelFactory +// ------------------------------ + +/// Temporary; shall remove after 2nd roll out of "new style" brokers. +const char* InitialConnectionChannelFactory::k_CHANNEL_PROPERTY_MPS_EX = + "broker.response.mps.ex"; + +/// Temporary safety switch to control configure request. +const char* + InitialConnectionChannelFactory::k_CHANNEL_PROPERTY_CONFIGURE_STREAM = + "broker.response.configure_stream"; + +const char* + InitialConnectionChannelFactory::k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS = + "broker.response.heartbeat_interval_ms"; + +const char* + InitialConnectionChannelFactory::k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS = + "broker.response.max_missed_heartbeats"; + +// PRIVATE ACCESSORS +void InitialConnectionChannelFactory::baseResultCallback( + const ResultCallback& userCb, + bmqio::ChannelFactoryEvent::Enum event, + const bmqio::Status& status, + const bsl::shared_ptr& channel) const +{ + if (event != bmqio::ChannelFactoryEvent::e_CHANNEL_UP) { + userCb(event, status, channel); + return; // RETURN + } + + authenticate(channel, userCb); +} + +void InitialConnectionChannelFactory::sendRequest( + const bsl::shared_ptr& channel, + const ACTION action, + const ResultCallback& cb) const +{ + BALL_LOG_INFO << "At InitialConnectionChannelFactory::sendRequest"; + + bsl::string actionStr; + bsl::string errorProperty; + + if (action == AUTHENTICATION) { + actionStr = "authentication"; + errorProperty = "authenticationError"; + BALL_LOG_INFO << "User " << actionStr << " with " + << d_config.d_authenticationMessage; + } + else if (action == NEGOTIATION) { + actionStr = "negotiation"; + errorProperty = "negotiationError"; + BALL_LOG_INFO << "User " << actionStr << " with " + << d_config.d_negotiationMessage; + } + + static const bmqp::EncodingType::Enum k_DEFAULT_ENCODING = + bmqp::EncodingType::e_BER; + bmqp::SchemaEventBuilder builder(d_config.d_blobSpPool_p, + k_DEFAULT_ENCODING, + d_config.d_allocator_p); + + int rc = 0; + + if (action == AUTHENTICATION) { + BALL_LOG_INFO << "Trying to send authn message: " + << d_config.d_authenticationMessage; + rc = builder.setMessage(d_config.d_authenticationMessage, + bmqp::EventType::e_AUTHENTICATION); + } + else if (action == NEGOTIATION) { + BALL_LOG_INFO << "Trying to send nego message: " + << d_config.d_negotiationMessage; + rc = builder.setMessage(d_config.d_negotiationMessage, + bmqp::EventType::e_CONTROL); + } + + if (rc != 0) { + BALL_LOG_ERROR << actionStr << " failed [reason: 'packet failed to " + << "encode', rc: " << rc << "]"; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + errorProperty, + rc_PACKET_ENCODE_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return; + } + + BALL_LOG_INFO << "Sending " << actionStr << " message to '" + << channel->peerUri(); + + bmqio::Status status; + BALL_LOG_TRACE << "Sending blob:\n" + << bmqu::BlobStartHexDumper(builder.blob().get()); + channel->write(&status, *builder.blob()); + if (!status) { + BALL_LOG_ERROR << actionStr + << " failed [reason: 'failed sending packet'" + << ", status: " << status << "]"; + status.properties().set(errorProperty, rc_WRITE_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return; + } +} + +void InitialConnectionChannelFactory::readResponse( + const bsl::shared_ptr& channel, + const ACTION action, + const ResultCallback& cb) const +{ + bmqio::Status status; + + bsl::string actionStr; + bsl::string errorProperty; + bsls::TimeInterval timeout; + + if (action == AUTHENTICATION) { + actionStr = "authentication"; + errorProperty = "authenticationError"; + timeout = d_config.d_authenticationTimeout; + } + else if (action == NEGOTIATION) { + actionStr = "negotiation"; + errorProperty = "negotiationError"; + timeout = d_config.d_negotiationTimeout; + } + + BALL_LOG_INFO << "Read response (" << actionStr << ")"; + + // Initiate a read for the broker's response message + bmqio::Channel::ReadCallback readCb = bdlf::BindUtil::bind( + bmqu::WeakMemFnUtil::weakMemFn( + &InitialConnectionChannelFactory::readPacketsCb, + d_self.acquireWeak()), + channel, + cb, + bdlf::PlaceHolders::_1, // status + bdlf::PlaceHolders::_2, // numNeeded + bdlf::PlaceHolders::_3); // blob + + channel->read(&status, bmqp::Protocol::k_PACKET_MIN_SIZE, readCb, timeout); + if (!status) { + BALL_LOG_ERROR << actionStr << " failed [reason: 'failed reading " + << "packets', status: " << status << "]"; + status.properties().set(errorProperty, rc_READ_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + } +} + +void InitialConnectionChannelFactory::authenticate( + const bsl::shared_ptr& channel, + const ResultCallback& cb) const +{ + BALL_LOG_INFO << "Client authenticate"; + sendRequest(channel, AUTHENTICATION, cb); + readResponse(channel, AUTHENTICATION, cb); +} + +void InitialConnectionChannelFactory::negotiate( + const bsl::shared_ptr& channel, + const ResultCallback& cb) const +{ + BALL_LOG_INFO << "Client negotiate"; + sendRequest(channel, NEGOTIATION, cb); + readResponse(channel, NEGOTIATION, cb); +} + +void InitialConnectionChannelFactory::readPacketsCb( + const bsl::shared_ptr& channel, + const ResultCallback& cb, + const bmqio::Status& status, + int* numNeeded, + bdlbb::Blob* blob) const +{ + BALL_LOG_INFO << "At readPacketsCb"; + + if (!status) { + // Read failure. + BALL_LOG_ERROR << "Broker read callback failed [peer: " + << channel->peerUri() << ", status: " << status << "]"; + bmqio::Status st(status); + st.properties().set("initialConnectionError", + rc_READ_CALLBACK_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, st, channel); + return; // RETURN + } + + bdlbb::Blob packet; + int rc = bmqio::ChannelUtil::handleRead(&packet, numNeeded, blob); + if (rc != 0) { + BALL_LOG_ERROR << "Broker read callback failed [peer: " + << channel->peerUri() << ", rc: " << rc << "]"; + bmqio::Status st(bmqio::StatusCategory::e_GENERIC_ERROR, + "initialConnectionError", + rc_INVALID_MESSAGE_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, st, channel); + // No more packets are expected + *numNeeded = 0; + return; // RETURN + } + + if (packet.length() == 0) { + // Don't yet have a full packet + return; // RETURN + } + + // We have the whole message. + *numNeeded = 0; // No more packets are expected + BALL_LOG_TRACE << "Read blob:\n" << bmqu::BlobStartHexDumper(&packet); + + // Process the received blob + bsl::optional authenticationMsg; + bsl::optional negotiationMsg; + + BALL_LOG_INFO << "[readPacketsCb]: decode Message (auth or nego)"; + rc = decodeInitialConnectionMessage(packet, + &authenticationMsg, + &negotiationMsg, + cb, + channel); + + // Handle authentication or negotiation based on the response message type + if (rc == 0) { + if (authenticationMsg.has_value()) { + BALL_LOG_INFO + << "[readPacketsCb]: read an AuthenticationMessage (response)"; + onBrokerAuthenticationResponse(authenticationMsg.value(), + cb, + channel); + } + else if (negotiationMsg.has_value()) { + BALL_LOG_INFO + << "[readPacketsCb]: read a NegotiationMessage (response)"; + onBrokerNegotiationResponse(negotiationMsg.value(), cb, channel); + } + else { + BALL_LOG_ERROR << "HAS TO BE EITHER"; + } + } +} + +int InitialConnectionChannelFactory::decodeInitialConnectionMessage( + const bdlbb::Blob& packet, + bsl::optional* authenticationMsg, + bsl::optional* negotiationMsg, + const ResultCallback& cb, + const bsl::shared_ptr& channel) const +{ + BALL_LOG_TRACE << "Received a packet:\n" + << bmqu::BlobStartHexDumper(&packet); + + bmqp::Event event(&packet, d_config.d_allocator_p); + if (!event.isValid()) { + BALL_LOG_ERROR << "Invalid response from broker [reason: 'packet is " + << "not a valid BlazingMQ event']: " << event; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "negotiationError", + rc_INVALID_BROKER_RESPONSE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return bmqio::ChannelFactoryEvent::e_CONNECT_FAILED; // RETURN + } + + bmqp_ctrlmsg::AuthenticationMessage authenticationMessage; + bmqp_ctrlmsg::NegotiationMessage negotiationMessage; + + if (event.isAuthenticationEvent()) { + const int rc = event.loadAuthenticationEvent(&authenticationMessage); + if (rc != 0) { + BALL_LOG_ERROR + << "Invalid response from broker [reason: 'authentication " + "event is not an AuthenticationMessage', rc: " + << rc << "]: " << event; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "authenticationError", + rc_INVALID_AUTHENTICATION_RESPONSE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return bmqio::ChannelFactoryEvent::e_CONNECT_FAILED; // RETURN + } + + if (!authenticationMessage.isAuthenticateResponseValue()) { + BALL_LOG_ERROR + << "Invalid response from broker [reason: 'authentication " + << "event is not an authenticationResponse']: " + << authenticationMessage; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "authenticationError", + rc_INVALID_AUTHENTICATION_RESPONSE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return bmqio::ChannelFactoryEvent::e_CONNECT_FAILED; // RETURN + } + + *authenticationMsg = authenticationMessage; + } + else if (event.isControlEvent()) { + const int rc = event.loadControlEvent(&negotiationMessage); + if (rc != 0) { + BALL_LOG_ERROR << "Invalid response from broker [reason: 'control " + << "event is not a NegotiationMessage', rc: " << rc + << "]: " << event; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "negotiationError", + rc_INVALID_BROKER_RESPONSE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return bmqio::ChannelFactoryEvent::e_CONNECT_FAILED; // RETURN + } + + if (!negotiationMessage.isBrokerResponseValue()) { + BALL_LOG_ERROR << "Invalid response from broker [reason: 'control " + << "event is not a brokerResponse']: " + << negotiationMessage; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "negotiationError", + rc_INVALID_BROKER_RESPONSE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return bmqio::ChannelFactoryEvent::e_CONNECT_FAILED; // RETURN + } + + *negotiationMsg = negotiationMessage; + } + else { + BALL_LOG_ERROR << "Invalid response from broker [reason: 'packet is " + << "not a control event or authentication event']: " + << event; + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "initialConnectionError", + rc_INVALID_BROKER_RESPONSE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return bmqio::ChannelFactoryEvent::e_CONNECT_FAILED; // RETURN + } + + return 0; +} + +void InitialConnectionChannelFactory::onBrokerAuthenticationResponse( + const bmqp_ctrlmsg::AuthenticationMessage& response, + const ResultCallback& cb, + const bsl::shared_ptr& channel) const +{ + const bmqp_ctrlmsg::AuthenticateResponse& authenticateResponse = + response.authenticateResponse(); + + // Check if it's an error response + if (authenticateResponse.status().category() != + bmqp_ctrlmsg::StatusCategory::E_SUCCESS) { + BALL_LOG_ERROR << "Authentication with broker failed: " << response; + + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "authenticationError", + rc_AUTHENTICATION_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return; // RETURN + } + + // Authentication SUCCEEDED + BALL_LOG_INFO << "Authentication with broker was successful: " << response; + + negotiate(channel, cb); +} + +void InitialConnectionChannelFactory::onBrokerNegotiationResponse( + const bmqp_ctrlmsg::NegotiationMessage& response, + const ResultCallback& cb, + const bsl::shared_ptr& channel) const +{ + const bmqp_ctrlmsg::BrokerResponse& brokerResponse = + response.brokerResponse(); + + // Check if it's an error response + if (brokerResponse.result().category() != + bmqp_ctrlmsg::StatusCategory::E_SUCCESS) { + BALL_LOG_ERROR << "Negotiation with broker failed: " << response; + + // Alarm if the client is using an unsupported SDK version. We can't + // use a LogAlarmObserver to write to cerr because the task may not + // have BALL observer. + if (brokerResponse.result().category() == + bmqp_ctrlmsg::StatusCategory::E_NOT_SUPPORTED) { + bdlma::LocalSequentialAllocator<512> localAllocator( + d_config.d_allocator_p); + bmqu::MemOutStream os(&localAllocator); + os << "BMQALARM [UNSUPPORTED_SDK]: The BlazingMQ version used by " + << "this client (" << bmqscm::Version::version() + << ") is no longer supported. Please relink and deploy this " + << "task."; + bsl::cerr << os.str() << '\n' << bsl::flush; + // Also print warning in users log + BALL_LOG_ERROR << os.str(); + } + + bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, + "negotiationError", + rc_NEGOTIATION_FAILURE); + cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); + return; // RETURN + } + + // Print an ALMN catchable string to act.log if the client is using a + // deprecated SDK version. We can't use a LogAlarmObserver to write to + // cerr because the task may not have a BALL observer. + if (brokerResponse.isDeprecatedSdk()) { + bdlma::LocalSequentialAllocator<512> localAllocator( + d_config.d_allocator_p); + bmqu::MemOutStream os(&localAllocator); + os << "BMQALARM [DEPRECATED_SDK]: The BlazingMQ version used by this " + << "client (" << bmqscm::Version::version() << ") is deprecated. " + << "Please relink and deploy this task."; + bsl::cerr << os.str() << '\n' << bsl::flush; + // Also print warning in users log + BALL_LOG_WARN << os.str(); + } + + // Negotiation SUCCEEDED + BALL_LOG_INFO << "Negotiation with broker was successful: " << response; + + // Temporary; shall remove after 2nd roll out of "new style" brokers. + if (bmqp::ProtocolUtil::hasFeature( + bmqp::MessagePropertiesFeatures::k_FIELD_NAME, + bmqp::MessagePropertiesFeatures::k_MESSAGE_PROPERTIES_EX, + brokerResponse.brokerIdentity().features())) { + channel->properties().set(k_CHANNEL_PROPERTY_MPS_EX, 1); + } + + if (bmqp::ProtocolUtil::hasFeature( + bmqp::SubscriptionsFeatures::k_FIELD_NAME, + bmqp::SubscriptionsFeatures::k_CONFIGURE_STREAM, + brokerResponse.brokerIdentity().features())) { + channel->properties().set(k_CHANNEL_PROPERTY_CONFIGURE_STREAM, 1); + } + + channel->properties().set(k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS, + brokerResponse.heartbeatIntervalMs()); + channel->properties().set(k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS, + brokerResponse.maxMissedHeartbeats()); + + cb(bmqio::ChannelFactoryEvent::e_CHANNEL_UP, bmqio::Status(), channel); +} + +// CREATORS +InitialConnectionChannelFactory::InitialConnectionChannelFactory( + const Config& config, + bslma::Allocator* basicAllocator) +: d_config(config, basicAllocator) +, d_self(this) // use default allocator +{ + // NOTHING +} + +InitialConnectionChannelFactory::~InitialConnectionChannelFactory() +{ + // synchronize with any currently running callbacks and prevent future + // callback invocations + d_self.invalidate(); +} + +// MANIPULATORS +void InitialConnectionChannelFactory::listen( + BSLS_ANNOTATION_UNUSED bmqio::Status* status, + BSLS_ANNOTATION_UNUSED bslma::ManagedPtr* handle, + BSLS_ANNOTATION_UNUSED const bmqio::ListenOptions& options, + BSLS_ANNOTATION_UNUSED const ResultCallback& cb) +{ + // PRECONDITIONS + BSLS_ASSERT_OPT(false && "SDK should not be listening"); +} + +void InitialConnectionChannelFactory::connect( + bmqio::Status* status, + bslma::ManagedPtr* handle, + const bmqio::ConnectOptions& options, + const ResultCallback& cb) +{ + d_config.d_baseFactory_p->connect( + status, + handle, + options, + bdlf::BindUtil::bind( + bmqu::WeakMemFnUtil::weakMemFn( + &InitialConnectionChannelFactory::baseResultCallback, + d_self.acquireWeak()), + cb, + bdlf::PlaceHolders::_1, // event + bdlf::PlaceHolders::_2, // status + bdlf::PlaceHolders::_3)); // channel +} + +} // close package namespace +} // close enterprise namespace diff --git a/src/groups/bmq/bmqimp/bmqimp_initialconnectionchannelfactory.h b/src/groups/bmq/bmqimp/bmqimp_initialconnectionchannelfactory.h new file mode 100644 index 0000000000..8a5e712acd --- /dev/null +++ b/src/groups/bmq/bmqimp/bmqimp_initialconnectionchannelfactory.h @@ -0,0 +1,215 @@ +// Copyright 2019-2023 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// bmqimp_initialconnectionchannelfactory.h -*-C++-*- +#ifndef INCLUDED_BMQIMP_NEGOTIATEDCHANNELFACTORY +#define INCLUDED_BMQIMP_NEGOTIATEDCHANNELFACTORY + +//@PURPOSE: Provide a 'ChannelFactory' that negotiates upon connecting to peer +// +//@CLASSES: +// bmqimp::InitialConnectionChannelFactory +// +//@SEE_ALSO: +// +//@DESCRIPTION: This component defines a mechanism, +// 'bmqimp::InitialConnectionChannelFactory', which is an implementation of the +// 'bmqio::ChannelFactory' protocol that performs initial connection with a +// peer on top of a channel created using a base 'bmqio::ChannelFactory'. + +// BMQ +#include +#include +#include +#include +#include +#include +#include +#include + +// BDE +#include +#include +#include +#include +#include +#include +#include + +namespace BloombergLP { + +namespace bmqimp { + +// =========================================== +// class InitialConnectionChannelFactoryConfig +// =========================================== + +/// Configuration for a `InitialConnectionChannelFactory`. +class InitialConnectionChannelFactoryConfig { + public: + // TYPES + typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool; + + private: + // PRIVATE DATA + bmqio::ChannelFactory* d_baseFactory_p; + bmqp_ctrlmsg::AuthenticationMessage d_authenticationMessage; + bsls::TimeInterval d_authenticationTimeout; + bmqp_ctrlmsg::NegotiationMessage d_negotiationMessage; + bsls::TimeInterval d_negotiationTimeout; + BlobSpPool* d_blobSpPool_p; + bslma::Allocator* d_allocator_p; + + // FRIENDS + friend class InitialConnectionChannelFactory; + + public: + // TRAITS + BSLMF_NESTED_TRAIT_DECLARATION(InitialConnectionChannelFactoryConfig, + bslma::UsesBslmaAllocator) + + // CREATORS + InitialConnectionChannelFactoryConfig( + bmqio::ChannelFactory* base, + const bmqp_ctrlmsg::AuthenticationMessage& authenticationMessage, + const bsls::TimeInterval& authenticationTimeout, + const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, + const bsls::TimeInterval& negotiationTimeout, + BlobSpPool* blobSpPool_p, + bslma::Allocator* basicAllocator = 0); + + InitialConnectionChannelFactoryConfig( + const InitialConnectionChannelFactoryConfig& original, + bslma::Allocator* basicAllocator = 0); +}; + +// ===================================== +// class InitialConnectionChannelFactory +// ===================================== + +/// `ChannelFactory` implementation that performs initial connection +/// (authentication and negotiation) with peer upon channel connection. +class InitialConnectionChannelFactory : public bmqio::ChannelFactory { + public: + // TYPES + typedef InitialConnectionChannelFactoryConfig Config; + + // CONSTANTS + + /// Name of a property set on the channel representing the broker's + /// style of MessageProperties. + /// Temporary; shall remove after 2nd roll out of "new style" brokers. + static const char* k_CHANNEL_PROPERTY_MPS_EX; + + /// Temporary safety switch to control configure request. + static const char* k_CHANNEL_PROPERTY_CONFIGURE_STREAM; + + static const char* k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS; + + static const char* k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS; + + private: + // TYPES + enum ACTION { AUTHENTICATION = 0, NEGOTIATION = 1 }; + + // PRIVATE DATA + Config d_config; + + // Used to make sure no callback is invoked an a destroyed object. + mutable bmqu::SharedResource d_self; + + // NOT IMPLEMENTED + InitialConnectionChannelFactory(const InitialConnectionChannelFactory&) + BSLS_KEYWORD_DELETED; + InitialConnectionChannelFactory& + operator=(const InitialConnectionChannelFactory&) BSLS_KEYWORD_DELETED; + + public: + // TRAITS + BSLMF_NESTED_TRAIT_DECLARATION(InitialConnectionChannelFactory, + bslma::UsesBslmaAllocator) + + private: + // PRIVATE ACCESSORS + + /// Handle an event from our base ChannelFactory. + void + baseResultCallback(const ResultCallback& userCb, + bmqio::ChannelFactoryEvent::Enum event, + const bmqio::Status& status, + const bsl::shared_ptr& channel) const; + + void sendRequest(const bsl::shared_ptr& channel, + const ACTION action, + const ResultCallback& cb) const; + + void readResponse(const bsl::shared_ptr& channel, + const ACTION action, + const ResultCallback& cb) const; + + void authenticate(const bsl::shared_ptr& channel, + const ResultCallback& cb) const; + + void negotiate(const bsl::shared_ptr& channel, + const ResultCallback& cb) const; + + void readPacketsCb(const bsl::shared_ptr& channel, + const ResultCallback& cb, + const bmqio::Status& status, + int* numNeeded, + bdlbb::Blob* blob) const; + + int decodeInitialConnectionMessage( + const bdlbb::Blob& packet, + bsl::optional* authenticationMsg, + bsl::optional* negotiationMsg, + const ResultCallback& cb, + const bsl::shared_ptr& channel) const; + + void onBrokerAuthenticationResponse( + const bmqp_ctrlmsg::AuthenticationMessage& response, + const ResultCallback& cb, + const bsl::shared_ptr& channel) const; + + void onBrokerNegotiationResponse( + const bmqp_ctrlmsg::NegotiationMessage& response, + const ResultCallback& cb, + const bsl::shared_ptr& channel) const; + + public: + // CREATORS + explicit InitialConnectionChannelFactory( + const Config& config, + bslma::Allocator* basicAllocator = 0); + + ~InitialConnectionChannelFactory() BSLS_KEYWORD_OVERRIDE; + + public: + // MANIPULATORS + void listen(bmqio::Status* status, + bslma::ManagedPtr* handle, + const bmqio::ListenOptions& options, + const ResultCallback& cb) BSLS_KEYWORD_OVERRIDE; + + void connect(bmqio::Status* status, + bslma::ManagedPtr* handle, + const bmqio::ConnectOptions& options, + const ResultCallback& cb) BSLS_KEYWORD_OVERRIDE; +}; + +} // close package namespace +} // close enterprise namespace + +#endif diff --git a/src/groups/bmq/bmqimp/bmqimp_negotiatedchannelfactory.cpp b/src/groups/bmq/bmqimp/bmqimp_negotiatedchannelfactory.cpp deleted file mode 100644 index b517d526b9..0000000000 --- a/src/groups/bmq/bmqimp/bmqimp_negotiatedchannelfactory.cpp +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright 2019-2023 Bloomberg Finance L.P. -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// bmqimp_negotiatedchannelfactory.cpp -*-C++-*- -#include - -#include -// BMQ -#include -#include -#include - -#include -#include -#include -#include - -// BDE -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace BloombergLP { -namespace bmqimp { - -namespace { - -BALL_LOG_SET_NAMESPACE_CATEGORY("BMQIMP.NEGOTIATEDCHANNELFACTORY"); - -enum RcEnum { - rc_SUCCESS = 0, - rc_PACKET_ENCODE_FAILURE = -1, - rc_WRITE_FAILURE = -2, - rc_READ_FAILURE = -3, - rc_READ_CALLBACK_FAILURE = -4, - rc_INVALID_MESSAGE_FAILURE = -5, - rc_INVALID_BROKER_RESPONSE = -6, - rc_NEGOTIATION_FAILURE = -7 -}; - -} // close unnamed namespace - -// ------------------------------------ -// class NegotiatedChannelFactoryConfig -// ------------------------------------ - -NegotiatedChannelFactoryConfig::NegotiatedChannelFactoryConfig( - bmqio::ChannelFactory* base, - const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, - const bsls::TimeInterval& negotiationTimeout, - BlobSpPool* blobSpPool_p, - bslma::Allocator* basicAllocator) -: d_baseFactory_p(base) -, d_negotiationMessage(negotiationMessage, basicAllocator) -, d_negotiationTimeout(negotiationTimeout) -, d_blobSpPool_p(blobSpPool_p) -, d_allocator_p(bslma::Default::allocator(basicAllocator)) -{ - // PRECONDITIONS - BSLS_ASSERT(base); -} - -NegotiatedChannelFactoryConfig::NegotiatedChannelFactoryConfig( - const NegotiatedChannelFactoryConfig& original, - bslma::Allocator* basicAllocator) -: d_baseFactory_p(original.d_baseFactory_p) -, d_negotiationMessage(original.d_negotiationMessage, basicAllocator) -, d_negotiationTimeout(original.d_negotiationTimeout) -, d_blobSpPool_p(original.d_blobSpPool_p) -, d_allocator_p(bslma::Default::allocator(basicAllocator)) -{ - // NOTHING -} - -// ------------------------------ -// class NegotiatedChannelFactory -// ------------------------------ - -/// Temporary; shall remove after 2nd roll out of "new style" brokers. -const char* NegotiatedChannelFactory::k_CHANNEL_PROPERTY_MPS_EX = - "broker.response.mps.ex"; - -/// Temporary safety switch to control configure request. -const char* NegotiatedChannelFactory::k_CHANNEL_PROPERTY_CONFIGURE_STREAM = - "broker.response.configure_stream"; - -const char* - NegotiatedChannelFactory::k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS = - "broker.response.heartbeat_interval_ms"; - -const char* - NegotiatedChannelFactory::k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS = - "broker.response.max_missed_heartbeats"; - -// PRIVATE ACCESSORS -void NegotiatedChannelFactory::baseResultCallback( - const ResultCallback& userCb, - bmqio::ChannelFactoryEvent::Enum event, - const bmqio::Status& status, - const bsl::shared_ptr& channel) const -{ - if (event != bmqio::ChannelFactoryEvent::e_CHANNEL_UP) { - userCb(event, status, channel); - return; // RETURN - } - - negotiate(channel, userCb); -} - -void NegotiatedChannelFactory::negotiate( - const bsl::shared_ptr& channel, - const ResultCallback& cb) const -{ - static const bmqp::EncodingType::Enum k_DEFAULT_ENCODING = - bmqp::EncodingType::e_BER; - bmqp::SchemaEventBuilder builder(d_config.d_blobSpPool_p, - k_DEFAULT_ENCODING, - d_config.d_allocator_p); - const int rc = builder.setMessage(d_config.d_negotiationMessage, - bmqp::EventType::e_CONTROL); - if (rc != 0) { - BALL_LOG_ERROR << "Negotiation failed [reason: 'packet failed to " - << "encode', rc: " << rc << "]"; - bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_PACKET_ENCODE_FAILURE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - BALL_LOG_INFO << "Sending negotiation message to '" << channel->peerUri() - << "': " << d_config.d_negotiationMessage; - bmqio::Status status; - BALL_LOG_TRACE << "Sending blob:\n" - << bmqu::BlobStartHexDumper(builder.blob().get()); - channel->write(&status, *builder.blob()); - if (!status) { - BALL_LOG_ERROR << "Negotiation failed [reason: 'failed sending packet'" - << ", status: " << status << "]"; - status.properties().set("negotiationError", rc_WRITE_FAILURE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - // Initiate a read for the broker's negotiation response message - bmqio::Channel::ReadCallback readCb = bdlf::BindUtil::bind( - bmqu::WeakMemFnUtil::weakMemFn( - &NegotiatedChannelFactory::readPacketsCb, - d_self.acquireWeak()), - channel, - cb, - bdlf::PlaceHolders::_1, // status - bdlf::PlaceHolders::_2, // numNeeded - bdlf::PlaceHolders::_3); // blob - - channel->read(&status, - bmqp::Protocol::k_PACKET_MIN_SIZE, - readCb, - d_config.d_negotiationTimeout); - if (!status) { - BALL_LOG_ERROR << "Negotiation failed [reason: 'failed reading " - << "packets', status: " << status << "]"; - status.properties().set("negotiationError", rc_READ_FAILURE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - } -} - -void NegotiatedChannelFactory::readPacketsCb( - const bsl::shared_ptr& channel, - const ResultCallback& cb, - const bmqio::Status& status, - int* numNeeded, - bdlbb::Blob* blob) const -{ - if (!status) { - // Read failure. - BALL_LOG_ERROR << "Broker negotiation read callback failed [peer: " - << channel->peerUri() << ", status: " << status << "]"; - bmqio::Status st(status); - st.properties().set("negotiationError", rc_READ_CALLBACK_FAILURE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, st, channel); - return; // RETURN - } - - bdlbb::Blob packet; - const int rc = bmqio::ChannelUtil::handleRead(&packet, numNeeded, blob); - if (rc != 0) { - BALL_LOG_ERROR << "Broker negotiation read callback failed [peer: " - << channel->peerUri() << ", rc: " << rc << "]"; - bmqio::Status st(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_INVALID_MESSAGE_FAILURE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, st, channel); - // No more packets are expected - *numNeeded = 0; - return; // RETURN - } - - if (packet.length() == 0) { - // Don't yet have a full packet - return; // RETURN - } - - // We have the whole message. - *numNeeded = 0; // No more packets are expected - BALL_LOG_TRACE << "Read blob:\n" << bmqu::BlobStartHexDumper(&packet); - onBrokerNegotiationResponse(packet, cb, channel); -} - -void NegotiatedChannelFactory::onBrokerNegotiationResponse( - const bdlbb::Blob& packet, - const ResultCallback& cb, - const bsl::shared_ptr& channel) const -{ - BALL_LOG_TRACE << "Received a packet:\n" - << bmqu::BlobStartHexDumper(&packet); - - bmqp::Event event(&packet, d_config.d_allocator_p); - if (!event.isValid()) { - BALL_LOG_ERROR << "Invalid response from broker [reason: 'packet is " - << "not a valid BlazingMQ event']: " << event; - bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_INVALID_BROKER_RESPONSE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - if (!event.isControlEvent()) { - BALL_LOG_ERROR << "Invalid response from broker [reason: 'packet is " - << "not a control event']: " << event; - bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_INVALID_BROKER_RESPONSE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - bmqp_ctrlmsg::NegotiationMessage response; - const int rc = event.loadControlEvent(&response); - if (rc != 0) { - BALL_LOG_ERROR << "Invalid response from broker [reason: 'control " - << "event is not a NegotiationMessage', rc: " << rc - << "]: " << event; - bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_INVALID_BROKER_RESPONSE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - if (!response.isBrokerResponseValue()) { - BALL_LOG_ERROR << "Invalid response from broker [reason: 'control " - << "event is not a brokerResponse']: " << response; - bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_INVALID_BROKER_RESPONSE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - const bmqp_ctrlmsg::BrokerResponse& brokerResponse = - response.brokerResponse(); - - // Check if it's an error response - if (brokerResponse.result().category() != - bmqp_ctrlmsg::StatusCategory::E_SUCCESS) { - BALL_LOG_ERROR << "Negotiation with broker failed: " << response; - - // Alarm if the client is using an unsupported SDK version. We can't - // use a LogAlarmObserver to write to cerr because the task may not - // have BALL observer. - if (brokerResponse.result().category() == - bmqp_ctrlmsg::StatusCategory::E_NOT_SUPPORTED) { - bdlma::LocalSequentialAllocator<512> localAllocator( - d_config.d_allocator_p); - bmqu::MemOutStream os(&localAllocator); - os << "BMQALARM [UNSUPPORTED_SDK]: The BlazingMQ version used by " - << "this client (" << bmqscm::Version::version() - << ") is no longer supported. Please relink and deploy this " - << "task."; - bsl::cerr << os.str() << '\n' << bsl::flush; - // Also print warning in users log - BALL_LOG_ERROR << os.str(); - } - - bmqio::Status status(bmqio::StatusCategory::e_GENERIC_ERROR, - "negotiationError", - rc_NEGOTIATION_FAILURE); - cb(bmqio::ChannelFactoryEvent::e_CONNECT_FAILED, status, channel); - return; // RETURN - } - - // Print an ALMN catchable string to act.log if the client is using a - // deprecated SDK version. We can't use a LogAlarmObserver to write to - // cerr because the task may not have a BALL observer. - if (brokerResponse.isDeprecatedSdk()) { - bdlma::LocalSequentialAllocator<512> localAllocator( - d_config.d_allocator_p); - bmqu::MemOutStream os(&localAllocator); - os << "BMQALARM [DEPRECATED_SDK]: The BlazingMQ version used by this " - << "client (" << bmqscm::Version::version() << ") is deprecated. " - << "Please relink and deploy this task."; - bsl::cerr << os.str() << '\n' << bsl::flush; - // Also print warning in users log - BALL_LOG_WARN << os.str(); - } - - // Negotiation SUCCEEDED - BALL_LOG_INFO << "Negotiation with broker was successful: " << response; - - // Temporary; shall remove after 2nd roll out of "new style" brokers. - if (bmqp::ProtocolUtil::hasFeature( - bmqp::MessagePropertiesFeatures::k_FIELD_NAME, - bmqp::MessagePropertiesFeatures::k_MESSAGE_PROPERTIES_EX, - brokerResponse.brokerIdentity().features())) { - channel->properties().set(k_CHANNEL_PROPERTY_MPS_EX, 1); - } - - if (bmqp::ProtocolUtil::hasFeature( - bmqp::SubscriptionsFeatures::k_FIELD_NAME, - bmqp::SubscriptionsFeatures::k_CONFIGURE_STREAM, - brokerResponse.brokerIdentity().features())) { - channel->properties().set(k_CHANNEL_PROPERTY_CONFIGURE_STREAM, 1); - } - - channel->properties().set(k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS, - brokerResponse.heartbeatIntervalMs()); - channel->properties().set(k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS, - brokerResponse.maxMissedHeartbeats()); - - cb(bmqio::ChannelFactoryEvent::e_CHANNEL_UP, bmqio::Status(), channel); -} - -// CREATORS -NegotiatedChannelFactory::NegotiatedChannelFactory( - const Config& config, - bslma::Allocator* basicAllocator) -: d_config(config, basicAllocator) -, d_self(this) // use default allocator -{ - // NOTHING -} - -NegotiatedChannelFactory::~NegotiatedChannelFactory() -{ - // synchronize with any currently running callbacks and prevent future - // callback invocations - d_self.invalidate(); -} - -// MANIPULATORS -void NegotiatedChannelFactory::listen( - BSLS_ANNOTATION_UNUSED bmqio::Status* status, - BSLS_ANNOTATION_UNUSED bslma::ManagedPtr* handle, - BSLS_ANNOTATION_UNUSED const bmqio::ListenOptions& options, - BSLS_ANNOTATION_UNUSED const ResultCallback& cb) -{ - // PRECONDITIONS - BSLS_ASSERT_OPT(false && "SDK should not be listening"); -} - -void NegotiatedChannelFactory::connect(bmqio::Status* status, - bslma::ManagedPtr* handle, - const bmqio::ConnectOptions& options, - const ResultCallback& cb) -{ - d_config.d_baseFactory_p->connect( - status, - handle, - options, - bdlf::BindUtil::bind(bmqu::WeakMemFnUtil::weakMemFn( - &NegotiatedChannelFactory::baseResultCallback, - d_self.acquireWeak()), - cb, - bdlf::PlaceHolders::_1, // event - bdlf::PlaceHolders::_2, // status - bdlf::PlaceHolders::_3)); // channel -} - -} // close package namespace -} // close enterprise namespace diff --git a/src/groups/bmq/bmqimp/bmqimp_negotiatedchannelfactory.h b/src/groups/bmq/bmqimp/bmqimp_negotiatedchannelfactory.h deleted file mode 100644 index 0cf7813079..0000000000 --- a/src/groups/bmq/bmqimp/bmqimp_negotiatedchannelfactory.h +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2019-2023 Bloomberg Finance L.P. -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// bmqimp_negotiatedchannelfactory.h -*-C++-*- -#ifndef INCLUDED_BMQIMP_NEGOTIATEDCHANNELFACTORY -#define INCLUDED_BMQIMP_NEGOTIATEDCHANNELFACTORY - -//@PURPOSE: Provide a 'ChannelFactory' that negotiates upon connecting to peer -// -//@CLASSES: -// bmqimp::NegotiatedChannelFactory -// -//@SEE_ALSO: -// -//@DESCRIPTION: This component defines a mechanism, -// 'bmqimp::NegotiatedChannelFactory', which is an implementation of the -// 'bmqio::ChannelFactory' protocol that performs initial negotiation with a -// peer on top of a channel created using a base 'bmqio::ChannelFactory'. - -// BMQ -#include -#include -#include -#include -#include -#include -#include -#include - -// BDE -#include -#include -#include -#include -#include -#include -#include - -namespace BloombergLP { - -namespace bmqimp { - -// ==================================== -// class NegotiatedChannelFactoryConfig -// ==================================== - -/// Configuration for a `NegotiatedChannelFactory`. -class NegotiatedChannelFactoryConfig { - public: - // TYPES - typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool; - - private: - // PRIVATE DATA - bmqio::ChannelFactory* d_baseFactory_p; - bmqp_ctrlmsg::NegotiationMessage d_negotiationMessage; - bsls::TimeInterval d_negotiationTimeout; - BlobSpPool* d_blobSpPool_p; - bslma::Allocator* d_allocator_p; - - // FRIENDS - friend class NegotiatedChannelFactory; - - public: - // TRAITS - BSLMF_NESTED_TRAIT_DECLARATION(NegotiatedChannelFactoryConfig, - bslma::UsesBslmaAllocator) - - // CREATORS - NegotiatedChannelFactoryConfig( - bmqio::ChannelFactory* base, - const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage, - const bsls::TimeInterval& negotiationTimeout, - BlobSpPool* blobSpPool_p, - bslma::Allocator* basicAllocator = 0); - - NegotiatedChannelFactoryConfig( - const NegotiatedChannelFactoryConfig& original, - bslma::Allocator* basicAllocator = 0); -}; - -// ============================== -// class NegotiatedChannelFactory -// ============================== - -/// `ChannelFactory` implementation that performs negotiation with the peer -/// upon connection. -class NegotiatedChannelFactory : public bmqio::ChannelFactory { - public: - // TYPES - typedef NegotiatedChannelFactoryConfig Config; - - // CONSTANTS - - /// Name of a property set on the channel representing the broker's - /// style of MessageProperties. - /// Temporary; shall remove after 2nd roll out of "new style" brokers. - static const char* k_CHANNEL_PROPERTY_MPS_EX; - - /// Temporary safety switch to control configure request. - static const char* k_CHANNEL_PROPERTY_CONFIGURE_STREAM; - - static const char* k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS; - - static const char* k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS; - - private: - // PRIVATE DATA - Config d_config; - - // Used to make sure no callback is invoked an a destroyed object. - mutable bmqu::SharedResource d_self; - - // NOT IMPLEMENTED - NegotiatedChannelFactory(const NegotiatedChannelFactory&) - BSLS_KEYWORD_DELETED; - NegotiatedChannelFactory& - operator=(const NegotiatedChannelFactory&) BSLS_KEYWORD_DELETED; - - public: - // TRAITS - BSLMF_NESTED_TRAIT_DECLARATION(NegotiatedChannelFactory, - bslma::UsesBslmaAllocator) - - private: - // PRIVATE ACCESSORS - - /// Handle an event from our base ChannelFactory. - void - baseResultCallback(const ResultCallback& userCb, - bmqio::ChannelFactoryEvent::Enum event, - const bmqio::Status& status, - const bsl::shared_ptr& channel) const; - - void negotiate(const bsl::shared_ptr& channel, - const ResultCallback& cb) const; - - void readPacketsCb(const bsl::shared_ptr& channel, - const ResultCallback& cb, - const bmqio::Status& status, - int* numNeeded, - bdlbb::Blob* blob) const; - - void onBrokerNegotiationResponse( - const bdlbb::Blob& packet, - const ResultCallback& cb, - const bsl::shared_ptr& channel) const; - - public: - // CREATORS - explicit NegotiatedChannelFactory(const Config& config, - bslma::Allocator* basicAllocator = 0); - - ~NegotiatedChannelFactory() BSLS_KEYWORD_OVERRIDE; - - public: - // MANIPULATORS - void listen(bmqio::Status* status, - bslma::ManagedPtr* handle, - const bmqio::ListenOptions& options, - const ResultCallback& cb) BSLS_KEYWORD_OVERRIDE; - - void connect(bmqio::Status* status, - bslma::ManagedPtr* handle, - const bmqio::ConnectOptions& options, - const ResultCallback& cb) BSLS_KEYWORD_OVERRIDE; -}; - -} // close package namespace -} // close enterprise namespace - -#endif diff --git a/src/groups/bmq/bmqimp/doc/bmqimp.txt b/src/groups/bmq/bmqimp/doc/bmqimp.txt index 81e09c23ef..67452de262 100644 --- a/src/groups/bmq/bmqimp/doc/bmqimp.txt +++ b/src/groups/bmq/bmqimp/doc/bmqimp.txt @@ -30,7 +30,7 @@ dependency. The list below shows the hierarchical ordering of the components. 2. bmqpimp_eventsstats bmqpimp_queue - 1. bmqimp_negotiatedchannelfactory + 1. bmqimp_initialconnectionchannelfactory bmqimp_stat .. @@ -57,8 +57,8 @@ dependency. The list below shows the hierarchical ordering of the components. : 'bmqimp_messagedumper': : Provide a meschanism to dump messages. : -: 'bmqimp_negotiatedchannelfactory': -: Provide a 'ChannelFactory' that negotiates upon connecting to peer. +: 'bmqimp_initialconnectionchannelfactory': +: Provide a 'ChannelFactory' that authenticates and negotiates upon connecting to peer. : : 'bmqpimp_queue': : Provide a type object to represent information about a queue. diff --git a/src/groups/bmq/bmqimp/package/bmqimp.mem b/src/groups/bmq/bmqimp/package/bmqimp.mem index 1a3661c51d..a228885a13 100644 --- a/src/groups/bmq/bmqimp/package/bmqimp.mem +++ b/src/groups/bmq/bmqimp/package/bmqimp.mem @@ -6,7 +6,7 @@ bmqimp_eventsstats bmqimp_manualhosthealthmonitor bmqimp_messagecorrelationidcontainer bmqimp_messagedumper -bmqimp_negotiatedchannelfactory +bmqimp_initialconnectionchannelfactory bmqimp_queue bmqimp_queuemanager bmqimp_stat diff --git a/src/groups/bmq/bmqp/bmqp_ctrlmsg.xsd b/src/groups/bmq/bmqp/bmqp_ctrlmsg.xsd index 1ca032d980..983a3ba785 100644 --- a/src/groups/bmq/bmqp/bmqp_ctrlmsg.xsd +++ b/src/groups/bmq/bmqp/bmqp_ctrlmsg.xsd @@ -1585,7 +1585,7 @@ - + + + + + This type is the top level type for any message being exchanged during + authentication of a connection with the broker, whether by a BlazingMQ + client or another broker. + + choice.: enumerates all the different type of authentication packets + + During negotiation, the process (whether a client using the libbmq SDK, + or a bmqbrkr) sends a 'authenticateRequest' message; to which the remote + peer will reply with a 'authenticateResponse' message. + + + + + + + + + + + + This request is a messages sent from a client to a broker during + session initiation or reauthentication. The message indicates the client + is attempting to authenticate with the supplied authentication material + to initiate a session. + + mechanism.: The authentication mechanism the client intends to use + data......: The client's authentication material + + + + + + + + + + + + Response of an 'AuthenticateRequest' request indicating the result of + the operation. The message is sent to a client from a broker during + authentication. + + status.....: Status of the request + lifetimeMs.: The duration (in milliseconds) the client's session is + valid for. The client must re-authenticate before the + lifetime expires or it will be disconnected. + + + + + + + + diff --git a/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.cpp b/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.cpp index 083da9d030..32f666c7ed 100644 --- a/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.cpp +++ b/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.cpp @@ -1,4 +1,4 @@ -// Copyright 2014-2023 Bloomberg Finance L.P. +// Copyright 2025 Bloomberg Finance L.P. // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,9 +30,11 @@ #include #include +#include #include #include #include +#include namespace BloombergLP { namespace bmqp_ctrlmsg { @@ -389,7 +391,7 @@ AppIdInfo::print(bsl::ostream& stream, int level, int spacesPerLevel) const printer.start(); printer.printAttribute("appId", this->appId()); { - bool multilineFlag = (0 <= level); + bool multilineFlag = (0 <= spacesPerLevel); bdlb::Print::indent(stream, level + 1, spacesPerLevel); stream << (multilineFlag ? "" : " "); stream << "appKey = [ "; @@ -402,6 +404,135 @@ AppIdInfo::print(bsl::ostream& stream, int level, int spacesPerLevel) const return stream; } +// ------------------------- +// class AuthenticateRequest +// ------------------------- + +// CONSTANTS + +const char AuthenticateRequest::CLASS_NAME[] = "AuthenticateRequest"; + +const bdlat_AttributeInfo AuthenticateRequest::ATTRIBUTE_INFO_ARRAY[] = { + {ATTRIBUTE_ID_MECHANISM, + "mechanism", + sizeof("mechanism") - 1, + "", + bdlat_FormattingMode::e_TEXT}, + {ATTRIBUTE_ID_DATA, + "data", + sizeof("data") - 1, + "", + bdlat_FormattingMode::e_HEX}}; + +// CLASS METHODS + +const bdlat_AttributeInfo* +AuthenticateRequest::lookupAttributeInfo(const char* name, int nameLength) +{ + for (int i = 0; i < 2; ++i) { + const bdlat_AttributeInfo& attributeInfo = + AuthenticateRequest::ATTRIBUTE_INFO_ARRAY[i]; + + if (nameLength == attributeInfo.d_nameLength && + 0 == bsl::memcmp(attributeInfo.d_name_p, name, nameLength)) { + return &attributeInfo; + } + } + + return 0; +} + +const bdlat_AttributeInfo* AuthenticateRequest::lookupAttributeInfo(int id) +{ + switch (id) { + case ATTRIBUTE_ID_MECHANISM: + return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MECHANISM]; + case ATTRIBUTE_ID_DATA: return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATA]; + default: return 0; + } +} + +// CREATORS + +AuthenticateRequest::AuthenticateRequest(bslma::Allocator* basicAllocator) +: d_mechanism(basicAllocator) +, d_data(basicAllocator) +{ +} + +AuthenticateRequest::AuthenticateRequest(const AuthenticateRequest& original, + bslma::Allocator* basicAllocator) +: d_mechanism(original.d_mechanism, basicAllocator) +, d_data(original.d_data, basicAllocator) +{ +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticateRequest::AuthenticateRequest(AuthenticateRequest&& original) + noexcept : d_mechanism(bsl::move(original.d_mechanism)), + d_data(bsl::move(original.d_data)) +{ +} + +AuthenticateRequest::AuthenticateRequest(AuthenticateRequest&& original, + bslma::Allocator* basicAllocator) +: d_mechanism(bsl::move(original.d_mechanism), basicAllocator) +, d_data(bsl::move(original.d_data), basicAllocator) +{ +} +#endif + +AuthenticateRequest::~AuthenticateRequest() +{ +} + +// MANIPULATORS + +AuthenticateRequest& +AuthenticateRequest::operator=(const AuthenticateRequest& rhs) +{ + if (this != &rhs) { + d_mechanism = rhs.d_mechanism; + d_data = rhs.d_data; + } + + return *this; +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticateRequest& AuthenticateRequest::operator=(AuthenticateRequest&& rhs) +{ + if (this != &rhs) { + d_mechanism = bsl::move(rhs.d_mechanism); + d_data = bsl::move(rhs.d_data); + } + + return *this; +} +#endif + +void AuthenticateRequest::reset() +{ + bdlat_ValueTypeFunctions::reset(&d_mechanism); + bdlat_ValueTypeFunctions::reset(&d_data); +} + +// ACCESSORS + +bsl::ostream& AuthenticateRequest::print(bsl::ostream& stream, + int level, + int spacesPerLevel) const +{ + bslim::Printer printer(&stream, level, spacesPerLevel); + printer.start(); + printer.printAttribute("mechanism", this->mechanism()); + printer.printAttribute("data", this->data()); + printer.end(); + return stream; +} + // -------------------- // class ClientLanguage // -------------------- @@ -561,49 +692,16 @@ const bdlat_AttributeInfo* CloseQueueResponse::lookupAttributeInfo(int id) // CREATORS -CloseQueueResponse::CloseQueueResponse() -{ -} - -CloseQueueResponse::CloseQueueResponse(const CloseQueueResponse& original) -{ - (void)original; -} - -CloseQueueResponse::~CloseQueueResponse() -{ -} - // MANIPULATORS -CloseQueueResponse& -CloseQueueResponse::operator=(const CloseQueueResponse& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -CloseQueueResponse& CloseQueueResponse::operator=(CloseQueueResponse&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void CloseQueueResponse::reset() { } // ACCESSORS -bsl::ostream& CloseQueueResponse::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& CloseQueueResponse::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -634,49 +732,16 @@ const bdlat_AttributeInfo* ClusterSyncRequest::lookupAttributeInfo(int id) // CREATORS -ClusterSyncRequest::ClusterSyncRequest() -{ -} - -ClusterSyncRequest::ClusterSyncRequest(const ClusterSyncRequest& original) -{ - (void)original; -} - -ClusterSyncRequest::~ClusterSyncRequest() -{ -} - // MANIPULATORS -ClusterSyncRequest& -ClusterSyncRequest::operator=(const ClusterSyncRequest& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ClusterSyncRequest& ClusterSyncRequest::operator=(ClusterSyncRequest&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void ClusterSyncRequest::reset() { } // ACCESSORS -bsl::ostream& ClusterSyncRequest::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& ClusterSyncRequest::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -707,49 +772,16 @@ const bdlat_AttributeInfo* ClusterSyncResponse::lookupAttributeInfo(int id) // CREATORS -ClusterSyncResponse::ClusterSyncResponse() -{ -} - -ClusterSyncResponse::ClusterSyncResponse(const ClusterSyncResponse& original) -{ - (void)original; -} - -ClusterSyncResponse::~ClusterSyncResponse() -{ -} - // MANIPULATORS -ClusterSyncResponse& -ClusterSyncResponse::operator=(const ClusterSyncResponse& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ClusterSyncResponse& ClusterSyncResponse::operator=(ClusterSyncResponse&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void ClusterSyncResponse::reset() { } // ACCESSORS -bsl::ostream& ClusterSyncResponse::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& ClusterSyncResponse::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -836,47 +868,8 @@ ConsumerInfo::ConsumerInfo() { } -ConsumerInfo::ConsumerInfo(const ConsumerInfo& original) -: d_maxUnconfirmedMessages(original.d_maxUnconfirmedMessages) -, d_maxUnconfirmedBytes(original.d_maxUnconfirmedBytes) -, d_consumerPriority(original.d_consumerPriority) -, d_consumerPriorityCount(original.d_consumerPriorityCount) -{ -} - -ConsumerInfo::~ConsumerInfo() -{ -} - // MANIPULATORS -ConsumerInfo& ConsumerInfo::operator=(const ConsumerInfo& rhs) -{ - if (this != &rhs) { - d_maxUnconfirmedMessages = rhs.d_maxUnconfirmedMessages; - d_maxUnconfirmedBytes = rhs.d_maxUnconfirmedBytes; - d_consumerPriority = rhs.d_consumerPriority; - d_consumerPriorityCount = rhs.d_consumerPriorityCount; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ConsumerInfo& ConsumerInfo::operator=(ConsumerInfo&& rhs) -{ - if (this != &rhs) { - d_maxUnconfirmedMessages = bsl::move(rhs.d_maxUnconfirmedMessages); - d_maxUnconfirmedBytes = bsl::move(rhs.d_maxUnconfirmedBytes); - d_consumerPriority = bsl::move(rhs.d_consumerPriority); - d_consumerPriorityCount = bsl::move(rhs.d_consumerPriorityCount); - } - - return *this; -} -#endif - void ConsumerInfo::reset() { d_maxUnconfirmedMessages = DEFAULT_INITIALIZER_MAX_UNCONFIRMED_MESSAGES; @@ -929,47 +922,16 @@ const bdlat_AttributeInfo* Disconnect::lookupAttributeInfo(int id) // CREATORS -Disconnect::Disconnect() -{ -} - -Disconnect::Disconnect(const Disconnect& original) -{ - (void)original; -} - -Disconnect::~Disconnect() -{ -} - // MANIPULATORS -Disconnect& Disconnect::operator=(const Disconnect& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -Disconnect& Disconnect::operator=(Disconnect&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void Disconnect::reset() { } // ACCESSORS -bsl::ostream& -Disconnect::print(bsl::ostream& stream, int level, int spacesPerLevel) const +bsl::ostream& Disconnect::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1000,49 +962,16 @@ const bdlat_AttributeInfo* DisconnectResponse::lookupAttributeInfo(int id) // CREATORS -DisconnectResponse::DisconnectResponse() -{ -} - -DisconnectResponse::DisconnectResponse(const DisconnectResponse& original) -{ - (void)original; -} - -DisconnectResponse::~DisconnectResponse() -{ -} - // MANIPULATORS -DisconnectResponse& -DisconnectResponse::operator=(const DisconnectResponse& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -DisconnectResponse& DisconnectResponse::operator=(DisconnectResponse&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void DisconnectResponse::reset() { } // ACCESSORS -bsl::ostream& DisconnectResponse::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& DisconnectResponse::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1226,48 +1155,16 @@ const bdlat_AttributeInfo* ElectionProposal::lookupAttributeInfo(int id) // CREATORS -ElectionProposal::ElectionProposal() -{ -} - -ElectionProposal::ElectionProposal(const ElectionProposal& original) -{ - (void)original; -} - -ElectionProposal::~ElectionProposal() -{ -} - // MANIPULATORS -ElectionProposal& ElectionProposal::operator=(const ElectionProposal& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ElectionProposal& ElectionProposal::operator=(ElectionProposal&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void ElectionProposal::reset() { } // ACCESSORS -bsl::ostream& ElectionProposal::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& ElectionProposal::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1298,48 +1195,16 @@ const bdlat_AttributeInfo* ElectionResponse::lookupAttributeInfo(int id) // CREATORS -ElectionResponse::ElectionResponse() -{ -} - -ElectionResponse::ElectionResponse(const ElectionResponse& original) -{ - (void)original; -} - -ElectionResponse::~ElectionResponse() -{ -} - // MANIPULATORS -ElectionResponse& ElectionResponse::operator=(const ElectionResponse& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ElectionResponse& ElectionResponse::operator=(ElectionResponse&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void ElectionResponse::reset() { } // ACCESSORS -bsl::ostream& ElectionResponse::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& ElectionResponse::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1392,38 +1257,8 @@ ElectorNodeStatus::ElectorNodeStatus() { } -ElectorNodeStatus::ElectorNodeStatus(const ElectorNodeStatus& original) -: d_isAvailable(original.d_isAvailable) -{ -} - -ElectorNodeStatus::~ElectorNodeStatus() -{ -} - // MANIPULATORS -ElectorNodeStatus& ElectorNodeStatus::operator=(const ElectorNodeStatus& rhs) -{ - if (this != &rhs) { - d_isAvailable = rhs.d_isAvailable; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ElectorNodeStatus& ElectorNodeStatus::operator=(ElectorNodeStatus&& rhs) -{ - if (this != &rhs) { - d_isAvailable = bsl::move(rhs.d_isAvailable); - } - - return *this; -} -#endif - void ElectorNodeStatus::reset() { bdlat_ValueTypeFunctions::reset(&d_isAvailable); @@ -1537,51 +1372,17 @@ FollowerClusterStateRequest::lookupAttributeInfo(int id) // CREATORS -FollowerClusterStateRequest::FollowerClusterStateRequest() -{ -} - -FollowerClusterStateRequest::FollowerClusterStateRequest( - const FollowerClusterStateRequest& original) -{ - (void)original; -} - -FollowerClusterStateRequest::~FollowerClusterStateRequest() -{ -} - // MANIPULATORS -FollowerClusterStateRequest& -FollowerClusterStateRequest::operator=(const FollowerClusterStateRequest& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -FollowerClusterStateRequest& -FollowerClusterStateRequest::operator=(FollowerClusterStateRequest&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void FollowerClusterStateRequest::reset() { } // ACCESSORS -bsl::ostream& FollowerClusterStateRequest::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& +FollowerClusterStateRequest::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1612,49 +1413,16 @@ const bdlat_AttributeInfo* FollowerLSNRequest::lookupAttributeInfo(int id) // CREATORS -FollowerLSNRequest::FollowerLSNRequest() -{ -} - -FollowerLSNRequest::FollowerLSNRequest(const FollowerLSNRequest& original) -{ - (void)original; -} - -FollowerLSNRequest::~FollowerLSNRequest() -{ -} - // MANIPULATORS -FollowerLSNRequest& -FollowerLSNRequest::operator=(const FollowerLSNRequest& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -FollowerLSNRequest& FollowerLSNRequest::operator=(FollowerLSNRequest&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void FollowerLSNRequest::reset() { } // ACCESSORS -bsl::ostream& FollowerLSNRequest::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& FollowerLSNRequest::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1817,48 +1585,16 @@ const bdlat_AttributeInfo* HeartbeatResponse::lookupAttributeInfo(int id) // CREATORS -HeartbeatResponse::HeartbeatResponse() -{ -} - -HeartbeatResponse::HeartbeatResponse(const HeartbeatResponse& original) -{ - (void)original; -} - -HeartbeatResponse::~HeartbeatResponse() -{ -} - // MANIPULATORS -HeartbeatResponse& HeartbeatResponse::operator=(const HeartbeatResponse& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -HeartbeatResponse& HeartbeatResponse::operator=(HeartbeatResponse&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void HeartbeatResponse::reset() { } // ACCESSORS -bsl::ostream& HeartbeatResponse::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& HeartbeatResponse::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1889,48 +1625,16 @@ const bdlat_AttributeInfo* LeaderHeartbeat::lookupAttributeInfo(int id) // CREATORS -LeaderHeartbeat::LeaderHeartbeat() -{ -} - -LeaderHeartbeat::LeaderHeartbeat(const LeaderHeartbeat& original) -{ - (void)original; -} - -LeaderHeartbeat::~LeaderHeartbeat() -{ -} - // MANIPULATORS -LeaderHeartbeat& LeaderHeartbeat::operator=(const LeaderHeartbeat& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderHeartbeat& LeaderHeartbeat::operator=(LeaderHeartbeat&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void LeaderHeartbeat::reset() { } // ACCESSORS -bsl::ostream& LeaderHeartbeat::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& LeaderHeartbeat::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1991,44 +1695,8 @@ LeaderMessageSequence::LeaderMessageSequence() { } -LeaderMessageSequence::LeaderMessageSequence( - const LeaderMessageSequence& original) -: d_electorTerm(original.d_electorTerm) -, d_sequenceNumber(original.d_sequenceNumber) -{ -} - -LeaderMessageSequence::~LeaderMessageSequence() -{ -} - // MANIPULATORS -LeaderMessageSequence& -LeaderMessageSequence::operator=(const LeaderMessageSequence& rhs) -{ - if (this != &rhs) { - d_electorTerm = rhs.d_electorTerm; - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderMessageSequence& -LeaderMessageSequence::operator=(LeaderMessageSequence&& rhs) -{ - if (this != &rhs) { - d_electorTerm = bsl::move(rhs.d_electorTerm); - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void LeaderMessageSequence::reset() { bdlat_ValueTypeFunctions::reset(&d_electorTerm); @@ -2076,47 +1744,16 @@ const bdlat_AttributeInfo* LeaderPassive::lookupAttributeInfo(int id) // CREATORS -LeaderPassive::LeaderPassive() -{ -} - -LeaderPassive::LeaderPassive(const LeaderPassive& original) -{ - (void)original; -} - -LeaderPassive::~LeaderPassive() -{ -} - // MANIPULATORS -LeaderPassive& LeaderPassive::operator=(const LeaderPassive& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderPassive& LeaderPassive::operator=(LeaderPassive&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void LeaderPassive::reset() { } // ACCESSORS -bsl::ostream& -LeaderPassive::print(bsl::ostream& stream, int level, int spacesPerLevel) const +bsl::ostream& LeaderPassive::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -2147,49 +1784,16 @@ const bdlat_AttributeInfo* LeaderSyncDataQuery::lookupAttributeInfo(int id) // CREATORS -LeaderSyncDataQuery::LeaderSyncDataQuery() -{ -} - -LeaderSyncDataQuery::LeaderSyncDataQuery(const LeaderSyncDataQuery& original) -{ - (void)original; -} - -LeaderSyncDataQuery::~LeaderSyncDataQuery() -{ -} - // MANIPULATORS -LeaderSyncDataQuery& -LeaderSyncDataQuery::operator=(const LeaderSyncDataQuery& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderSyncDataQuery& LeaderSyncDataQuery::operator=(LeaderSyncDataQuery&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void LeaderSyncDataQuery::reset() { } // ACCESSORS -bsl::ostream& LeaderSyncDataQuery::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& LeaderSyncDataQuery::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -2220,51 +1824,16 @@ const bdlat_AttributeInfo* LeaderSyncStateQuery::lookupAttributeInfo(int id) // CREATORS -LeaderSyncStateQuery::LeaderSyncStateQuery() -{ -} - -LeaderSyncStateQuery::LeaderSyncStateQuery( - const LeaderSyncStateQuery& original) -{ - (void)original; -} - -LeaderSyncStateQuery::~LeaderSyncStateQuery() -{ -} - // MANIPULATORS -LeaderSyncStateQuery& -LeaderSyncStateQuery::operator=(const LeaderSyncStateQuery& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderSyncStateQuery& -LeaderSyncStateQuery::operator=(LeaderSyncStateQuery&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void LeaderSyncStateQuery::reset() { } // ACCESSORS -bsl::ostream& LeaderSyncStateQuery::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& LeaderSyncStateQuery::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -2298,51 +1867,17 @@ LeadershipCessionNotification::lookupAttributeInfo(int id) // CREATORS -LeadershipCessionNotification::LeadershipCessionNotification() -{ -} - -LeadershipCessionNotification::LeadershipCessionNotification( - const LeadershipCessionNotification& original) -{ - (void)original; -} - -LeadershipCessionNotification::~LeadershipCessionNotification() -{ -} - // MANIPULATORS -LeadershipCessionNotification& LeadershipCessionNotification::operator=( - const LeadershipCessionNotification& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeadershipCessionNotification& -LeadershipCessionNotification::operator=(LeadershipCessionNotification&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void LeadershipCessionNotification::reset() { } // ACCESSORS -bsl::ostream& LeadershipCessionNotification::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& +LeadershipCessionNotification::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -2487,47 +2022,8 @@ PartitionPrimaryInfo::PartitionPrimaryInfo() { } -PartitionPrimaryInfo::PartitionPrimaryInfo( - const PartitionPrimaryInfo& original) -: d_primaryLeaseId(original.d_primaryLeaseId) -, d_partitionId(original.d_partitionId) -, d_primaryNodeId(original.d_primaryNodeId) -{ -} - -PartitionPrimaryInfo::~PartitionPrimaryInfo() -{ -} - // MANIPULATORS -PartitionPrimaryInfo& -PartitionPrimaryInfo::operator=(const PartitionPrimaryInfo& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_primaryNodeId = rhs.d_primaryNodeId; - d_primaryLeaseId = rhs.d_primaryLeaseId; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionPrimaryInfo& -PartitionPrimaryInfo::operator=(PartitionPrimaryInfo&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_primaryNodeId = bsl::move(rhs.d_primaryNodeId); - d_primaryLeaseId = bsl::move(rhs.d_primaryLeaseId); - } - - return *this; -} -#endif - void PartitionPrimaryInfo::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -2607,44 +2103,8 @@ PartitionSequenceNumber::PartitionSequenceNumber() { } -PartitionSequenceNumber::PartitionSequenceNumber( - const PartitionSequenceNumber& original) -: d_sequenceNumber(original.d_sequenceNumber) -, d_primaryLeaseId(original.d_primaryLeaseId) -{ -} - -PartitionSequenceNumber::~PartitionSequenceNumber() -{ -} - // MANIPULATORS -PartitionSequenceNumber& -PartitionSequenceNumber::operator=(const PartitionSequenceNumber& rhs) -{ - if (this != &rhs) { - d_primaryLeaseId = rhs.d_primaryLeaseId; - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionSequenceNumber& -PartitionSequenceNumber::operator=(PartitionSequenceNumber&& rhs) -{ - if (this != &rhs) { - d_primaryLeaseId = bsl::move(rhs.d_primaryLeaseId); - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void PartitionSequenceNumber::reset() { bdlat_ValueTypeFunctions::reset(&d_primaryLeaseId); @@ -2734,47 +2194,8 @@ PartitionSyncDataQueryResponse::PartitionSyncDataQueryResponse() { } -PartitionSyncDataQueryResponse::PartitionSyncDataQueryResponse( - const PartitionSyncDataQueryResponse& original) -: d_endSequenceNum(original.d_endSequenceNum) -, d_endPrimaryLeaseId(original.d_endPrimaryLeaseId) -, d_partitionId(original.d_partitionId) -{ -} - -PartitionSyncDataQueryResponse::~PartitionSyncDataQueryResponse() -{ -} - // MANIPULATORS -PartitionSyncDataQueryResponse& PartitionSyncDataQueryResponse::operator=( - const PartitionSyncDataQueryResponse& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_endPrimaryLeaseId = rhs.d_endPrimaryLeaseId; - d_endSequenceNum = rhs.d_endSequenceNum; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionSyncDataQueryResponse& -PartitionSyncDataQueryResponse::operator=(PartitionSyncDataQueryResponse&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_endPrimaryLeaseId = bsl::move(rhs.d_endPrimaryLeaseId); - d_endSequenceNum = bsl::move(rhs.d_endSequenceNum); - } - - return *this; -} -#endif - void PartitionSyncDataQueryResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -2832,56 +2253,23 @@ PartitionSyncStateQuery::lookupAttributeInfo(const char* name, int nameLength) return 0; } -const bdlat_AttributeInfo* PartitionSyncStateQuery::lookupAttributeInfo(int id) -{ - switch (id) { - case ATTRIBUTE_ID_PARTITION_ID: - return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PARTITION_ID]; - default: return 0; - } -} - -// CREATORS - -PartitionSyncStateQuery::PartitionSyncStateQuery() -: d_partitionId(DEFAULT_INITIALIZER_PARTITION_ID) -{ -} - -PartitionSyncStateQuery::PartitionSyncStateQuery( - const PartitionSyncStateQuery& original) -: d_partitionId(original.d_partitionId) -{ -} - -PartitionSyncStateQuery::~PartitionSyncStateQuery() -{ -} - -// MANIPULATORS - -PartitionSyncStateQuery& -PartitionSyncStateQuery::operator=(const PartitionSyncStateQuery& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionSyncStateQuery& -PartitionSyncStateQuery::operator=(PartitionSyncStateQuery&& rhs) +const bdlat_AttributeInfo* PartitionSyncStateQuery::lookupAttributeInfo(int id) { - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); + switch (id) { + case ATTRIBUTE_ID_PARTITION_ID: + return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PARTITION_ID]; + default: return 0; } +} - return *this; +// CREATORS + +PartitionSyncStateQuery::PartitionSyncStateQuery() +: d_partitionId(DEFAULT_INITIALIZER_PARTITION_ID) +{ } -#endif + +// MANIPULATORS void PartitionSyncStateQuery::reset() { @@ -3232,7 +2620,7 @@ bsl::ostream& QueueUnassignmentRequest::print(bsl::ostream& stream, printer.printAttribute("queueUri", this->queueUri()); printer.printAttribute("partitionId", this->partitionId()); { - bool multilineFlag = (0 <= level); + bool multilineFlag = (0 <= spacesPerLevel); bdlb::Print::indent(stream, level + 1, spacesPerLevel); stream << (multilineFlag ? "" : " "); stream << "queueKey = [ "; @@ -3272,51 +2660,16 @@ const bdlat_AttributeInfo* RegistrationResponse::lookupAttributeInfo(int id) // CREATORS -RegistrationResponse::RegistrationResponse() -{ -} - -RegistrationResponse::RegistrationResponse( - const RegistrationResponse& original) -{ - (void)original; -} - -RegistrationResponse::~RegistrationResponse() -{ -} - // MANIPULATORS -RegistrationResponse& -RegistrationResponse::operator=(const RegistrationResponse& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -RegistrationResponse& -RegistrationResponse::operator=(RegistrationResponse&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void RegistrationResponse::reset() { } // ACCESSORS -bsl::ostream& RegistrationResponse::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& RegistrationResponse::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -3593,41 +2946,8 @@ RoutingConfiguration::RoutingConfiguration() { } -RoutingConfiguration::RoutingConfiguration( - const RoutingConfiguration& original) -: d_flags(original.d_flags) -{ -} - -RoutingConfiguration::~RoutingConfiguration() -{ -} - // MANIPULATORS -RoutingConfiguration& -RoutingConfiguration::operator=(const RoutingConfiguration& rhs) -{ - if (this != &rhs) { - d_flags = rhs.d_flags; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -RoutingConfiguration& -RoutingConfiguration::operator=(RoutingConfiguration&& rhs) -{ - if (this != &rhs) { - d_flags = bsl::move(rhs.d_flags); - } - - return *this; -} -#endif - void RoutingConfiguration::reset() { bdlat_ValueTypeFunctions::reset(&d_flags); @@ -3759,48 +3079,16 @@ const bdlat_AttributeInfo* ScoutingRequest::lookupAttributeInfo(int id) // CREATORS -ScoutingRequest::ScoutingRequest() -{ -} - -ScoutingRequest::ScoutingRequest(const ScoutingRequest& original) -{ - (void)original; -} - -ScoutingRequest::~ScoutingRequest() -{ -} - // MANIPULATORS -ScoutingRequest& ScoutingRequest::operator=(const ScoutingRequest& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ScoutingRequest& ScoutingRequest::operator=(ScoutingRequest&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void ScoutingRequest::reset() { } // ACCESSORS -bsl::ostream& ScoutingRequest::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& ScoutingRequest::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -3853,38 +3141,8 @@ ScoutingResponse::ScoutingResponse() { } -ScoutingResponse::ScoutingResponse(const ScoutingResponse& original) -: d_willVote(original.d_willVote) -{ -} - -ScoutingResponse::~ScoutingResponse() -{ -} - // MANIPULATORS -ScoutingResponse& ScoutingResponse::operator=(const ScoutingResponse& rhs) -{ - if (this != &rhs) { - d_willVote = rhs.d_willVote; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ScoutingResponse& ScoutingResponse::operator=(ScoutingResponse&& rhs) -{ - if (this != &rhs) { - d_willVote = bsl::move(rhs.d_willVote); - } - - return *this; -} -#endif - void ScoutingResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_willVote); @@ -4540,47 +3798,8 @@ SyncPoint::SyncPoint() { } -SyncPoint::SyncPoint(const SyncPoint& original) -: d_sequenceNum(original.d_sequenceNum) -, d_primaryLeaseId(original.d_primaryLeaseId) -, d_dataFileOffsetDwords(original.d_dataFileOffsetDwords) -, d_qlistFileOffsetWords(original.d_qlistFileOffsetWords) -{ -} - -SyncPoint::~SyncPoint() -{ -} - // MANIPULATORS -SyncPoint& SyncPoint::operator=(const SyncPoint& rhs) -{ - if (this != &rhs) { - d_primaryLeaseId = rhs.d_primaryLeaseId; - d_sequenceNum = rhs.d_sequenceNum; - d_dataFileOffsetDwords = rhs.d_dataFileOffsetDwords; - d_qlistFileOffsetWords = rhs.d_qlistFileOffsetWords; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -SyncPoint& SyncPoint::operator=(SyncPoint&& rhs) -{ - if (this != &rhs) { - d_primaryLeaseId = bsl::move(rhs.d_primaryLeaseId); - d_sequenceNum = bsl::move(rhs.d_sequenceNum); - d_dataFileOffsetDwords = bsl::move(rhs.d_dataFileOffsetDwords); - d_qlistFileOffsetWords = bsl::move(rhs.d_qlistFileOffsetWords); - } - - return *this; -} -#endif - void SyncPoint::reset() { bdlat_ValueTypeFunctions::reset(&d_primaryLeaseId); @@ -4970,44 +4189,8 @@ DumpMessages::DumpMessages() { } -DumpMessages::DumpMessages(const DumpMessages& original) -: d_dumpActionValue(original.d_dumpActionValue) -, d_msgTypeToDump(original.d_msgTypeToDump) -, d_dumpActionType(original.d_dumpActionType) -{ -} - -DumpMessages::~DumpMessages() -{ -} - // MANIPULATORS -DumpMessages& DumpMessages::operator=(const DumpMessages& rhs) -{ - if (this != &rhs) { - d_msgTypeToDump = rhs.d_msgTypeToDump; - d_dumpActionType = rhs.d_dumpActionType; - d_dumpActionValue = rhs.d_dumpActionValue; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -DumpMessages& DumpMessages::operator=(DumpMessages&& rhs) -{ - if (this != &rhs) { - d_msgTypeToDump = bsl::move(rhs.d_msgTypeToDump); - d_dumpActionType = bsl::move(rhs.d_dumpActionType); - d_dumpActionValue = bsl::move(rhs.d_dumpActionValue); - } - - return *this; -} -#endif - void DumpMessages::reset() { bdlat_ValueTypeFunctions::reset(&d_msgTypeToDump); @@ -6006,39 +5189,8 @@ FollowerLSNResponse::FollowerLSNResponse() { } -FollowerLSNResponse::FollowerLSNResponse(const FollowerLSNResponse& original) -: d_sequenceNumber(original.d_sequenceNumber) -{ -} - -FollowerLSNResponse::~FollowerLSNResponse() -{ -} - // MANIPULATORS -FollowerLSNResponse& -FollowerLSNResponse::operator=(const FollowerLSNResponse& rhs) -{ - if (this != &rhs) { - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -FollowerLSNResponse& FollowerLSNResponse::operator=(FollowerLSNResponse&& rhs) -{ - if (this != &rhs) { - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void FollowerLSNResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_sequenceNumber); @@ -6106,38 +5258,8 @@ LeaderAdvisoryAck::LeaderAdvisoryAck() { } -LeaderAdvisoryAck::LeaderAdvisoryAck(const LeaderAdvisoryAck& original) -: d_sequenceNumberAcked(original.d_sequenceNumberAcked) -{ -} - -LeaderAdvisoryAck::~LeaderAdvisoryAck() -{ -} - // MANIPULATORS -LeaderAdvisoryAck& LeaderAdvisoryAck::operator=(const LeaderAdvisoryAck& rhs) -{ - if (this != &rhs) { - d_sequenceNumberAcked = rhs.d_sequenceNumberAcked; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderAdvisoryAck& LeaderAdvisoryAck::operator=(LeaderAdvisoryAck&& rhs) -{ - if (this != &rhs) { - d_sequenceNumberAcked = bsl::move(rhs.d_sequenceNumberAcked); - } - - return *this; -} -#endif - void LeaderAdvisoryAck::reset() { bdlat_ValueTypeFunctions::reset(&d_sequenceNumberAcked); @@ -6214,44 +5336,8 @@ LeaderAdvisoryCommit::LeaderAdvisoryCommit() { } -LeaderAdvisoryCommit::LeaderAdvisoryCommit( - const LeaderAdvisoryCommit& original) -: d_sequenceNumber(original.d_sequenceNumber) -, d_sequenceNumberCommitted(original.d_sequenceNumberCommitted) -{ -} - -LeaderAdvisoryCommit::~LeaderAdvisoryCommit() -{ -} - // MANIPULATORS -LeaderAdvisoryCommit& -LeaderAdvisoryCommit::operator=(const LeaderAdvisoryCommit& rhs) -{ - if (this != &rhs) { - d_sequenceNumber = rhs.d_sequenceNumber; - d_sequenceNumberCommitted = rhs.d_sequenceNumberCommitted; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderAdvisoryCommit& -LeaderAdvisoryCommit::operator=(LeaderAdvisoryCommit&& rhs) -{ - if (this != &rhs) { - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - d_sequenceNumberCommitted = bsl::move(rhs.d_sequenceNumberCommitted); - } - - return *this; -} -#endif - void LeaderAdvisoryCommit::reset() { bdlat_ValueTypeFunctions::reset(&d_sequenceNumber); @@ -6326,41 +5412,8 @@ LeaderSyncStateQueryResponse::LeaderSyncStateQueryResponse() { } -LeaderSyncStateQueryResponse::LeaderSyncStateQueryResponse( - const LeaderSyncStateQueryResponse& original) -: d_leaderMessageSequence(original.d_leaderMessageSequence) -{ -} - -LeaderSyncStateQueryResponse::~LeaderSyncStateQueryResponse() -{ -} - -// MANIPULATORS - -LeaderSyncStateQueryResponse& LeaderSyncStateQueryResponse::operator=( - const LeaderSyncStateQueryResponse& rhs) -{ - if (this != &rhs) { - d_leaderMessageSequence = rhs.d_leaderMessageSequence; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -LeaderSyncStateQueryResponse& -LeaderSyncStateQueryResponse::operator=(LeaderSyncStateQueryResponse&& rhs) -{ - if (this != &rhs) { - d_leaderMessageSequence = bsl::move(rhs.d_leaderMessageSequence); - } - - return *this; -} -#endif - +// MANIPULATORS + void LeaderSyncStateQueryResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_leaderMessageSequence); @@ -6429,39 +5482,8 @@ NodeStatusAdvisory::NodeStatusAdvisory() { } -NodeStatusAdvisory::NodeStatusAdvisory(const NodeStatusAdvisory& original) -: d_status(original.d_status) -{ -} - -NodeStatusAdvisory::~NodeStatusAdvisory() -{ -} - // MANIPULATORS -NodeStatusAdvisory& -NodeStatusAdvisory::operator=(const NodeStatusAdvisory& rhs) -{ - if (this != &rhs) { - d_status = rhs.d_status; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -NodeStatusAdvisory& NodeStatusAdvisory::operator=(NodeStatusAdvisory&& rhs) -{ - if (this != &rhs) { - d_status = bsl::move(rhs.d_status); - } - - return *this; -} -#endif - void NodeStatusAdvisory::reset() { bdlat_ValueTypeFunctions::reset(&d_status); @@ -6673,42 +5695,8 @@ PrimaryStateRequest::PrimaryStateRequest() { } -PrimaryStateRequest::PrimaryStateRequest(const PrimaryStateRequest& original) -: d_sequenceNumber(original.d_sequenceNumber) -, d_partitionId(original.d_partitionId) -{ -} - -PrimaryStateRequest::~PrimaryStateRequest() -{ -} - // MANIPULATORS -PrimaryStateRequest& -PrimaryStateRequest::operator=(const PrimaryStateRequest& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PrimaryStateRequest& PrimaryStateRequest::operator=(PrimaryStateRequest&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void PrimaryStateRequest::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -6786,44 +5774,8 @@ PrimaryStateResponse::PrimaryStateResponse() { } -PrimaryStateResponse::PrimaryStateResponse( - const PrimaryStateResponse& original) -: d_sequenceNumber(original.d_sequenceNumber) -, d_partitionId(original.d_partitionId) -{ -} - -PrimaryStateResponse::~PrimaryStateResponse() -{ -} - // MANIPULATORS -PrimaryStateResponse& -PrimaryStateResponse::operator=(const PrimaryStateResponse& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PrimaryStateResponse& -PrimaryStateResponse::operator=(PrimaryStateResponse&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void PrimaryStateResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -6912,47 +5864,8 @@ PrimaryStatusAdvisory::PrimaryStatusAdvisory() { } -PrimaryStatusAdvisory::PrimaryStatusAdvisory( - const PrimaryStatusAdvisory& original) -: d_primaryLeaseId(original.d_primaryLeaseId) -, d_partitionId(original.d_partitionId) -, d_status(original.d_status) -{ -} - -PrimaryStatusAdvisory::~PrimaryStatusAdvisory() -{ -} - // MANIPULATORS -PrimaryStatusAdvisory& -PrimaryStatusAdvisory::operator=(const PrimaryStatusAdvisory& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_primaryLeaseId = rhs.d_primaryLeaseId; - d_status = rhs.d_status; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PrimaryStatusAdvisory& -PrimaryStatusAdvisory::operator=(PrimaryStatusAdvisory&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_primaryLeaseId = bsl::move(rhs.d_primaryLeaseId); - d_status = bsl::move(rhs.d_status); - } - - return *this; -} -#endif - void PrimaryStatusAdvisory::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -7335,7 +6248,7 @@ QueueInfo::print(bsl::ostream& stream, int level, int spacesPerLevel) const printer.start(); printer.printAttribute("uri", this->uri()); { - bool multilineFlag = (0 <= level); + bool multilineFlag = (0 <= spacesPerLevel); bdlb::Print::indent(stream, level + 1, spacesPerLevel); stream << (multilineFlag ? "" : " "); stream << "key = [ "; @@ -7529,7 +6442,7 @@ bsl::ostream& QueueInfoUpdate::print(bsl::ostream& stream, printer.start(); printer.printAttribute("uri", this->uri()); { - bool multilineFlag = (0 <= level); + bool multilineFlag = (0 <= spacesPerLevel); bdlb::Print::indent(stream, level + 1, spacesPerLevel); stream << (multilineFlag ? "" : " "); stream << "key = [ "; @@ -7787,39 +6700,8 @@ RegistrationRequest::RegistrationRequest() { } -RegistrationRequest::RegistrationRequest(const RegistrationRequest& original) -: d_sequenceNumber(original.d_sequenceNumber) -{ -} - -RegistrationRequest::~RegistrationRequest() -{ -} - // MANIPULATORS -RegistrationRequest& -RegistrationRequest::operator=(const RegistrationRequest& rhs) -{ - if (this != &rhs) { - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -RegistrationRequest& RegistrationRequest::operator=(RegistrationRequest&& rhs) -{ - if (this != &rhs) { - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void RegistrationRequest::reset() { bdlat_ValueTypeFunctions::reset(&d_sequenceNumber); @@ -7911,48 +6793,8 @@ ReplicaDataRequest::ReplicaDataRequest() { } -ReplicaDataRequest::ReplicaDataRequest(const ReplicaDataRequest& original) -: d_beginSequenceNumber(original.d_beginSequenceNumber) -, d_endSequenceNumber(original.d_endSequenceNumber) -, d_partitionId(original.d_partitionId) -, d_replicaDataType(original.d_replicaDataType) -{ -} - -ReplicaDataRequest::~ReplicaDataRequest() -{ -} - // MANIPULATORS -ReplicaDataRequest& -ReplicaDataRequest::operator=(const ReplicaDataRequest& rhs) -{ - if (this != &rhs) { - d_replicaDataType = rhs.d_replicaDataType; - d_partitionId = rhs.d_partitionId; - d_beginSequenceNumber = rhs.d_beginSequenceNumber; - d_endSequenceNumber = rhs.d_endSequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ReplicaDataRequest& ReplicaDataRequest::operator=(ReplicaDataRequest&& rhs) -{ - if (this != &rhs) { - d_replicaDataType = bsl::move(rhs.d_replicaDataType); - d_partitionId = bsl::move(rhs.d_partitionId); - d_beginSequenceNumber = bsl::move(rhs.d_beginSequenceNumber); - d_endSequenceNumber = bsl::move(rhs.d_endSequenceNumber); - } - - return *this; -} -#endif - void ReplicaDataRequest::reset() { bdlat_ValueTypeFunctions::reset(&d_replicaDataType); @@ -8050,48 +6892,8 @@ ReplicaDataResponse::ReplicaDataResponse() { } -ReplicaDataResponse::ReplicaDataResponse(const ReplicaDataResponse& original) -: d_beginSequenceNumber(original.d_beginSequenceNumber) -, d_endSequenceNumber(original.d_endSequenceNumber) -, d_partitionId(original.d_partitionId) -, d_replicaDataType(original.d_replicaDataType) -{ -} - -ReplicaDataResponse::~ReplicaDataResponse() -{ -} - // MANIPULATORS -ReplicaDataResponse& -ReplicaDataResponse::operator=(const ReplicaDataResponse& rhs) -{ - if (this != &rhs) { - d_replicaDataType = rhs.d_replicaDataType; - d_partitionId = rhs.d_partitionId; - d_beginSequenceNumber = rhs.d_beginSequenceNumber; - d_endSequenceNumber = rhs.d_endSequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ReplicaDataResponse& ReplicaDataResponse::operator=(ReplicaDataResponse&& rhs) -{ - if (this != &rhs) { - d_replicaDataType = bsl::move(rhs.d_replicaDataType); - d_partitionId = bsl::move(rhs.d_partitionId); - d_beginSequenceNumber = bsl::move(rhs.d_beginSequenceNumber); - d_endSequenceNumber = bsl::move(rhs.d_endSequenceNumber); - } - - return *this; -} -#endif - void ReplicaDataResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_replicaDataType); @@ -8173,42 +6975,8 @@ ReplicaStateRequest::ReplicaStateRequest() { } -ReplicaStateRequest::ReplicaStateRequest(const ReplicaStateRequest& original) -: d_sequenceNumber(original.d_sequenceNumber) -, d_partitionId(original.d_partitionId) -{ -} - -ReplicaStateRequest::~ReplicaStateRequest() -{ -} - // MANIPULATORS -ReplicaStateRequest& -ReplicaStateRequest::operator=(const ReplicaStateRequest& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ReplicaStateRequest& ReplicaStateRequest::operator=(ReplicaStateRequest&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } - - return *this; -} -#endif - void ReplicaStateRequest::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -8276,53 +7044,17 @@ const bdlat_AttributeInfo* ReplicaStateResponse::lookupAttributeInfo(int id) return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SEQUENCE_NUMBER]; default: return 0; } -} - -// CREATORS - -ReplicaStateResponse::ReplicaStateResponse() -: d_sequenceNumber() -, d_partitionId() -{ -} - -ReplicaStateResponse::ReplicaStateResponse( - const ReplicaStateResponse& original) -: d_sequenceNumber(original.d_sequenceNumber) -, d_partitionId(original.d_partitionId) -{ -} - -ReplicaStateResponse::~ReplicaStateResponse() -{ -} - -// MANIPULATORS - -ReplicaStateResponse& -ReplicaStateResponse::operator=(const ReplicaStateResponse& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_sequenceNumber = rhs.d_sequenceNumber; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ReplicaStateResponse& -ReplicaStateResponse::operator=(ReplicaStateResponse&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_sequenceNumber = bsl::move(rhs.d_sequenceNumber); - } +} - return *this; +// CREATORS + +ReplicaStateResponse::ReplicaStateResponse() +: d_sequenceNumber() +, d_partitionId() +{ } -#endif + +// MANIPULATORS void ReplicaStateResponse::reset() { @@ -8785,48 +7517,8 @@ StorageSyncResponse::StorageSyncResponse() { } -StorageSyncResponse::StorageSyncResponse(const StorageSyncResponse& original) -: d_beginSyncPoint(original.d_beginSyncPoint) -, d_endSyncPoint(original.d_endSyncPoint) -, d_partitionId(original.d_partitionId) -, d_storageSyncResponseType(original.d_storageSyncResponseType) -{ -} - -StorageSyncResponse::~StorageSyncResponse() -{ -} - // MANIPULATORS -StorageSyncResponse& -StorageSyncResponse::operator=(const StorageSyncResponse& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_storageSyncResponseType = rhs.d_storageSyncResponseType; - d_beginSyncPoint = rhs.d_beginSyncPoint; - d_endSyncPoint = rhs.d_endSyncPoint; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -StorageSyncResponse& StorageSyncResponse::operator=(StorageSyncResponse&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_storageSyncResponseType = bsl::move(rhs.d_storageSyncResponseType); - d_beginSyncPoint = bsl::move(rhs.d_beginSyncPoint); - d_endSyncPoint = bsl::move(rhs.d_endSyncPoint); - } - - return *this; -} -#endif - void StorageSyncResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -8909,24 +7601,121 @@ SyncPointOffsetPair::SyncPointOffsetPair() { } -SyncPointOffsetPair::SyncPointOffsetPair(const SyncPointOffsetPair& original) -: d_offset(original.d_offset) -, d_syncPoint(original.d_syncPoint) +// MANIPULATORS + +void SyncPointOffsetPair::reset() +{ + bdlat_ValueTypeFunctions::reset(&d_syncPoint); + bdlat_ValueTypeFunctions::reset(&d_offset); +} + +// ACCESSORS + +bsl::ostream& SyncPointOffsetPair::print(bsl::ostream& stream, + int level, + int spacesPerLevel) const +{ + bslim::Printer printer(&stream, level, spacesPerLevel); + printer.start(); + printer.printAttribute("syncPoint", this->syncPoint()); + printer.printAttribute("offset", this->offset()); + printer.end(); + return stream; +} + +// -------------------------- +// class AuthenticateResponse +// -------------------------- + +// CONSTANTS + +const char AuthenticateResponse::CLASS_NAME[] = "AuthenticateResponse"; + +const bdlat_AttributeInfo AuthenticateResponse::ATTRIBUTE_INFO_ARRAY[] = { + {ATTRIBUTE_ID_STATUS, + "status", + sizeof("status") - 1, + "", + bdlat_FormattingMode::e_DEFAULT}, + {ATTRIBUTE_ID_LIFETIME_MS, + "lifetimeMs", + sizeof("lifetimeMs") - 1, + "", + bdlat_FormattingMode::e_DEC}}; + +// CLASS METHODS + +const bdlat_AttributeInfo* +AuthenticateResponse::lookupAttributeInfo(const char* name, int nameLength) +{ + for (int i = 0; i < 2; ++i) { + const bdlat_AttributeInfo& attributeInfo = + AuthenticateResponse::ATTRIBUTE_INFO_ARRAY[i]; + + if (nameLength == attributeInfo.d_nameLength && + 0 == bsl::memcmp(attributeInfo.d_name_p, name, nameLength)) { + return &attributeInfo; + } + } + + return 0; +} + +const bdlat_AttributeInfo* AuthenticateResponse::lookupAttributeInfo(int id) +{ + switch (id) { + case ATTRIBUTE_ID_STATUS: + return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_STATUS]; + case ATTRIBUTE_ID_LIFETIME_MS: + return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_LIFETIME_MS]; + default: return 0; + } +} + +// CREATORS + +AuthenticateResponse::AuthenticateResponse(bslma::Allocator* basicAllocator) +: d_lifetimeMs() +, d_status(basicAllocator) +{ +} + +AuthenticateResponse::AuthenticateResponse( + const AuthenticateResponse& original, + bslma::Allocator* basicAllocator) +: d_lifetimeMs(original.d_lifetimeMs) +, d_status(original.d_status, basicAllocator) +{ +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticateResponse::AuthenticateResponse(AuthenticateResponse&& original) + noexcept : d_lifetimeMs(bsl::move(original.d_lifetimeMs)), + d_status(bsl::move(original.d_status)) +{ +} + +AuthenticateResponse::AuthenticateResponse(AuthenticateResponse&& original, + bslma::Allocator* basicAllocator) +: d_lifetimeMs(bsl::move(original.d_lifetimeMs)) +, d_status(bsl::move(original.d_status), basicAllocator) { } +#endif -SyncPointOffsetPair::~SyncPointOffsetPair() +AuthenticateResponse::~AuthenticateResponse() { } // MANIPULATORS -SyncPointOffsetPair& -SyncPointOffsetPair::operator=(const SyncPointOffsetPair& rhs) +AuthenticateResponse& +AuthenticateResponse::operator=(const AuthenticateResponse& rhs) { if (this != &rhs) { - d_syncPoint = rhs.d_syncPoint; - d_offset = rhs.d_offset; + d_status = rhs.d_status; + d_lifetimeMs = rhs.d_lifetimeMs; } return *this; @@ -8934,33 +7723,34 @@ SyncPointOffsetPair::operator=(const SyncPointOffsetPair& rhs) #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -SyncPointOffsetPair& SyncPointOffsetPair::operator=(SyncPointOffsetPair&& rhs) +AuthenticateResponse& +AuthenticateResponse::operator=(AuthenticateResponse&& rhs) { if (this != &rhs) { - d_syncPoint = bsl::move(rhs.d_syncPoint); - d_offset = bsl::move(rhs.d_offset); + d_status = bsl::move(rhs.d_status); + d_lifetimeMs = bsl::move(rhs.d_lifetimeMs); } return *this; } #endif -void SyncPointOffsetPair::reset() +void AuthenticateResponse::reset() { - bdlat_ValueTypeFunctions::reset(&d_syncPoint); - bdlat_ValueTypeFunctions::reset(&d_offset); + bdlat_ValueTypeFunctions::reset(&d_status); + bdlat_ValueTypeFunctions::reset(&d_lifetimeMs); } // ACCESSORS -bsl::ostream& SyncPointOffsetPair::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& AuthenticateResponse::print(bsl::ostream& stream, + int level, + int spacesPerLevel) const { bslim::Printer printer(&stream, level, spacesPerLevel); printer.start(); - printer.printAttribute("syncPoint", this->syncPoint()); - printer.printAttribute("offset", this->offset()); + printer.printAttribute("status", this->status()); + printer.printAttribute("lifetimeMs", this->lifetimeMs()); printer.end(); return stream; } @@ -9115,10 +7905,10 @@ BrokerResponse::~BrokerResponse() BrokerResponse& BrokerResponse::operator=(const BrokerResponse& rhs) { if (this != &rhs) { - d_result = rhs.d_result; - d_protocolVersion = rhs.d_protocolVersion; - d_brokerVersion = rhs.d_brokerVersion; - d_isDeprecatedSdk = rhs.d_isDeprecatedSdk; + d_result = rhs.d_result; + d_protocolVersion = rhs.d_protocolVersion; + d_brokerVersion = rhs.d_brokerVersion; + d_isDeprecatedSdk = rhs.d_isDeprecatedSdk; d_brokerIdentity = rhs.d_brokerIdentity; d_heartbeatIntervalMs = rhs.d_heartbeatIntervalMs; d_maxMissedHeartbeats = rhs.d_maxMissedHeartbeats; @@ -9132,10 +7922,10 @@ BrokerResponse& BrokerResponse::operator=(const BrokerResponse& rhs) BrokerResponse& BrokerResponse::operator=(BrokerResponse&& rhs) { if (this != &rhs) { - d_result = bsl::move(rhs.d_result); - d_protocolVersion = bsl::move(rhs.d_protocolVersion); - d_brokerVersion = bsl::move(rhs.d_brokerVersion); - d_isDeprecatedSdk = bsl::move(rhs.d_isDeprecatedSdk); + d_result = bsl::move(rhs.d_result); + d_protocolVersion = bsl::move(rhs.d_protocolVersion); + d_brokerVersion = bsl::move(rhs.d_brokerVersion); + d_isDeprecatedSdk = bsl::move(rhs.d_isDeprecatedSdk); d_brokerIdentity = bsl::move(rhs.d_brokerIdentity); d_heartbeatIntervalMs = bsl::move(rhs.d_heartbeatIntervalMs); d_maxMissedHeartbeats = bsl::move(rhs.d_maxMissedHeartbeats); @@ -9529,41 +8319,8 @@ ElectorMessage::ElectorMessage() { } -ElectorMessage::ElectorMessage(const ElectorMessage& original) -: d_term(original.d_term) -, d_choice(original.d_choice) -{ -} - -ElectorMessage::~ElectorMessage() -{ -} - // MANIPULATORS -ElectorMessage& ElectorMessage::operator=(const ElectorMessage& rhs) -{ - if (this != &rhs) { - d_term = rhs.d_term; - d_choice = rhs.d_choice; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ElectorMessage& ElectorMessage::operator=(ElectorMessage&& rhs) -{ - if (this != &rhs) { - d_term = bsl::move(rhs.d_term); - d_choice = bsl::move(rhs.d_choice); - } - - return *this; -} -#endif - void ElectorMessage::reset() { bdlat_ValueTypeFunctions::reset(&d_term); @@ -10574,56 +9331,8 @@ PartitionSyncDataQuery::PartitionSyncDataQuery() { } -PartitionSyncDataQuery::PartitionSyncDataQuery( - const PartitionSyncDataQuery& original) -: d_lastSequenceNum(original.d_lastSequenceNum) -, d_uptoSequenceNum(original.d_uptoSequenceNum) -, d_lastSyncPointOffsetPair(original.d_lastSyncPointOffsetPair) -, d_lastPrimaryLeaseId(original.d_lastPrimaryLeaseId) -, d_uptoPrimaryLeaseId(original.d_uptoPrimaryLeaseId) -, d_partitionId(original.d_partitionId) -{ -} - -PartitionSyncDataQuery::~PartitionSyncDataQuery() -{ -} - // MANIPULATORS -PartitionSyncDataQuery& -PartitionSyncDataQuery::operator=(const PartitionSyncDataQuery& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_lastPrimaryLeaseId = rhs.d_lastPrimaryLeaseId; - d_lastSequenceNum = rhs.d_lastSequenceNum; - d_uptoPrimaryLeaseId = rhs.d_uptoPrimaryLeaseId; - d_uptoSequenceNum = rhs.d_uptoSequenceNum; - d_lastSyncPointOffsetPair = rhs.d_lastSyncPointOffsetPair; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionSyncDataQuery& -PartitionSyncDataQuery::operator=(PartitionSyncDataQuery&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_lastPrimaryLeaseId = bsl::move(rhs.d_lastPrimaryLeaseId); - d_lastSequenceNum = bsl::move(rhs.d_lastSequenceNum); - d_uptoPrimaryLeaseId = bsl::move(rhs.d_uptoPrimaryLeaseId); - d_uptoSequenceNum = bsl::move(rhs.d_uptoSequenceNum); - d_lastSyncPointOffsetPair = bsl::move(rhs.d_lastSyncPointOffsetPair); - } - - return *this; -} -#endif - void PartitionSyncDataQuery::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -10870,50 +9579,8 @@ PartitionSyncStateQueryResponse::PartitionSyncStateQueryResponse() { } -PartitionSyncStateQueryResponse::PartitionSyncStateQueryResponse( - const PartitionSyncStateQueryResponse& original) -: d_sequenceNum(original.d_sequenceNum) -, d_lastSyncPointOffsetPair(original.d_lastSyncPointOffsetPair) -, d_primaryLeaseId(original.d_primaryLeaseId) -, d_partitionId(original.d_partitionId) -{ -} - -PartitionSyncStateQueryResponse::~PartitionSyncStateQueryResponse() -{ -} - // MANIPULATORS -PartitionSyncStateQueryResponse& PartitionSyncStateQueryResponse::operator=( - const PartitionSyncStateQueryResponse& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_primaryLeaseId = rhs.d_primaryLeaseId; - d_sequenceNum = rhs.d_sequenceNum; - d_lastSyncPointOffsetPair = rhs.d_lastSyncPointOffsetPair; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionSyncStateQueryResponse& PartitionSyncStateQueryResponse::operator=( - PartitionSyncStateQueryResponse&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_primaryLeaseId = bsl::move(rhs.d_primaryLeaseId); - d_sequenceNum = bsl::move(rhs.d_sequenceNum); - d_lastSyncPointOffsetPair = bsl::move(rhs.d_lastSyncPointOffsetPair); - } - - return *this; -} -#endif - void PartitionSyncStateQueryResponse::reset() { bdlat_ValueTypeFunctions::reset(&d_partitionId); @@ -11605,38 +10272,8 @@ StateNotification::StateNotification() { } -StateNotification::StateNotification(const StateNotification& original) -: d_choice(original.d_choice) -{ -} - -StateNotification::~StateNotification() -{ -} - // MANIPULATORS -StateNotification& StateNotification::operator=(const StateNotification& rhs) -{ - if (this != &rhs) { - d_choice = rhs.d_choice; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -StateNotification& StateNotification::operator=(StateNotification&& rhs) -{ - if (this != &rhs) { - d_choice = bsl::move(rhs.d_choice); - } - - return *this; -} -#endif - void StateNotification::reset() { bdlat_ValueTypeFunctions::reset(&d_choice); @@ -11713,53 +10350,16 @@ const bdlat_AttributeInfo* StorageSyncRequest::lookupAttributeInfo(int id) } } -// CREATORS - -StorageSyncRequest::StorageSyncRequest() -: d_beginSyncPointOffsetPair() -, d_endSyncPointOffsetPair() -, d_partitionId() -{ -} - -StorageSyncRequest::StorageSyncRequest(const StorageSyncRequest& original) -: d_beginSyncPointOffsetPair(original.d_beginSyncPointOffsetPair) -, d_endSyncPointOffsetPair(original.d_endSyncPointOffsetPair) -, d_partitionId(original.d_partitionId) -{ -} - -StorageSyncRequest::~StorageSyncRequest() -{ -} - -// MANIPULATORS - -StorageSyncRequest& -StorageSyncRequest::operator=(const StorageSyncRequest& rhs) -{ - if (this != &rhs) { - d_partitionId = rhs.d_partitionId; - d_beginSyncPointOffsetPair = rhs.d_beginSyncPointOffsetPair; - d_endSyncPointOffsetPair = rhs.d_endSyncPointOffsetPair; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -StorageSyncRequest& StorageSyncRequest::operator=(StorageSyncRequest&& rhs) -{ - if (this != &rhs) { - d_partitionId = bsl::move(rhs.d_partitionId); - d_beginSyncPointOffsetPair = bsl::move(rhs.d_beginSyncPointOffsetPair); - d_endSyncPointOffsetPair = bsl::move(rhs.d_endSyncPointOffsetPair); - } +// CREATORS - return *this; +StorageSyncRequest::StorageSyncRequest() +: d_beginSyncPointOffsetPair() +, d_endSyncPointOffsetPair() +, d_partitionId() +{ } -#endif + +// MANIPULATORS void StorageSyncRequest::reset() { @@ -11927,6 +10527,348 @@ Subscription::print(bsl::ostream& stream, int level, int spacesPerLevel) const return stream; } +// --------------------------- +// class AuthenticationMessage +// --------------------------- + +// CONSTANTS + +const char AuthenticationMessage::CLASS_NAME[] = "AuthenticationMessage"; + +const bdlat_SelectionInfo AuthenticationMessage::SELECTION_INFO_ARRAY[] = { + {SELECTION_ID_AUTHENTICATE_REQUEST, + "authenticateRequest", + sizeof("authenticateRequest") - 1, + "", + bdlat_FormattingMode::e_DEFAULT}, + {SELECTION_ID_AUTHENTICATE_RESPONSE, + "authenticateResponse", + sizeof("authenticateResponse") - 1, + "", + bdlat_FormattingMode::e_DEFAULT}}; + +// CLASS METHODS + +const bdlat_SelectionInfo* +AuthenticationMessage::lookupSelectionInfo(const char* name, int nameLength) +{ + for (int i = 0; i < 2; ++i) { + const bdlat_SelectionInfo& selectionInfo = + AuthenticationMessage::SELECTION_INFO_ARRAY[i]; + + if (nameLength == selectionInfo.d_nameLength && + 0 == bsl::memcmp(selectionInfo.d_name_p, name, nameLength)) { + return &selectionInfo; + } + } + + return 0; +} + +const bdlat_SelectionInfo* AuthenticationMessage::lookupSelectionInfo(int id) +{ + switch (id) { + case SELECTION_ID_AUTHENTICATE_REQUEST: + return &SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_REQUEST]; + case SELECTION_ID_AUTHENTICATE_RESPONSE: + return &SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_RESPONSE]; + default: return 0; + } +} + +// CREATORS + +AuthenticationMessage::AuthenticationMessage( + const AuthenticationMessage& original, + bslma::Allocator* basicAllocator) +: d_selectionId(original.d_selectionId) +, d_allocator_p(bslma::Default::allocator(basicAllocator)) +{ + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + new (d_authenticateRequest.buffer()) + AuthenticateRequest(original.d_authenticateRequest.object(), + d_allocator_p); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + new (d_authenticateResponse.buffer()) + AuthenticateResponse(original.d_authenticateResponse.object(), + d_allocator_p); + } break; + default: BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId); + } +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticationMessage::AuthenticationMessage(AuthenticationMessage&& original) + noexcept : d_selectionId(original.d_selectionId), + d_allocator_p(original.d_allocator_p) +{ + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + new (d_authenticateRequest.buffer()) AuthenticateRequest( + bsl::move(original.d_authenticateRequest.object()), + d_allocator_p); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + new (d_authenticateResponse.buffer()) AuthenticateResponse( + bsl::move(original.d_authenticateResponse.object()), + d_allocator_p); + } break; + default: BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId); + } +} + +AuthenticationMessage::AuthenticationMessage(AuthenticationMessage&& original, + bslma::Allocator* basicAllocator) +: d_selectionId(original.d_selectionId) +, d_allocator_p(bslma::Default::allocator(basicAllocator)) +{ + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + new (d_authenticateRequest.buffer()) AuthenticateRequest( + bsl::move(original.d_authenticateRequest.object()), + d_allocator_p); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + new (d_authenticateResponse.buffer()) AuthenticateResponse( + bsl::move(original.d_authenticateResponse.object()), + d_allocator_p); + } break; + default: BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId); + } +} +#endif + +// MANIPULATORS + +AuthenticationMessage& +AuthenticationMessage::operator=(const AuthenticationMessage& rhs) +{ + if (this != &rhs) { + switch (rhs.d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + makeAuthenticateRequest(rhs.d_authenticateRequest.object()); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + makeAuthenticateResponse(rhs.d_authenticateResponse.object()); + } break; + default: + BSLS_ASSERT(SELECTION_ID_UNDEFINED == rhs.d_selectionId); + reset(); + } + } + + return *this; +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticationMessage& +AuthenticationMessage::operator=(AuthenticationMessage&& rhs) +{ + if (this != &rhs) { + switch (rhs.d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + makeAuthenticateRequest( + bsl::move(rhs.d_authenticateRequest.object())); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + makeAuthenticateResponse( + bsl::move(rhs.d_authenticateResponse.object())); + } break; + default: + BSLS_ASSERT(SELECTION_ID_UNDEFINED == rhs.d_selectionId); + reset(); + } + } + + return *this; +} +#endif + +void AuthenticationMessage::reset() +{ + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + d_authenticateRequest.object().~AuthenticateRequest(); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + d_authenticateResponse.object().~AuthenticateResponse(); + } break; + default: BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId); + } + + d_selectionId = SELECTION_ID_UNDEFINED; +} + +int AuthenticationMessage::makeSelection(int selectionId) +{ + switch (selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + makeAuthenticateRequest(); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + makeAuthenticateResponse(); + } break; + case SELECTION_ID_UNDEFINED: { + reset(); + } break; + default: return -1; + } + return 0; +} + +int AuthenticationMessage::makeSelection(const char* name, int nameLength) +{ + const bdlat_SelectionInfo* selectionInfo = lookupSelectionInfo(name, + nameLength); + if (0 == selectionInfo) { + return -1; + } + + return makeSelection(selectionInfo->d_id); +} + +AuthenticateRequest& AuthenticationMessage::makeAuthenticateRequest() +{ + if (SELECTION_ID_AUTHENTICATE_REQUEST == d_selectionId) { + bdlat_ValueTypeFunctions::reset(&d_authenticateRequest.object()); + } + else { + reset(); + new (d_authenticateRequest.buffer()) + AuthenticateRequest(d_allocator_p); + d_selectionId = SELECTION_ID_AUTHENTICATE_REQUEST; + } + + return d_authenticateRequest.object(); +} + +AuthenticateRequest& AuthenticationMessage::makeAuthenticateRequest( + const AuthenticateRequest& value) +{ + if (SELECTION_ID_AUTHENTICATE_REQUEST == d_selectionId) { + d_authenticateRequest.object() = value; + } + else { + reset(); + new (d_authenticateRequest.buffer()) + AuthenticateRequest(value, d_allocator_p); + d_selectionId = SELECTION_ID_AUTHENTICATE_REQUEST; + } + + return d_authenticateRequest.object(); +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticateRequest& +AuthenticationMessage::makeAuthenticateRequest(AuthenticateRequest&& value) +{ + if (SELECTION_ID_AUTHENTICATE_REQUEST == d_selectionId) { + d_authenticateRequest.object() = bsl::move(value); + } + else { + reset(); + new (d_authenticateRequest.buffer()) + AuthenticateRequest(bsl::move(value), d_allocator_p); + d_selectionId = SELECTION_ID_AUTHENTICATE_REQUEST; + } + + return d_authenticateRequest.object(); +} +#endif + +AuthenticateResponse& AuthenticationMessage::makeAuthenticateResponse() +{ + if (SELECTION_ID_AUTHENTICATE_RESPONSE == d_selectionId) { + bdlat_ValueTypeFunctions::reset(&d_authenticateResponse.object()); + } + else { + reset(); + new (d_authenticateResponse.buffer()) + AuthenticateResponse(d_allocator_p); + d_selectionId = SELECTION_ID_AUTHENTICATE_RESPONSE; + } + + return d_authenticateResponse.object(); +} + +AuthenticateResponse& AuthenticationMessage::makeAuthenticateResponse( + const AuthenticateResponse& value) +{ + if (SELECTION_ID_AUTHENTICATE_RESPONSE == d_selectionId) { + d_authenticateResponse.object() = value; + } + else { + reset(); + new (d_authenticateResponse.buffer()) + AuthenticateResponse(value, d_allocator_p); + d_selectionId = SELECTION_ID_AUTHENTICATE_RESPONSE; + } + + return d_authenticateResponse.object(); +} + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) +AuthenticateResponse& +AuthenticationMessage::makeAuthenticateResponse(AuthenticateResponse&& value) +{ + if (SELECTION_ID_AUTHENTICATE_RESPONSE == d_selectionId) { + d_authenticateResponse.object() = bsl::move(value); + } + else { + reset(); + new (d_authenticateResponse.buffer()) + AuthenticateResponse(bsl::move(value), d_allocator_p); + d_selectionId = SELECTION_ID_AUTHENTICATE_RESPONSE; + } + + return d_authenticateResponse.object(); +} +#endif + +// ACCESSORS + +bsl::ostream& AuthenticationMessage::print(bsl::ostream& stream, + int level, + int spacesPerLevel) const +{ + bslim::Printer printer(&stream, level, spacesPerLevel); + printer.start(); + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: { + printer.printAttribute("authenticateRequest", + d_authenticateRequest.object()); + } break; + case SELECTION_ID_AUTHENTICATE_RESPONSE: { + printer.printAttribute("authenticateResponse", + d_authenticateResponse.object()); + } break; + default: stream << "SELECTION UNDEFINED\n"; + } + printer.end(); + return stream; +} + +const char* AuthenticationMessage::selectionName() const +{ + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: + return SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_REQUEST] + .name(); + case SELECTION_ID_AUTHENTICATE_RESPONSE: + return SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_RESPONSE] + .name(); + default: + BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId); + return "(* UNDEFINED *)"; + } +} + // ---------------------------------- // class ConfigureQueueStreamResponse // ---------------------------------- @@ -12953,38 +11895,8 @@ PartitionMessage::PartitionMessage() { } -PartitionMessage::PartitionMessage(const PartitionMessage& original) -: d_choice(original.d_choice) -{ -} - -PartitionMessage::~PartitionMessage() -{ -} - // MANIPULATORS -PartitionMessage& PartitionMessage::operator=(const PartitionMessage& rhs) -{ - if (this != &rhs) { - d_choice = rhs.d_choice; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -PartitionMessage& PartitionMessage::operator=(PartitionMessage&& rhs) -{ - if (this != &rhs) { - d_choice = bsl::move(rhs.d_choice); - } - - return *this; -} -#endif - void PartitionMessage::reset() { bdlat_ValueTypeFunctions::reset(&d_choice); diff --git a/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.h b/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.h index 5facb95f2d..d1774a1d4e 100644 --- a/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.h +++ b/src/groups/bmq/bmqp/bmqp_ctrlmsg_messages.h @@ -1,4 +1,4 @@ -// Copyright 2014-2023 Bloomberg Finance L.P. +// Copyright 2025 Bloomberg Finance L.P. // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -66,6 +66,9 @@ namespace bmqp_ctrlmsg { class AppIdInfo; } namespace bmqp_ctrlmsg { +class AuthenticateRequest; +} +namespace bmqp_ctrlmsg { class CloseQueueResponse; } namespace bmqp_ctrlmsg { @@ -246,6 +249,9 @@ namespace bmqp_ctrlmsg { class SyncPointOffsetPair; } namespace bmqp_ctrlmsg { +class AuthenticateResponse; +} +namespace bmqp_ctrlmsg { class BrokerResponse; } namespace bmqp_ctrlmsg { @@ -297,6 +303,9 @@ namespace bmqp_ctrlmsg { class Subscription; } namespace bmqp_ctrlmsg { +class AuthenticationMessage; +} +namespace bmqp_ctrlmsg { class ConfigureQueueStreamResponse; } namespace bmqp_ctrlmsg { @@ -347,10 +356,11 @@ namespace bmqp_ctrlmsg { // class AdminCommand // ================== -/// This request is sent by the admin client to execute the specified -/// command on the broker. Command is expected in a human-friendly text -/// format, to get a list of available commands `help` command can be sent. class AdminCommand { + // This request is sent by the admin client to execute the specified + // command on the broker. Command is expected in a human-friendly text + // format, to get a list of available commands 'help' command can be sent. + // INSTANCE DATA bsl::string d_command; @@ -369,174 +379,181 @@ class AdminCommand { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `AdminCommand` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit AdminCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AdminCommand' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `AdminCommand` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. AdminCommand(const AdminCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AdminCommand' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `AdminCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. AdminCommand(AdminCommand&& original) noexcept; + // Create an object of type 'AdminCommand' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `AdminCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. AdminCommand(AdminCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'AdminCommand' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~AdminCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. AdminCommand& operator=(const AdminCommand& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. AdminCommand& operator=(AdminCommand&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Command" attribute of this - /// object. bsl::string& command(); + // Return a reference to the modifiable "Command" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Command" attribute of this - /// object. const bsl::string& command() const; + // Return a reference offering non-modifiable access to the "Command" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const AdminCommand& lhs, const AdminCommand& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.command() == rhs.command(); + } + + friend bool operator!=(const AdminCommand& lhs, const AdminCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const AdminCommand& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const AdminCommand& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'AdminCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.command()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const AdminCommand& lhs, const AdminCommand& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const AdminCommand& lhs, const AdminCommand& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const AdminCommand& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `AdminCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::AdminCommand& object); - } // close package namespace // TRAITS @@ -550,12 +567,13 @@ namespace bmqp_ctrlmsg { // class AdminCommandResponse // ========================== -/// This response is sent by the broker to the admin client in response to -/// an `AdminCommand` request with the command execution results. The -/// resulting text can be both non-structured text or represent a valid -/// json, depending on specific command. Also it can contain error message -/// if some problem occured. class AdminCommandResponse { + // This response is sent by the broker to the admin client in response to + // an 'AdminCommand' request with the command execution results. The + // resulting text can be both non-structured text or represent a valid + // json, depending on specific command. Also it can contain error message + // if some problem occured. + // INSTANCE DATA bsl::string d_text; @@ -574,178 +592,184 @@ class AdminCommandResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `AdminCommandResponse` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit AdminCommandResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AdminCommandResponse' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `AdminCommandResponse` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. AdminCommandResponse(const AdminCommandResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AdminCommandResponse' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `AdminCommandResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. AdminCommandResponse(AdminCommandResponse&& original) noexcept; + // Create an object of type 'AdminCommandResponse' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `AdminCommandResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. AdminCommandResponse(AdminCommandResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'AdminCommandResponse' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~AdminCommandResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. AdminCommandResponse& operator=(const AdminCommandResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. AdminCommandResponse& operator=(AdminCommandResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Text" attribute of this - /// object. bsl::string& text(); + // Return a reference to the modifiable "Text" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Text" attribute of this - /// object. const bsl::string& text() const; + // Return a reference offering non-modifiable access to the "Text" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const AdminCommandResponse& lhs, + const AdminCommandResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.text() == rhs.text(); + } + + friend bool operator!=(const AdminCommandResponse& lhs, + const AdminCommandResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const AdminCommandResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const AdminCommandResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'AdminCommandResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.text()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const AdminCommandResponse& lhs, - const AdminCommandResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const AdminCommandResponse& lhs, - const AdminCommandResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const AdminCommandResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `AdminCommandResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::AdminCommandResponse& object); - } // close package namespace // TRAITS @@ -759,9 +783,10 @@ namespace bmqp_ctrlmsg { // class AppIdInfo // =============== -/// This type represents the details of an application id, that is the app -/// id string and app key bytes for a queue. class AppIdInfo { + // This type represents the details of an application id, that is the app + // id string and app key bytes for a queue. + // INSTANCE DATA bsl::vector d_appKey; bsl::string d_appId; @@ -781,187 +806,419 @@ class AppIdInfo { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `AppIdInfo` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit AppIdInfo(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AppIdInfo' having the default value. Use + // the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `AppIdInfo` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. AppIdInfo(const AppIdInfo& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AppIdInfo' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `AppIdInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. AppIdInfo(AppIdInfo&& original) noexcept; + // Create an object of type 'AppIdInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `AppIdInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. AppIdInfo(AppIdInfo&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'AppIdInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~AppIdInfo(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. AppIdInfo& operator=(const AppIdInfo& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. AppIdInfo& operator=(AppIdInfo&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "AppId" attribute of this - /// object. bsl::string& appId(); + // Return a reference to the modifiable "AppId" attribute of this + // object. - /// Return a reference to the modifiable "AppKey" attribute of this - /// object. bsl::vector& appKey(); + // Return a reference to the modifiable "AppKey" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "AppId" attribute of this - /// object. const bsl::string& appId() const; + // Return a reference offering non-modifiable access to the "AppId" + // attribute of this object. - /// Return a reference to the non-modifiable "AppKey" attribute of this - /// object. const bsl::vector& appKey() const; + // Return a reference offering non-modifiable access to the "AppKey" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const AppIdInfo& lhs, const AppIdInfo& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.appId() == rhs.appId() && lhs.appKey() == rhs.appKey(); + } + + friend bool operator!=(const AppIdInfo& lhs, const AppIdInfo& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, const AppIdInfo& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const AppIdInfo& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'AppIdInfo'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.appId()); + hashAppend(hashAlg, object.appKey()); + } }; -// FREE OPERATORS +} // close package namespace + +// TRAITS + +BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( + bmqp_ctrlmsg::AppIdInfo) + +namespace bmqp_ctrlmsg { + +// ========================= +// class AuthenticateRequest +// ========================= + +class AuthenticateRequest { + // This request is a messages sent from a client to a broker during session + // initiation or reauthentication. The message indicates the client is + // attempting to authenticate with the supplied authentication material to + // initiate a session. + // mechanism.: The authentication mechanism the client intends to use + // data......: The client's authentication material + + // INSTANCE DATA + bsl::string d_mechanism; + bdlb::NullableValue > d_data; + + public: + // TYPES + enum { ATTRIBUTE_ID_MECHANISM = 0, ATTRIBUTE_ID_DATA = 1 }; + + enum { NUM_ATTRIBUTES = 2 }; + + enum { ATTRIBUTE_INDEX_MECHANISM = 0, ATTRIBUTE_INDEX_DATA = 1 }; + + // CONSTANTS + static const char CLASS_NAME[]; + + static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]; + + public: + // CLASS METHODS + static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. + + static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, + int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. + + // CREATORS + explicit AuthenticateRequest(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AuthenticateRequest' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. + + AuthenticateRequest(const AuthenticateRequest& original, + bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AuthenticateRequest' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticateRequest(AuthenticateRequest&& original) noexcept; + // Create an object of type 'AuthenticateRequest' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + + AuthenticateRequest(AuthenticateRequest&& original, + bslma::Allocator* basicAllocator); + // Create an object of type 'AuthenticateRequest' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. +#endif -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const AppIdInfo& lhs, const AppIdInfo& rhs); + ~AuthenticateRequest(); + // Destroy this object. -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const AppIdInfo& lhs, const AppIdInfo& rhs); + // MANIPULATORS + AuthenticateRequest& operator=(const AuthenticateRequest& rhs); + // Assign to this object the value of the specified 'rhs' object. + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticateRequest& operator=(AuthenticateRequest&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. +#endif -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const AppIdInfo& rhs); + void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. + + bsl::string& mechanism(); + // Return a reference to the modifiable "Mechanism" attribute of this + // object. + + bdlb::NullableValue >& data(); + // Return a reference to the modifiable "Data" attribute of this + // object. -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `AppIdInfo`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::AppIdInfo& object); + // ACCESSORS + bsl::ostream& + print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, + const char* name, + int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + const bsl::string& mechanism() const; + // Return a reference offering non-modifiable access to the "Mechanism" + // attribute of this object. + + const bdlb::NullableValue >& data() const; + // Return a reference offering non-modifiable access to the "Data" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const AuthenticateRequest& lhs, + const AuthenticateRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.mechanism() == rhs.mechanism() && lhs.data() == rhs.data(); + } + + friend bool operator!=(const AuthenticateRequest& lhs, + const AuthenticateRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const AuthenticateRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const AuthenticateRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'AuthenticateRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.mechanism()); + hashAppend(hashAlg, object.data()); + } +}; } // close package namespace // TRAITS BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( - bmqp_ctrlmsg::AppIdInfo) + bmqp_ctrlmsg::AuthenticateRequest) namespace bmqp_ctrlmsg { @@ -969,9 +1226,10 @@ namespace bmqp_ctrlmsg { // class ClientLanguage // ==================== -/// Enumeration of the various types of language which can be used by a -/// client. struct ClientLanguage { + // Enumeration of the various types of language which can be used by a + // client. + public: // TYPES enum Value { E_UNKNOWN = 0, E_CPP = 1, E_JAVA = 2 }; @@ -984,41 +1242,41 @@ struct ClientLanguage { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - ClientLanguage::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return ClientLanguage::print(stream, rhs); + } +}; } // close package namespace @@ -1032,9 +1290,10 @@ namespace bmqp_ctrlmsg { // class ClientType // ================ -/// Enumeration of the various types of client which can connect to the -/// bmqbrkr. struct ClientType { + // Enumeration of the various types of client which can connect to the + // bmqbrkr. + public: // TYPES enum Value { @@ -1052,40 +1311,41 @@ struct ClientType { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, ClientType::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return ClientType::print(stream, rhs); + } +}; } // close package namespace @@ -1099,8 +1359,9 @@ namespace bmqp_ctrlmsg { // class CloseQueueResponse // ======================== -/// Response of a `CloseQueue` request, indicating success of the operation. class CloseQueueResponse { + // Response of a 'CloseQueue' request, indicating success of the operation. + // INSTANCE DATA public: @@ -1112,156 +1373,129 @@ class CloseQueueResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `CloseQueueResponse` having the default - /// value. - CloseQueueResponse(); - - /// Create an object of type `CloseQueueResponse` having the value of - /// the specified `original` object. - CloseQueueResponse(const CloseQueueResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `CloseQueueResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - CloseQueueResponse(CloseQueueResponse&& original) = default; -#endif - - /// Destroy this object. - ~CloseQueueResponse(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - CloseQueueResponse& operator=(const CloseQueueResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - CloseQueueResponse& operator=(CloseQueueResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const CloseQueueResponse&, + const CloseQueueResponse&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const CloseQueueResponse& lhs, + const CloseQueueResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const CloseQueueResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const CloseQueueResponse&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'CloseQueueResponse'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const CloseQueueResponse& lhs, - const CloseQueueResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const CloseQueueResponse& lhs, - const CloseQueueResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const CloseQueueResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `CloseQueueResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::CloseQueueResponse& object); - } // close package namespace // TRAITS @@ -1275,11 +1509,12 @@ namespace bmqp_ctrlmsg { // class ClusterSyncRequest // ======================== -/// This type represents a message sent by a cluster member node to all -/// peers, in order to ensure sync (think of it as a distributed latch -/// between all nodes in the cluster). Each peer, upon reception of this -/// request, is expected to reply with a `ClusterSyncResponse` message. class ClusterSyncRequest { + // This type represents a message sent by a cluster member node to all + // peers, in order to ensure sync (think of it as a distributed latch + // between all nodes in the cluster). Each peer, upon reception of this + // request, is expected to reply with a 'ClusterSyncResponse' message. + // INSTANCE DATA public: @@ -1291,156 +1526,129 @@ class ClusterSyncRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `ClusterSyncRequest` having the default - /// value. - ClusterSyncRequest(); - - /// Create an object of type `ClusterSyncRequest` having the value of - /// the specified `original` object. - ClusterSyncRequest(const ClusterSyncRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClusterSyncRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ClusterSyncRequest(ClusterSyncRequest&& original) = default; -#endif - - /// Destroy this object. - ~ClusterSyncRequest(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ClusterSyncRequest& operator=(const ClusterSyncRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ClusterSyncRequest& operator=(ClusterSyncRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const ClusterSyncRequest&, + const ClusterSyncRequest&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const ClusterSyncRequest& lhs, + const ClusterSyncRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClusterSyncRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const ClusterSyncRequest&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClusterSyncRequest'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ClusterSyncRequest& lhs, - const ClusterSyncRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ClusterSyncRequest& lhs, - const ClusterSyncRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClusterSyncRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClusterSyncRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterSyncRequest& object); - } // close package namespace // TRAITS @@ -1454,9 +1662,10 @@ namespace bmqp_ctrlmsg { // class ClusterSyncResponse // ========================= -/// This type represents a message sent by a cluster member node, in -/// response to a `ClusterSyncRequest`. class ClusterSyncResponse { + // This type represents a message sent by a cluster member node, in + // response to a 'ClusterSyncRequest'. + // INSTANCE DATA public: @@ -1468,156 +1677,129 @@ class ClusterSyncResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `ClusterSyncResponse` having the default - /// value. - ClusterSyncResponse(); - - /// Create an object of type `ClusterSyncResponse` having the value of - /// the specified `original` object. - ClusterSyncResponse(const ClusterSyncResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClusterSyncResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ClusterSyncResponse(ClusterSyncResponse&& original) = default; -#endif - - /// Destroy this object. - ~ClusterSyncResponse(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ClusterSyncResponse& operator=(const ClusterSyncResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ClusterSyncResponse& operator=(ClusterSyncResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const ClusterSyncResponse&, + const ClusterSyncResponse&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const ClusterSyncResponse& lhs, + const ClusterSyncResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClusterSyncResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const ClusterSyncResponse&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClusterSyncResponse'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ClusterSyncResponse& lhs, - const ClusterSyncResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ClusterSyncResponse& lhs, - const ClusterSyncResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClusterSyncResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClusterSyncResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterSyncResponse& object); - } // close package namespace // TRAITS @@ -1631,23 +1813,30 @@ namespace bmqp_ctrlmsg { // class ConsumerInfo // ================== -/// This complex type contains various parameters required by an upstream -/// node to configure subscription for a queue handle that has already been -/// created. -/// maxUnconfirmedMessages.: maximum number of outstanding delivered but -/// pending confirmation from the client maxUnconfirmedBytes....: maximum -/// cumulated bytes of all outstanding delivered but pending confirmation -/// messages from the client consumerPriority.......: priority as advertised -/// by the downstream node for this subscription consumerPriorityCount..: -/// weight of the subscription as advertised by the downstream node, having -/// above-mentioned consumer priority class ConsumerInfo { + // This complex type contains various parameters required by an upstream + // node to configure subscription for a queue handle that has already been + // created. + // maxUnconfirmedMessages.: maximum number of outstanding delivered but + // pending confirmation from the client maxUnconfirmedBytes....: maximum + // cumulated bytes of all outstanding delivered but pending confirmation + // messages from the client consumerPriority.......: priority as advertised + // by the downstream node for this subscription consumerPriorityCount..: + // weight of the subscription as advertised by the downstream node, having + // above-mentioned consumer priority + // INSTANCE DATA bsls::Types::Int64 d_maxUnconfirmedMessages; bsls::Types::Int64 d_maxUnconfirmedBytes; int d_consumerPriority; int d_consumerPriorityCount; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ConsumerInfo& rhs) const; + public: // TYPES enum { @@ -1682,184 +1871,163 @@ class ConsumerInfo { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ConsumerInfo` having the default value. ConsumerInfo(); - - /// Create an object of type `ConsumerInfo` having the value of the - /// specified `original` object. - ConsumerInfo(const ConsumerInfo& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ConsumerInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ConsumerInfo(ConsumerInfo&& original) = default; -#endif - - /// Destroy this object. - ~ConsumerInfo(); + // Create an object of type 'ConsumerInfo' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ConsumerInfo& operator=(const ConsumerInfo& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ConsumerInfo& operator=(ConsumerInfo&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "MaxUnconfirmedMessages" - /// attribute of this object. bsls::Types::Int64& maxUnconfirmedMessages(); + // Return a reference to the modifiable "MaxUnconfirmedMessages" + // attribute of this object. - /// Return a reference to the modifiable "MaxUnconfirmedBytes" attribute - /// of this object. bsls::Types::Int64& maxUnconfirmedBytes(); + // Return a reference to the modifiable "MaxUnconfirmedBytes" attribute + // of this object. - /// Return a reference to the modifiable "ConsumerPriority" attribute of - /// this object. int& consumerPriority(); + // Return a reference to the modifiable "ConsumerPriority" attribute of + // this object. - /// Return a reference to the modifiable "ConsumerPriorityCount" - /// attribute of this object. int& consumerPriorityCount(); + // Return a reference to the modifiable "ConsumerPriorityCount" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "MaxUnconfirmedMessages" - /// attribute of this object. bsls::Types::Int64 maxUnconfirmedMessages() const; + // Return the value of the "MaxUnconfirmedMessages" attribute of this + // object. - /// Return a reference to the non-modifiable "MaxUnconfirmedBytes" - /// attribute of this object. bsls::Types::Int64 maxUnconfirmedBytes() const; + // Return the value of the "MaxUnconfirmedBytes" attribute of this + // object. - /// Return a reference to the non-modifiable "ConsumerPriority" - /// attribute of this object. int consumerPriority() const; + // Return the value of the "ConsumerPriority" attribute of this object. - /// Return a reference to the non-modifiable "ConsumerPriorityCount" - /// attribute of this object. int consumerPriorityCount() const; + // Return the value of the "ConsumerPriorityCount" attribute of this + // object. + + // HIDDEN FRIENDS + friend bool operator==(const ConsumerInfo& lhs, const ConsumerInfo& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ConsumerInfo& lhs, const ConsumerInfo& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConsumerInfo& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ConsumerInfo& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ConsumerInfo'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ConsumerInfo& lhs, const ConsumerInfo& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ConsumerInfo& lhs, const ConsumerInfo& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const ConsumerInfo& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ConsumerInfo`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConsumerInfo& object); - } // close package namespace // TRAITS @@ -1872,9 +2040,10 @@ namespace bmqp_ctrlmsg { // class Disconnect // ================ -/// This request is sent by the SDK to the broker to perform a gracefull -/// clean shutdown. class Disconnect { + // This request is sent by the SDK to the broker to perform a gracefull + // clean shutdown. + // INSTANCE DATA public: @@ -1886,152 +2055,126 @@ class Disconnect { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `Disconnect` having the default value. - Disconnect(); - - /// Create an object of type `Disconnect` having the value of the - /// specified `original` object. - Disconnect(const Disconnect& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `Disconnect` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - Disconnect(Disconnect&& original) = default; -#endif - - /// Destroy this object. - ~Disconnect(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - Disconnect& operator=(const Disconnect& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - Disconnect& operator=(Disconnect&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const Disconnect&, const Disconnect&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const Disconnect& lhs, const Disconnect& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const Disconnect& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const Disconnect&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Disconnect'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const Disconnect& lhs, const Disconnect& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const Disconnect& lhs, const Disconnect& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const Disconnect& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `Disconnect`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::Disconnect& object); - } // close package namespace // TRAITS @@ -2044,10 +2187,11 @@ namespace bmqp_ctrlmsg { // class DisconnectResponse // ======================== -/// This response is sent by the broker to the SDK in response to a -/// `Disconnect` request, to acknowledge reception of the request and -/// indicate to the client it's good to close the channel. class DisconnectResponse { + // This response is sent by the broker to the SDK in response to a + // 'Disconnect' request, to acknowledge reception of the request and + // indicate to the client it's good to close the channel. + // INSTANCE DATA public: @@ -2059,156 +2203,129 @@ class DisconnectResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `DisconnectResponse` having the default - /// value. - DisconnectResponse(); - - /// Create an object of type `DisconnectResponse` having the value of - /// the specified `original` object. - DisconnectResponse(const DisconnectResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `DisconnectResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - DisconnectResponse(DisconnectResponse&& original) = default; -#endif - - /// Destroy this object. - ~DisconnectResponse(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - DisconnectResponse& operator=(const DisconnectResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - DisconnectResponse& operator=(DisconnectResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const DisconnectResponse&, + const DisconnectResponse&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const DisconnectResponse& lhs, + const DisconnectResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DisconnectResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const DisconnectResponse&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DisconnectResponse'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const DisconnectResponse& lhs, - const DisconnectResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const DisconnectResponse& lhs, - const DisconnectResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const DisconnectResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `DisconnectResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::DisconnectResponse& object); - } // close package namespace // TRAITS @@ -2240,41 +2357,41 @@ struct DumpActionType { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - DumpActionType::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return DumpActionType::print(stream, rhs); + } +}; } // close package namespace @@ -2308,40 +2425,41 @@ struct DumpMsgType { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -// FREE OPERATORS - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, DumpMsgType::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return DumpMsgType::print(stream, rhs); + } +}; } // close package namespace @@ -2355,9 +2473,10 @@ namespace bmqp_ctrlmsg { // class ElectionProposal // ====================== -/// This type represents an election proposal from a given node in the BMQ -/// leader election algorithm. class ElectionProposal { + // This type represents an election proposal from a given node in the BMQ + // leader election algorithm. + // INSTANCE DATA public: @@ -2369,156 +2488,128 @@ class ElectionProposal { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `ElectionProposal` having the default - /// value. - ElectionProposal(); - - /// Create an object of type `ElectionProposal` having the value of the - /// specified `original` object. - ElectionProposal(const ElectionProposal& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ElectionProposal` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ElectionProposal(ElectionProposal&& original) = default; -#endif - - /// Destroy this object. - ~ElectionProposal(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ElectionProposal& operator=(const ElectionProposal& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ElectionProposal& operator=(ElectionProposal&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const ElectionProposal&, const ElectionProposal&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const ElectionProposal& lhs, + const ElectionProposal& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ElectionProposal& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const ElectionProposal&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ElectionProposal'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ElectionProposal& lhs, - const ElectionProposal& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ElectionProposal& lhs, - const ElectionProposal& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ElectionProposal& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ElectionProposal`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectionProposal& object); - } // close package namespace // TRAITS @@ -2531,9 +2622,10 @@ namespace bmqp_ctrlmsg { // class ElectionResponse // ====================== -/// This type represents an election response from a given node in the BMQ -/// leader election algorithm. class ElectionResponse { + // This type represents an election response from a given node in the BMQ + // leader election algorithm. + // INSTANCE DATA public: @@ -2545,156 +2637,128 @@ class ElectionResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `ElectionResponse` having the default - /// value. - ElectionResponse(); - - /// Create an object of type `ElectionResponse` having the value of the - /// specified `original` object. - ElectionResponse(const ElectionResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ElectionResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ElectionResponse(ElectionResponse&& original) = default; -#endif - - /// Destroy this object. - ~ElectionResponse(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ElectionResponse& operator=(const ElectionResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ElectionResponse& operator=(ElectionResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const ElectionResponse&, const ElectionResponse&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const ElectionResponse& lhs, + const ElectionResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ElectionResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const ElectionResponse&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ElectionResponse'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ElectionResponse& lhs, - const ElectionResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ElectionResponse& lhs, - const ElectionResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ElectionResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ElectionResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectionResponse& object); - } // close package namespace // TRAITS @@ -2707,10 +2771,11 @@ namespace bmqp_ctrlmsg { // class ElectorNodeStatus // ======================= -/// This type represents a notification from a node about its status. -/// isAvailable..: flag indicated whether an elector node is available or -/// not. class ElectorNodeStatus { + // This type represents a notification from a node about its status. + // isAvailable..: flag indicated whether an elector node is available or + // not. + // INSTANCE DATA bool d_isAvailable; @@ -2729,164 +2794,143 @@ class ElectorNodeStatus { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ElectorNodeStatus` having the default - /// value. ElectorNodeStatus(); - - /// Create an object of type `ElectorNodeStatus` having the value of the - /// specified `original` object. - ElectorNodeStatus(const ElectorNodeStatus& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ElectorNodeStatus` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ElectorNodeStatus(ElectorNodeStatus&& original) = default; -#endif - - /// Destroy this object. - ~ElectorNodeStatus(); + // Create an object of type 'ElectorNodeStatus' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ElectorNodeStatus& operator=(const ElectorNodeStatus& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ElectorNodeStatus& operator=(ElectorNodeStatus&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "IsAvailable" attribute of this - /// object. bool& isAvailable(); + // Return a reference to the modifiable "IsAvailable" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "IsAvailable" attribute of - /// this object. bool isAvailable() const; + // Return the value of the "IsAvailable" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ElectorNodeStatus& lhs, + const ElectorNodeStatus& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isAvailable() == rhs.isAvailable(); + } + + friend bool operator!=(const ElectorNodeStatus& lhs, + const ElectorNodeStatus& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ElectorNodeStatus& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ElectorNodeStatus& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ElectorNodeStatus'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.isAvailable()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ElectorNodeStatus& lhs, - const ElectorNodeStatus& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ElectorNodeStatus& lhs, - const ElectorNodeStatus& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ElectorNodeStatus& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ElectorNodeStatus`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectorNodeStatus& object); - } // close package namespace // TRAITS @@ -2900,8 +2944,9 @@ namespace bmqp_ctrlmsg { // class ExpressionVersion // ======================= -/// Enumeration of the various expression versions. struct ExpressionVersion { + // Enumeration of the various expression versions. + public: // TYPES enum Value { E_UNDEFINED = 0, E_VERSION_1 = 1 }; @@ -2914,41 +2959,41 @@ struct ExpressionVersion { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - ExpressionVersion::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return ExpressionVersion::print(stream, rhs); + } +}; } // close package namespace @@ -2962,9 +3007,10 @@ namespace bmqp_ctrlmsg { // class FollowerClusterStateRequest // ================================= -/// This type represents a request sent by the leader to the highest LSN -/// follower to obtain its cluster state snapshot. class FollowerClusterStateRequest { + // This type represents a request sent by the leader to the highest LSN + // follower to obtain its cluster state snapshot. + // INSTANCE DATA public: @@ -2976,159 +3022,130 @@ class FollowerClusterStateRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `FollowerClusterStateRequest` having the - /// default value. - FollowerClusterStateRequest(); - - /// Create an object of type `FollowerClusterStateRequest` having the - /// value of the specified `original` object. - FollowerClusterStateRequest(const FollowerClusterStateRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `FollowerClusterStateRequest` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. - FollowerClusterStateRequest(FollowerClusterStateRequest&& original) = - default; -#endif - - /// Destroy this object. - ~FollowerClusterStateRequest(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - FollowerClusterStateRequest& - operator=(const FollowerClusterStateRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - FollowerClusterStateRequest& operator=(FollowerClusterStateRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const FollowerClusterStateRequest&, + const FollowerClusterStateRequest&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const FollowerClusterStateRequest& lhs, + const FollowerClusterStateRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const FollowerClusterStateRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, + const FollowerClusterStateRequest&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'FollowerClusterStateRequest'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const FollowerClusterStateRequest& lhs, - const FollowerClusterStateRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const FollowerClusterStateRequest& lhs, - const FollowerClusterStateRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const FollowerClusterStateRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `FollowerClusterStateRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerClusterStateRequest& object); - } // close package namespace // TRAITS @@ -3142,9 +3159,10 @@ namespace bmqp_ctrlmsg { // class FollowerLSNRequest // ======================== -/// This type represents a request sent by the leader to a follower to query -/// its leader-sequence number. class FollowerLSNRequest { + // This type represents a request sent by the leader to a follower to query + // its leader-sequence number. + // INSTANCE DATA public: @@ -3156,156 +3174,129 @@ class FollowerLSNRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `FollowerLSNRequest` having the default - /// value. - FollowerLSNRequest(); - - /// Create an object of type `FollowerLSNRequest` having the value of - /// the specified `original` object. - FollowerLSNRequest(const FollowerLSNRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `FollowerLSNRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - FollowerLSNRequest(FollowerLSNRequest&& original) = default; -#endif - - /// Destroy this object. - ~FollowerLSNRequest(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - FollowerLSNRequest& operator=(const FollowerLSNRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - FollowerLSNRequest& operator=(FollowerLSNRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const FollowerLSNRequest&, + const FollowerLSNRequest&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const FollowerLSNRequest& lhs, + const FollowerLSNRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const FollowerLSNRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const FollowerLSNRequest&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'FollowerLSNRequest'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const FollowerLSNRequest& lhs, - const FollowerLSNRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const FollowerLSNRequest& lhs, - const FollowerLSNRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const FollowerLSNRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `FollowerLSNRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerLSNRequest& object); - } // close package namespace // TRAITS @@ -3319,12 +3310,13 @@ namespace bmqp_ctrlmsg { // class GuidInfo // ============== -/// This represents the `clientId` and `nanoSecondsFromEpoch` provided by -/// bmqp::MessageGUIDGenerator. Sending them to the broker will allow to -/// retrieve the source and compute the absolute time of a GUID. -/// clientId..............: SDK client ID nanoSecondsFromEpoch..: number of -/// nano seconds from epoch class GuidInfo { + // This represents the 'clientId' and 'nanoSecondsFromEpoch' provided by + // bmqp::MessageGUIDGenerator. Sending them to the broker will allow to + // retrieve the source and compute the absolute time of a GUID. + // clientId..............: SDK client ID nanoSecondsFromEpoch..: number of + // nano seconds from epoch + // INSTANCE DATA bsls::Types::Int64 d_nanoSecondsFromEpoch; bsl::string d_clientId; @@ -3355,180 +3347,187 @@ class GuidInfo { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `GuidInfo` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit GuidInfo(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'GuidInfo' having the default value. Use + // the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `GuidInfo` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. GuidInfo(const GuidInfo& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'GuidInfo' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `GuidInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. GuidInfo(GuidInfo&& original) noexcept; + // Create an object of type 'GuidInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `GuidInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. GuidInfo(GuidInfo&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'GuidInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~GuidInfo(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. GuidInfo& operator=(const GuidInfo& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. GuidInfo& operator=(GuidInfo&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ClientId" attribute of this - /// object. bsl::string& clientId(); + // Return a reference to the modifiable "ClientId" attribute of this + // object. - /// Return a reference to the modifiable "NanoSecondsFromEpoch" - /// attribute of this object. bsls::Types::Int64& nanoSecondsFromEpoch(); + // Return a reference to the modifiable "NanoSecondsFromEpoch" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ClientId" attribute of - /// this object. const bsl::string& clientId() const; + // Return a reference offering non-modifiable access to the "ClientId" + // attribute of this object. - /// Return a reference to the non-modifiable "NanoSecondsFromEpoch" - /// attribute of this object. bsls::Types::Int64 nanoSecondsFromEpoch() const; + // Return the value of the "NanoSecondsFromEpoch" attribute of this + // object. + + // HIDDEN FRIENDS + friend bool operator==(const GuidInfo& lhs, const GuidInfo& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.clientId() == rhs.clientId() && + lhs.nanoSecondsFromEpoch() == rhs.nanoSecondsFromEpoch(); + } + + friend bool operator!=(const GuidInfo& lhs, const GuidInfo& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, const GuidInfo& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const GuidInfo& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'GuidInfo'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.clientId()); + hashAppend(hashAlg, object.nanoSecondsFromEpoch()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const GuidInfo& lhs, const GuidInfo& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const GuidInfo& lhs, const GuidInfo& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const GuidInfo& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `GuidInfo`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::GuidInfo& object); - } // close package namespace // TRAITS @@ -3542,9 +3541,10 @@ namespace bmqp_ctrlmsg { // class HeartbeatResponse // ======================= -/// This type represents a response sent by a peer node to the node which -/// sent it a leader heartbeat message. class HeartbeatResponse { + // This type represents a response sent by a peer node to the node which + // sent it a leader heartbeat message. + // INSTANCE DATA public: @@ -3556,156 +3556,128 @@ class HeartbeatResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `HeartbeatResponse` having the default - /// value. - HeartbeatResponse(); - - /// Create an object of type `HeartbeatResponse` having the value of the - /// specified `original` object. - HeartbeatResponse(const HeartbeatResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `HeartbeatResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - HeartbeatResponse(HeartbeatResponse&& original) = default; -#endif - - /// Destroy this object. - ~HeartbeatResponse(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - HeartbeatResponse& operator=(const HeartbeatResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - HeartbeatResponse& operator=(HeartbeatResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const HeartbeatResponse&, const HeartbeatResponse&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const HeartbeatResponse& lhs, + const HeartbeatResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const HeartbeatResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const HeartbeatResponse&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'HeartbeatResponse'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const HeartbeatResponse& lhs, - const HeartbeatResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const HeartbeatResponse& lhs, - const HeartbeatResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const HeartbeatResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `HeartbeatResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::HeartbeatResponse& object); - } // close package namespace // TRAITS @@ -3719,9 +3691,10 @@ namespace bmqp_ctrlmsg { // class LeaderHeartbeat // ===================== -/// This type represents a heartbeat from the leader node in the BMQ leader -/// election algorithm. class LeaderHeartbeat { + // This type represents a heartbeat from the leader node in the BlazingMQ + // leader election algorithm. + // INSTANCE DATA public: @@ -3733,153 +3706,128 @@ class LeaderHeartbeat { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `LeaderHeartbeat` having the default value. - LeaderHeartbeat(); - - /// Create an object of type `LeaderHeartbeat` having the value of the - /// specified `original` object. - LeaderHeartbeat(const LeaderHeartbeat& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderHeartbeat` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderHeartbeat(LeaderHeartbeat&& original) = default; -#endif - - /// Destroy this object. - ~LeaderHeartbeat(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderHeartbeat& operator=(const LeaderHeartbeat& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderHeartbeat& operator=(LeaderHeartbeat&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderHeartbeat&, const LeaderHeartbeat&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const LeaderHeartbeat& lhs, + const LeaderHeartbeat& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderHeartbeat& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const LeaderHeartbeat&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderHeartbeat'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderHeartbeat& lhs, const LeaderHeartbeat& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderHeartbeat& lhs, const LeaderHeartbeat& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderHeartbeat& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderHeartbeat`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderHeartbeat& object); - } // close package namespace // TRAITS @@ -3892,9 +3840,10 @@ namespace bmqp_ctrlmsg { // class LeaderMessageSequence // =========================== -/// This type represents the sequence number of a message/advisory/response -/// sent by the leader. class LeaderMessageSequence { + // This type represents the sequence number of a message/advisory/response + // sent by the leader. + // INSTANCE DATA bsls::Types::Uint64 d_electorTerm; bsls::Types::Uint64 d_sequenceNumber; @@ -3917,172 +3866,152 @@ class LeaderMessageSequence { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `LeaderMessageSequence` having the default - /// value. LeaderMessageSequence(); - - /// Create an object of type `LeaderMessageSequence` having the value of - /// the specified `original` object. - LeaderMessageSequence(const LeaderMessageSequence& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderMessageSequence` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderMessageSequence(LeaderMessageSequence&& original) = default; -#endif - - /// Destroy this object. - ~LeaderMessageSequence(); + // Create an object of type 'LeaderMessageSequence' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderMessageSequence& operator=(const LeaderMessageSequence& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderMessageSequence& operator=(LeaderMessageSequence&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ElectorTerm" attribute of this - /// object. bsls::Types::Uint64& electorTerm(); + // Return a reference to the modifiable "ElectorTerm" attribute of this + // object. - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. bsls::Types::Uint64& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ElectorTerm" attribute of - /// this object. bsls::Types::Uint64 electorTerm() const; + // Return the value of the "ElectorTerm" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. bsls::Types::Uint64 sequenceNumber() const; + // Return the value of the "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderMessageSequence& lhs, + const LeaderMessageSequence& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.electorTerm() == rhs.electorTerm() && + lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const LeaderMessageSequence& lhs, + const LeaderMessageSequence& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderMessageSequence& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const LeaderMessageSequence& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderMessageSequence'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.electorTerm()); + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderMessageSequence& lhs, - const LeaderMessageSequence& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderMessageSequence& lhs, - const LeaderMessageSequence& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderMessageSequence& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderMessageSequence`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderMessageSequence& object); - } // close package namespace // TRAITS @@ -4096,10 +4025,11 @@ namespace bmqp_ctrlmsg { // class LeaderPassive // =================== -/// This type represents a particular type of cluster issue whereby the -/// leader is seen as passive by a follower node, resulting in invalid -/// cluster state. class LeaderPassive { + // This type represents a particular type of cluster issue whereby the + // leader is seen as passive by a follower node, resulting in invalid + // cluster state. + // INSTANCE DATA public: @@ -4111,153 +4041,127 @@ class LeaderPassive { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `LeaderPassive` having the default value. - LeaderPassive(); - - /// Create an object of type `LeaderPassive` having the value of the - /// specified `original` object. - LeaderPassive(const LeaderPassive& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderPassive` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderPassive(LeaderPassive&& original) = default; -#endif - - /// Destroy this object. - ~LeaderPassive(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderPassive& operator=(const LeaderPassive& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderPassive& operator=(LeaderPassive&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderPassive&, const LeaderPassive&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const LeaderPassive& lhs, const LeaderPassive& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderPassive& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const LeaderPassive&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderPassive'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderPassive& lhs, const LeaderPassive& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderPassive& lhs, const LeaderPassive& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderPassive& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderPassive`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderPassive& object); - } // close package namespace // TRAITS @@ -4270,10 +4174,11 @@ namespace bmqp_ctrlmsg { // class LeaderSyncDataQuery // ========================= -/// This type represents a request sent by current leader to a follower to -/// ask follower to send the leader its partition/primary mapping and queue -/// information. class LeaderSyncDataQuery { + // This type represents a request sent by current leader to a follower to + // ask follower to send the leader its partition/primary mapping and queue + // information. + // INSTANCE DATA public: @@ -4285,156 +4190,129 @@ class LeaderSyncDataQuery { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `LeaderSyncDataQuery` having the default - /// value. - LeaderSyncDataQuery(); - - /// Create an object of type `LeaderSyncDataQuery` having the value of - /// the specified `original` object. - LeaderSyncDataQuery(const LeaderSyncDataQuery& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderSyncDataQuery` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderSyncDataQuery(LeaderSyncDataQuery&& original) = default; -#endif - - /// Destroy this object. - ~LeaderSyncDataQuery(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderSyncDataQuery& operator=(const LeaderSyncDataQuery& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderSyncDataQuery& operator=(LeaderSyncDataQuery&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderSyncDataQuery&, + const LeaderSyncDataQuery&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const LeaderSyncDataQuery& lhs, + const LeaderSyncDataQuery& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderSyncDataQuery& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const LeaderSyncDataQuery&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderSyncDataQuery'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderSyncDataQuery& lhs, - const LeaderSyncDataQuery& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderSyncDataQuery& lhs, - const LeaderSyncDataQuery& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderSyncDataQuery& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderSyncDataQuery`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncDataQuery& object); - } // close package namespace // TRAITS @@ -4448,9 +4326,10 @@ namespace bmqp_ctrlmsg { // class LeaderSyncStateQuery // ========================== -/// This type represents a request sent by current leader to a follower to -/// query follower's view of the cluster state maintained by the leader. class LeaderSyncStateQuery { + // This type represents a request sent by current leader to a follower to + // query follower's view of the cluster state maintained by the leader. + // INSTANCE DATA public: @@ -4462,156 +4341,129 @@ class LeaderSyncStateQuery { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `LeaderSyncStateQuery` having the default - /// value. - LeaderSyncStateQuery(); - - /// Create an object of type `LeaderSyncStateQuery` having the value of - /// the specified `original` object. - LeaderSyncStateQuery(const LeaderSyncStateQuery& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderSyncStateQuery` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderSyncStateQuery(LeaderSyncStateQuery&& original) = default; -#endif - - /// Destroy this object. - ~LeaderSyncStateQuery(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderSyncStateQuery& operator=(const LeaderSyncStateQuery& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderSyncStateQuery& operator=(LeaderSyncStateQuery&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderSyncStateQuery&, + const LeaderSyncStateQuery&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const LeaderSyncStateQuery& lhs, + const LeaderSyncStateQuery& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderSyncStateQuery& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const LeaderSyncStateQuery&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderSyncStateQuery'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderSyncStateQuery& lhs, - const LeaderSyncStateQuery& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderSyncStateQuery& lhs, - const LeaderSyncStateQuery& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderSyncStateQuery& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderSyncStateQuery`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncStateQuery& object); - } // close package namespace // TRAITS @@ -4625,9 +4477,10 @@ namespace bmqp_ctrlmsg { // class LeadershipCessionNotification // =================================== -/// This type represents a notification signalling cession of leadership -/// from the leader node in the BMQ leader election algorithm. class LeadershipCessionNotification { + // This type represents a notification signalling cession of leadership + // from the leader node in the BlazingMQ leader election algorithm. + // INSTANCE DATA public: @@ -4639,161 +4492,130 @@ class LeadershipCessionNotification { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `LeadershipCessionNotification` having the - /// default value. - LeadershipCessionNotification(); - - /// Create an object of type `LeadershipCessionNotification` having the - /// value of the specified `original` object. - LeadershipCessionNotification( - const LeadershipCessionNotification& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeadershipCessionNotification` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. - LeadershipCessionNotification(LeadershipCessionNotification&& original) = - default; -#endif - - /// Destroy this object. - ~LeadershipCessionNotification(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeadershipCessionNotification& - operator=(const LeadershipCessionNotification& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeadershipCessionNotification& - operator=(LeadershipCessionNotification&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). - void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const LeadershipCessionNotification&, + const LeadershipCessionNotification&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const LeadershipCessionNotification& lhs, + const LeadershipCessionNotification& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeadershipCessionNotification& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, + const LeadershipCessionNotification&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeadershipCessionNotification'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeadershipCessionNotification& lhs, - const LeadershipCessionNotification& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeadershipCessionNotification& lhs, - const LeadershipCessionNotification& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeadershipCessionNotification& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeadershipCessionNotification`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeadershipCessionNotification& object); - } // close package namespace // TRAITS @@ -4807,8 +4629,9 @@ namespace bmqp_ctrlmsg { // class NodeStatus // ================ -/// Enumeration of the various node states. struct NodeStatus { + // Enumeration of the various node states. + public: // TYPES enum Value { @@ -4827,40 +4650,41 @@ struct NodeStatus { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, NodeStatus::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return NodeStatus::print(stream, rhs); + } +}; } // close package namespace @@ -4874,13 +4698,18 @@ namespace bmqp_ctrlmsg { // class PartitionPrimaryInfo // ========================== -/// This type represents the details of parition->primary node mapping. class PartitionPrimaryInfo { + // This type represents the details of parition->primary node mapping. + // INSTANCE DATA unsigned int d_primaryLeaseId; int d_partitionId; int d_primaryNodeId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -4904,180 +4733,158 @@ class PartitionPrimaryInfo { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionPrimaryInfo` having the default - /// value. PartitionPrimaryInfo(); - - /// Create an object of type `PartitionPrimaryInfo` having the value of - /// the specified `original` object. - PartitionPrimaryInfo(const PartitionPrimaryInfo& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionPrimaryInfo` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - PartitionPrimaryInfo(PartitionPrimaryInfo&& original) = default; -#endif - - /// Destroy this object. - ~PartitionPrimaryInfo(); + // Create an object of type 'PartitionPrimaryInfo' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionPrimaryInfo& operator=(const PartitionPrimaryInfo& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionPrimaryInfo& operator=(PartitionPrimaryInfo&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "PrimaryNodeId" attribute of - /// this object. int& primaryNodeId(); + // Return a reference to the modifiable "PrimaryNodeId" attribute of + // this object. - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryNodeId" attribute - /// of this object. int primaryNodeId() const; + // Return the value of the "PrimaryNodeId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionPrimaryInfo& lhs, + const PartitionPrimaryInfo& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.primaryNodeId() == rhs.primaryNodeId() && + lhs.primaryLeaseId() == rhs.primaryLeaseId(); + } + + friend bool operator!=(const PartitionPrimaryInfo& lhs, + const PartitionPrimaryInfo& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionPrimaryInfo& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionPrimaryInfo& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionPrimaryInfo'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionPrimaryInfo& lhs, - const PartitionPrimaryInfo& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionPrimaryInfo& lhs, - const PartitionPrimaryInfo& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionPrimaryInfo& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionPrimaryInfo`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionPrimaryInfo& object); - } // close package namespace // TRAITS @@ -5091,8 +4898,9 @@ namespace bmqp_ctrlmsg { // class PartitionSequenceNumber // ============================= -/// This type represents the logical sequence number in a partition. class PartitionSequenceNumber { + // This type represents the logical sequence number in a partition. + // INSTANCE DATA bsls::Types::Uint64 d_sequenceNumber; unsigned int d_primaryLeaseId; @@ -5118,173 +4926,152 @@ class PartitionSequenceNumber { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionSequenceNumber` having the - /// default value. PartitionSequenceNumber(); - - /// Create an object of type `PartitionSequenceNumber` having the value - /// of the specified `original` object. - PartitionSequenceNumber(const PartitionSequenceNumber& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionSequenceNumber` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. - PartitionSequenceNumber(PartitionSequenceNumber&& original) = default; -#endif - - /// Destroy this object. - ~PartitionSequenceNumber(); + // Create an object of type 'PartitionSequenceNumber' having the + // default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionSequenceNumber& operator=(const PartitionSequenceNumber& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionSequenceNumber& operator=(PartitionSequenceNumber&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. bsls::Types::Uint64& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. bsls::Types::Uint64 sequenceNumber() const; + // Return the value of the "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionSequenceNumber& lhs, + const PartitionSequenceNumber& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.primaryLeaseId() == rhs.primaryLeaseId() && + lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const PartitionSequenceNumber& lhs, + const PartitionSequenceNumber& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionSequenceNumber& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionSequenceNumber& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionSequenceNumber'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.primaryLeaseId()); + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionSequenceNumber& lhs, - const PartitionSequenceNumber& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionSequenceNumber& lhs, - const PartitionSequenceNumber& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionSequenceNumber& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionSequenceNumber`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSequenceNumber& object); - } // close package namespace // TRAITS @@ -5298,15 +5085,20 @@ namespace bmqp_ctrlmsg { // class PartitionSyncDataQueryResponse // ==================================== -/// This type represents a message sent by a peer node to the new primary in -/// response to PartitionSyncDataQuery. -/// partitionId....: The corresponding partitionId class PartitionSyncDataQueryResponse { + // This type represents a message sent by a peer node to the new primary in + // response to PartitionSyncDataQuery. + // partitionId....: The corresponding partitionId + // INSTANCE DATA bsls::Types::Uint64 d_endSequenceNum; unsigned int d_endPrimaryLeaseId; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -5330,185 +5122,159 @@ class PartitionSyncDataQueryResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionSyncDataQueryResponse` having the - /// default value. PartitionSyncDataQueryResponse(); - - /// Create an object of type `PartitionSyncDataQueryResponse` having the - /// value of the specified `original` object. - PartitionSyncDataQueryResponse( - const PartitionSyncDataQueryResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionSyncDataQueryResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. - PartitionSyncDataQueryResponse(PartitionSyncDataQueryResponse&& original) = - default; -#endif - - /// Destroy this object. - ~PartitionSyncDataQueryResponse(); + // Create an object of type 'PartitionSyncDataQueryResponse' having the + // default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionSyncDataQueryResponse& - operator=(const PartitionSyncDataQueryResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionSyncDataQueryResponse& - operator=(PartitionSyncDataQueryResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "EndPrimaryLeaseId" attribute - /// of this object. unsigned int& endPrimaryLeaseId(); + // Return a reference to the modifiable "EndPrimaryLeaseId" attribute + // of this object. - /// Return a reference to the modifiable "EndSequenceNum" attribute of - /// this object. bsls::Types::Uint64& endSequenceNum(); + // Return a reference to the modifiable "EndSequenceNum" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "EndPrimaryLeaseId" - /// attribute of this object. unsigned int endPrimaryLeaseId() const; + // Return the value of the "EndPrimaryLeaseId" attribute of this + // object. - /// Return a reference to the non-modifiable "EndSequenceNum" attribute - /// of this object. bsls::Types::Uint64 endSequenceNum() const; + // Return the value of the "EndSequenceNum" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionSyncDataQueryResponse& lhs, + const PartitionSyncDataQueryResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.endPrimaryLeaseId() == rhs.endPrimaryLeaseId() && + lhs.endSequenceNum() == rhs.endSequenceNum(); + } + + friend bool operator!=(const PartitionSyncDataQueryResponse& lhs, + const PartitionSyncDataQueryResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionSyncDataQueryResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionSyncDataQueryResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionSyncDataQueryResponse'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionSyncDataQueryResponse& lhs, - const PartitionSyncDataQueryResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionSyncDataQueryResponse& lhs, - const PartitionSyncDataQueryResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionSyncDataQueryResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionSyncDataQueryResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& object); - } // close package namespace // TRAITS @@ -5522,10 +5288,11 @@ namespace bmqp_ctrlmsg { // class PartitionSyncStateQuery // ============================= -/// This type represents a request sent by a new primary node to all its -/// AVAILABLE peers to query their current state for a given partition. -/// partitionId: The corresponding partitionId class PartitionSyncStateQuery { + // This type represents a request sent by a new primary node to all its + // AVAILABLE peers to query their current state for a given partition. + // partitionId: The corresponding partitionId + // INSTANCE DATA int d_partitionId; @@ -5546,165 +5313,143 @@ class PartitionSyncStateQuery { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionSyncStateQuery` having the - /// default value. PartitionSyncStateQuery(); - - /// Create an object of type `PartitionSyncStateQuery` having the value - /// of the specified `original` object. - PartitionSyncStateQuery(const PartitionSyncStateQuery& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionSyncStateQuery` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. - PartitionSyncStateQuery(PartitionSyncStateQuery&& original) = default; -#endif - - /// Destroy this object. - ~PartitionSyncStateQuery(); + // Create an object of type 'PartitionSyncStateQuery' having the + // default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionSyncStateQuery& operator=(const PartitionSyncStateQuery& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionSyncStateQuery& operator=(PartitionSyncStateQuery&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionSyncStateQuery& lhs, + const PartitionSyncStateQuery& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId(); + } + + friend bool operator!=(const PartitionSyncStateQuery& lhs, + const PartitionSyncStateQuery& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionSyncStateQuery& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionSyncStateQuery& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionSyncStateQuery'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.partitionId()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionSyncStateQuery& lhs, - const PartitionSyncStateQuery& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionSyncStateQuery& lhs, - const PartitionSyncStateQuery& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionSyncStateQuery& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionSyncStateQuery`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncStateQuery& object); - } // close package namespace // TRAITS @@ -5718,8 +5463,9 @@ namespace bmqp_ctrlmsg { // class PrimaryStatus // =================== -/// Enumeration of the various primary status. struct PrimaryStatus { + // Enumeration of the various primary status. + public: // TYPES enum Value { E_UNDEFINED = 0, E_PASSIVE = 1, E_ACTIVE = 5 }; @@ -5732,41 +5478,41 @@ struct PrimaryStatus { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - PrimaryStatus::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return PrimaryStatus::print(stream, rhs); + } +}; } // close package namespace @@ -5780,9 +5526,10 @@ namespace bmqp_ctrlmsg { // class QueueAssignmentRequest // ============================ -/// This type represents a request, sent to the leader, to assign the queue -/// with the specified `queueUri`. class QueueAssignmentRequest { + // This type represents a request, sent to the leader, to assign the queue + // with the specified 'queueUri'. + // INSTANCE DATA bsl::string d_queueUri; @@ -5801,179 +5548,185 @@ class QueueAssignmentRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueAssignmentRequest` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit QueueAssignmentRequest(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueAssignmentRequest' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `QueueAssignmentRequest` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueAssignmentRequest(const QueueAssignmentRequest& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueAssignmentRequest' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueAssignmentRequest` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. QueueAssignmentRequest(QueueAssignmentRequest&& original) noexcept; + // Create an object of type 'QueueAssignmentRequest' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `QueueAssignmentRequest` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. QueueAssignmentRequest(QueueAssignmentRequest&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueAssignmentRequest' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~QueueAssignmentRequest(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueAssignmentRequest& operator=(const QueueAssignmentRequest& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueAssignmentRequest& operator=(QueueAssignmentRequest&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "QueueUri" attribute of this - /// object. bsl::string& queueUri(); + // Return a reference to the modifiable "QueueUri" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "QueueUri" attribute of - /// this object. const bsl::string& queueUri() const; + // Return a reference offering non-modifiable access to the "QueueUri" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueAssignmentRequest& lhs, + const QueueAssignmentRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.queueUri() == rhs.queueUri(); + } + + friend bool operator!=(const QueueAssignmentRequest& lhs, + const QueueAssignmentRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueAssignmentRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueAssignmentRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueAssignmentRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.queueUri()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueAssignmentRequest& lhs, - const QueueAssignmentRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueAssignmentRequest& lhs, - const QueueAssignmentRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueAssignmentRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueAssignmentRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueAssignmentRequest& object); - } // close package namespace // TRAITS @@ -5987,14 +5740,19 @@ namespace bmqp_ctrlmsg { // class QueueUnassignmentRequest // ============================== -/// This type represents a request, sent to the leader, to unassign the -/// queue with the specified `queueUri`. class QueueUnassignmentRequest { + // This type represents a request, sent to the leader, to unassign the + // queue with the specified 'queueUri'. + // INSTANCE DATA bsl::vector d_queueKey; bsl::string d_queueUri; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -6018,195 +5776,201 @@ class QueueUnassignmentRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueUnassignmentRequest` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit QueueUnassignmentRequest(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUnassignmentRequest' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `QueueUnassignmentRequest` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueUnassignmentRequest(const QueueUnassignmentRequest& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUnassignmentRequest' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueUnassignmentRequest` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. QueueUnassignmentRequest(QueueUnassignmentRequest&& original) noexcept; + // Create an object of type 'QueueUnassignmentRequest' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `QueueUnassignmentRequest` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. QueueUnassignmentRequest(QueueUnassignmentRequest&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueUnassignmentRequest' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~QueueUnassignmentRequest(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueUnassignmentRequest& operator=(const QueueUnassignmentRequest& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueUnassignmentRequest& operator=(QueueUnassignmentRequest&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "QueueUri" attribute of this - /// object. bsl::string& queueUri(); + // Return a reference to the modifiable "QueueUri" attribute of this + // object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "QueueKey" attribute of this - /// object. bsl::vector& queueKey(); + // Return a reference to the modifiable "QueueKey" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "QueueUri" attribute of - /// this object. const bsl::string& queueUri() const; + // Return a reference offering non-modifiable access to the "QueueUri" + // attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "QueueKey" attribute of - /// this object. const bsl::vector& queueKey() const; + // Return a reference offering non-modifiable access to the "QueueKey" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueUnassignmentRequest& lhs, + const QueueUnassignmentRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.queueUri() == rhs.queueUri() && + lhs.partitionId() == rhs.partitionId() && + lhs.queueKey() == rhs.queueKey(); + } + + friend bool operator!=(const QueueUnassignmentRequest& lhs, + const QueueUnassignmentRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueUnassignmentRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueUnassignmentRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueUnassignmentRequest'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueUnassignmentRequest& lhs, - const QueueUnassignmentRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueUnassignmentRequest& lhs, - const QueueUnassignmentRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueUnassignmentRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueUnassignmentRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUnassignmentRequest& object); - } // close package namespace // TRAITS @@ -6220,9 +5984,10 @@ namespace bmqp_ctrlmsg { // class RegistrationResponse // ========================== -/// This type represents a response to the `RegistrationRequest` sent by the -/// leader to a follower. class RegistrationResponse { + // This type represents a response to the 'RegistrationRequest' sent by the + // leader to a follower. + // INSTANCE DATA public: @@ -6234,156 +5999,129 @@ class RegistrationResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `RegistrationResponse` having the default - /// value. - RegistrationResponse(); - - /// Create an object of type `RegistrationResponse` having the value of - /// the specified `original` object. - RegistrationResponse(const RegistrationResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `RegistrationResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - RegistrationResponse(RegistrationResponse&& original) = default; -#endif - - /// Destroy this object. - ~RegistrationResponse(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - RegistrationResponse& operator=(const RegistrationResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - RegistrationResponse& operator=(RegistrationResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const RegistrationResponse&, + const RegistrationResponse&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const RegistrationResponse& lhs, + const RegistrationResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const RegistrationResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const RegistrationResponse&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'RegistrationResponse'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const RegistrationResponse& lhs, - const RegistrationResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const RegistrationResponse& lhs, - const RegistrationResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const RegistrationResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `RegistrationResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::RegistrationResponse& object); - } // close package namespace // TRAITS @@ -6397,8 +6135,9 @@ namespace bmqp_ctrlmsg { // class ReplicaDataType // ===================== -/// Enumeration of the various replica data request/response types. struct ReplicaDataType { + // Enumeration of the various replica data request/response types. + public: // TYPES enum Value { E_UNKNOWN = 0, E_PULL = 10, E_PUSH = 20, E_DROP = 30 }; @@ -6411,41 +6150,41 @@ struct ReplicaDataType { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -// FREE OPERATORS - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - ReplicaDataType::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return ReplicaDataType::print(stream, rhs); + } +}; } // close package namespace @@ -6459,21 +6198,26 @@ namespace bmqp_ctrlmsg { // class ReverseConnectionRequest // ============================== -/// This negotiation message is used as the first message exchanged in the -/// case of reverse connection: the `connecting` out peer sends that message -/// once the connection is established, indicating to the remote peer that -/// it should use this connection as the communication channel for the -/// `clusterNodeId` of the `clusterName`. -/// protocolVersion...: protocol version used by this broker -/// clusterName.......: the name of the cluster this connection is about -/// clusterNodeId.....: the nodeId of the node in that cluster (note that -/// the -1 default corresponds to `mqbnet::Cluster::k_INVALID_NODE_ID`). class ReverseConnectionRequest { + // This negotiation message is used as the first message exchanged in the + // case of reverse connection: the 'connecting' out peer sends that message + // once the connection is established, indicating to the remote peer that + // it should use this connection as the communication channel for the + // 'clusterNodeId' of the 'clusterName'. + // protocolVersion...: protocol version used by this broker + // clusterName.......: the name of the cluster this connection is about + // clusterNodeId.....: the nodeId of the node in that cluster (note that + // the -1 default corresponds to 'mqbnet::Cluster::k_INVALID_NODE_ID'). + // INSTANCE DATA bsl::string d_clusterName; int d_protocolVersion; int d_clusterNodeId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -6501,195 +6245,200 @@ class ReverseConnectionRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ReverseConnectionRequest` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit ReverseConnectionRequest(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ReverseConnectionRequest' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `ReverseConnectionRequest` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ReverseConnectionRequest(const ReverseConnectionRequest& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ReverseConnectionRequest' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ReverseConnectionRequest` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. ReverseConnectionRequest(ReverseConnectionRequest&& original) noexcept; + // Create an object of type 'ReverseConnectionRequest' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `ReverseConnectionRequest` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. ReverseConnectionRequest(ReverseConnectionRequest&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ReverseConnectionRequest' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~ReverseConnectionRequest(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ReverseConnectionRequest& operator=(const ReverseConnectionRequest& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ReverseConnectionRequest& operator=(ReverseConnectionRequest&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ProtocolVersion" attribute of - /// this object. int& protocolVersion(); + // Return a reference to the modifiable "ProtocolVersion" attribute of + // this object. - /// Return a reference to the modifiable "ClusterName" attribute of this - /// object. bsl::string& clusterName(); + // Return a reference to the modifiable "ClusterName" attribute of this + // object. - /// Return a reference to the modifiable "ClusterNodeId" attribute of - /// this object. int& clusterNodeId(); + // Return a reference to the modifiable "ClusterNodeId" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ProtocolVersion" attribute - /// of this object. int protocolVersion() const; + // Return the value of the "ProtocolVersion" attribute of this object. - /// Return a reference to the non-modifiable "ClusterName" attribute of - /// this object. const bsl::string& clusterName() const; + // Return a reference offering non-modifiable access to the + // "ClusterName" attribute of this object. - /// Return a reference to the non-modifiable "ClusterNodeId" attribute - /// of this object. int clusterNodeId() const; + // Return the value of the "ClusterNodeId" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ReverseConnectionRequest& lhs, + const ReverseConnectionRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.protocolVersion() == rhs.protocolVersion() && + lhs.clusterName() == rhs.clusterName() && + lhs.clusterNodeId() == rhs.clusterNodeId(); + } + + friend bool operator!=(const ReverseConnectionRequest& lhs, + const ReverseConnectionRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ReverseConnectionRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ReverseConnectionRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ReverseConnectionRequest'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ReverseConnectionRequest& lhs, - const ReverseConnectionRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ReverseConnectionRequest& lhs, - const ReverseConnectionRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ReverseConnectionRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ReverseConnectionRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReverseConnectionRequest& object); - } // close package namespace // TRAITS @@ -6703,15 +6452,15 @@ namespace bmqp_ctrlmsg { // class RoutingConfiguration // ========================== -/// This complex type contains various attributes required by the downstream -/// node to route messages to the consumers attached to it. -/// flags.: Flags representing the routing configuration class RoutingConfiguration { - // INSTANCE DATA + // This complex type contains various attributes required by the downstream + // node to route messages to the consumers attached to it. + // flags.: Flags representing the routing configuration - // This is an unsigned representation with flag bits specified on the - // `RoutingConfigurationFlags` type. + // INSTANCE DATA bsls::Types::Uint64 d_flags; + // This is an unsigned representation with flag bits specified on the + // 'RoutingConfigurationFlags' type. public: // TYPES @@ -6728,164 +6477,143 @@ class RoutingConfiguration { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `RoutingConfiguration` having the default - /// value. RoutingConfiguration(); - - /// Create an object of type `RoutingConfiguration` having the value of - /// the specified `original` object. - RoutingConfiguration(const RoutingConfiguration& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `RoutingConfiguration` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - RoutingConfiguration(RoutingConfiguration&& original) = default; -#endif - - /// Destroy this object. - ~RoutingConfiguration(); + // Create an object of type 'RoutingConfiguration' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - RoutingConfiguration& operator=(const RoutingConfiguration& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - RoutingConfiguration& operator=(RoutingConfiguration&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Flags" attribute of this - /// object. bsls::Types::Uint64& flags(); + // Return a reference to the modifiable "Flags" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Flags" attribute of this - /// object. bsls::Types::Uint64 flags() const; + // Return the value of the "Flags" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const RoutingConfiguration& lhs, + const RoutingConfiguration& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.flags() == rhs.flags(); + } + + friend bool operator!=(const RoutingConfiguration& lhs, + const RoutingConfiguration& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const RoutingConfiguration& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const RoutingConfiguration& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'RoutingConfiguration'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.flags()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const RoutingConfiguration& lhs, - const RoutingConfiguration& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const RoutingConfiguration& lhs, - const RoutingConfiguration& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const RoutingConfiguration& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `RoutingConfiguration`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::RoutingConfiguration& object); - } // close package namespace // TRAITS @@ -6899,21 +6627,22 @@ namespace bmqp_ctrlmsg { // class RoutingConfigurationFlags // =============================== -/// This flag encodes configuration on how messages should be routed to -/// downstream consumers. -/// E_AT_MOST_ONCE..............: This indicates that this domain is -/// configured with at-most-once semantics. This in turn means that -/// confirms are optional and acknowledgments (if required) will always be -/// send, even if there's message loss. E_DELIVER_CONSUMER_PRIORITY.: This -/// flag indicates that only downstream consumers having the highest -/// consumer should be considered as available destination for a message. -/// E_DELIVER_ALL...............: This flag indicates that messages should -/// be delivered to all available downstream consumers (after some added -/// filtering based on other flags, such as `E_DELIVER_CONSUMER_PRIORITY`). -/// E_HAS_MULTIPLE_SUB_STREAMS..: This flag indicates that multiple -/// downstream consumers should be considered as available destination for a -/// message. struct RoutingConfigurationFlags { + // This flag encodes configuration on how messages should be routed to + // downstream consumers. + // E_AT_MOST_ONCE..............: This indicates that this domain is + // configured with at-most-once semantics. This in turn means that + // confirms are optional and acknowledgments (if required) will always be + // send, even if there's message loss. E_DELIVER_CONSUMER_PRIORITY.: This + // flag indicates that only downstream consumers having the highest + // consumer should be considered as available destination for a message. + // E_DELIVER_ALL...............: This flag indicates that messages should + // be delivered to all available downstream consumers (after some added + // filtering based on other flags, such as 'E_DELIVER_CONSUMER_PRIORITY'). + // E_HAS_MULTIPLE_SUB_STREAMS..: This flag indicates that multiple + // downstream consumers should be considered as available destination for a + // message. + public: // TYPES enum Value { @@ -6931,41 +6660,41 @@ struct RoutingConfigurationFlags { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; - -// FREE OPERATORS + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - RoutingConfigurationFlags::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return RoutingConfigurationFlags::print(stream, rhs); + } +}; } // close package namespace @@ -6979,10 +6708,11 @@ namespace bmqp_ctrlmsg { // class ScoutingRequest // ===================== -/// This type represents a request sent by a peer node to gauge the interest -/// peer nodes in supporting it, with the term specified in the top level -/// type. class ScoutingRequest { + // This type represents a request sent by a peer node to gauge the interest + // peer nodes in supporting it, with the term specified in the top level + // type. + // INSTANCE DATA public: @@ -6994,153 +6724,128 @@ class ScoutingRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - /// Create an object of type `ScoutingRequest` having the default value. - ScoutingRequest(); - - /// Create an object of type `ScoutingRequest` having the value of the - /// specified `original` object. - ScoutingRequest(const ScoutingRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ScoutingRequest` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ScoutingRequest(ScoutingRequest&& original) = default; -#endif - - /// Destroy this object. - ~ScoutingRequest(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ScoutingRequest& operator=(const ScoutingRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ScoutingRequest& operator=(ScoutingRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + // HIDDEN FRIENDS + friend bool operator==(const ScoutingRequest&, const ScoutingRequest&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const ScoutingRequest& lhs, + const ScoutingRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ScoutingRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const ScoutingRequest&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ScoutingRequest'. + { + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ScoutingRequest& lhs, const ScoutingRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ScoutingRequest& lhs, const ScoutingRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ScoutingRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ScoutingRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ScoutingRequest& object); - } // close package namespace // TRAITS @@ -7153,12 +6858,13 @@ namespace bmqp_ctrlmsg { // class ScoutingResponse // ====================== -/// This type represents a message sent by a peer node as a response to the -/// scouting request from another peer. -/// willVote..: boolean indicating if this peer will support an election -/// proposal from the requester node with the term specified in the top -/// level type. class ScoutingResponse { + // This type represents a message sent by a peer node as a response to the + // scouting request from another peer. + // willVote..: boolean indicating if this peer will support an election + // proposal from the requester node with the term specified in the top + // level type. + // INSTANCE DATA bool d_willVote; @@ -7177,164 +6883,143 @@ class ScoutingResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ScoutingResponse` having the default - /// value. ScoutingResponse(); - - /// Create an object of type `ScoutingResponse` having the value of the - /// specified `original` object. - ScoutingResponse(const ScoutingResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ScoutingResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ScoutingResponse(ScoutingResponse&& original) = default; -#endif - - /// Destroy this object. - ~ScoutingResponse(); + // Create an object of type 'ScoutingResponse' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ScoutingResponse& operator=(const ScoutingResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ScoutingResponse& operator=(ScoutingResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "WillVote" attribute of this - /// object. bool& willVote(); + // Return a reference to the modifiable "WillVote" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "WillVote" attribute of - /// this object. bool willVote() const; + // Return the value of the "WillVote" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ScoutingResponse& lhs, + const ScoutingResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.willVote() == rhs.willVote(); + } + + friend bool operator!=(const ScoutingResponse& lhs, + const ScoutingResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ScoutingResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ScoutingResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ScoutingResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.willVote()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ScoutingResponse& lhs, - const ScoutingResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ScoutingResponse& lhs, - const ScoutingResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ScoutingResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ScoutingResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ScoutingResponse& object); - } // close package namespace // TRAITS @@ -7347,13 +7032,14 @@ namespace bmqp_ctrlmsg { // class StatusCategory // ==================== -/// Enumeration of the various status categories. Some categories (TIMEOUT, -/// CANCELED) should not be sent by the broker, but adding them in that enum -/// will make it possible from the SDK (which could fire those errors in -/// response of a request) to simulate such response from the broker and -/// hence allow to use a single code path for the response handling. ## -/// This enum must remain in sync with `bmqt_resultcode::GenericResult` struct StatusCategory { + // Enumeration of the various status categories. Some categories (TIMEOUT, + // CANCELED) should not be sent by the broker, but adding them in that enum + // will make it possible from the SDK (which could fire those errors in + // response of a request) to simulate such response from the broker and + // hence allow to use a single code path for the response handling. ## + // This enum must remain in sync with 'bmqt_resultcode::GenericResult' + public: // TYPES enum Value { @@ -7376,41 +7062,41 @@ struct StatusCategory { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -// FREE OPERATORS - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - StatusCategory::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return StatusCategory::print(stream, rhs); + } +}; } // close package namespace @@ -7424,9 +7110,10 @@ namespace bmqp_ctrlmsg { // class StopRequest // ================= -/// This type represents a request sent by a cluster member node upon -/// graceful shutdown / going into maintenance mode. class StopRequest { + // This type represents a request sent by a cluster member node upon + // graceful shutdown / going into maintenance mode. + // INSTANCE DATA bsl::string d_clusterName; int d_version; @@ -7448,182 +7135,189 @@ class StopRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StopRequest` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit StopRequest(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'StopRequest' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `StopRequest` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. StopRequest(const StopRequest& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'StopRequest' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StopRequest` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. StopRequest(StopRequest&& original) noexcept; + // Create an object of type 'StopRequest' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `StopRequest` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. StopRequest(StopRequest&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'StopRequest' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~StopRequest(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. StopRequest& operator=(const StopRequest& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. StopRequest& operator=(StopRequest&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ClusterName" attribute of this - /// object. bsl::string& clusterName(); + // Return a reference to the modifiable "ClusterName" attribute of this + // object. - /// Return a reference to the non-modifiable "Version" attribute of this - /// object. int& version(); + // Return a reference to the modifiable "Version" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ClusterName" attribute of - /// this object. const bsl::string& clusterName() const; + // Return a reference offering non-modifiable access to the + // "ClusterName" attribute of this object. - /// Return a reference to the non-modifiable "Version" attribute of this - /// object. int version() const; + // Return the value of the "Version" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StopRequest& lhs, const StopRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.clusterName() == rhs.clusterName() && + lhs.version() == rhs.version(); + } + + friend bool operator!=(const StopRequest& lhs, const StopRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StopRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StopRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'StopRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.clusterName()); + hashAppend(hashAlg, object.version()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const StopRequest& lhs, const StopRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const StopRequest& lhs, const StopRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const StopRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StopRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StopRequest& object); - } // close package namespace // TRAITS @@ -7637,10 +7331,11 @@ namespace bmqp_ctrlmsg { // class StopResponse // ================== -/// This type represents a response sent by a cluster member node or proxy -/// after completing processing stopRequest. -/// clusterName: Must match the one in corresponding stopRequest class StopResponse { + // This type represents a response sent by a cluster member node or proxy + // after completing processing stopRequest. + // clusterName: Must match the one in corresponding stopRequest + // INSTANCE DATA bsl::string d_clusterName; @@ -7659,174 +7354,181 @@ class StopResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StopResponse` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit StopResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'StopResponse' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `StopResponse` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. StopResponse(const StopResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'StopResponse' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StopResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. StopResponse(StopResponse&& original) noexcept; + // Create an object of type 'StopResponse' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `StopResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. StopResponse(StopResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'StopResponse' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~StopResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. StopResponse& operator=(const StopResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. StopResponse& operator=(StopResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ClusterName" attribute of this - /// object. bsl::string& clusterName(); + // Return a reference to the modifiable "ClusterName" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ClusterName" attribute of - /// this object. const bsl::string& clusterName() const; + // Return a reference offering non-modifiable access to the + // "ClusterName" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StopResponse& lhs, const StopResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.clusterName() == rhs.clusterName(); + } + + friend bool operator!=(const StopResponse& lhs, const StopResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StopResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StopResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StopResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.clusterName()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const StopResponse& lhs, const StopResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const StopResponse& lhs, const StopResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const StopResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StopResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StopResponse& object); - } // close package namespace // TRAITS @@ -7840,8 +7542,9 @@ namespace bmqp_ctrlmsg { // class StorageSyncResponseType // ============================= -/// Enumeration of the various categories for storage sync response. struct StorageSyncResponseType { + // Enumeration of the various categories for storage sync response. + public: // TYPES enum Value { @@ -7860,41 +7563,41 @@ struct StorageSyncResponseType { static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]; // CLASS METHODS - - /// Return the string representation exactly matching the enumerator - /// name corresponding to the specified enumeration `value`. static const char* toString(Value value); + // Return the string representation exactly matching the enumerator + // name corresponding to the specified enumeration 'value'. - /// Load into the specified `result` the enumerator matching the - /// specified `string` of the specified `stringLength`. Return 0 on - /// success, and a non-zero value with no effect on `result` otherwise - /// (i.e., `string` does not match any enumerator). static int fromString(Value* result, const char* string, int stringLength); + // Load into the specified 'result' the enumerator matching the + // specified 'string' of the specified 'stringLength'. Return 0 on + // success, and a non-zero value with no effect on 'result' otherwise + // (i.e., 'string' does not match any enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `string`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `string` does not match any - /// enumerator). static int fromString(Value* result, const bsl::string& string); + // Load into the specified 'result' the enumerator matching the + // specified 'string'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'string' does not match any + // enumerator). - /// Load into the specified `result` the enumerator matching the - /// specified `number`. Return 0 on success, and a non-zero value with - /// no effect on `result` otherwise (i.e., `number` does not match any - /// enumerator). static int fromInt(Value* result, int number); + // Load into the specified 'result' the enumerator matching the + // specified 'number'. Return 0 on success, and a non-zero value with + // no effect on 'result' otherwise (i.e., 'number' does not match any + // enumerator). - /// Write to the specified `stream` the string representation of - /// the specified enumeration `value`. Return a reference to - /// the modifiable `stream`. static bsl::ostream& print(bsl::ostream& stream, Value value); -}; + // Write to the specified 'stream' the string representation of + // the specified enumeration 'value'. Return a reference to + // the modifiable 'stream'. -// FREE OPERATORS - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - StorageSyncResponseType::Value rhs); + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return StorageSyncResponseType::print(stream, rhs); + } +}; } // close package namespace @@ -7908,11 +7611,12 @@ namespace bmqp_ctrlmsg { // class SubQueueIdInfo // ==================== -/// This complex type contains various attributes which uniquely identify a -/// subQueueId (which typically would represent a fanout consumer). -/// subId.: Id of the subQueue appId.: Application-provided unique string -/// identifier for a given fanout consumer class SubQueueIdInfo { + // This complex type contains various attributes which uniquely identify a + // subQueueId (which typically would represent a fanout consumer). + // subId.: Id of the subQueue appId.: Application-provided unique string + // identifier for a given fanout consumer + // INSTANCE DATA bsl::string d_appId; unsigned int d_subId; @@ -7936,184 +7640,192 @@ class SubQueueIdInfo { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `SubQueueIdInfo` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit SubQueueIdInfo(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'SubQueueIdInfo' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `SubQueueIdInfo` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. SubQueueIdInfo(const SubQueueIdInfo& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'SubQueueIdInfo' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `SubQueueIdInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. SubQueueIdInfo(SubQueueIdInfo&& original) noexcept; + // Create an object of type 'SubQueueIdInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `SubQueueIdInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. SubQueueIdInfo(SubQueueIdInfo&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'SubQueueIdInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~SubQueueIdInfo(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. SubQueueIdInfo& operator=(const SubQueueIdInfo& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. SubQueueIdInfo& operator=(SubQueueIdInfo&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SubId" attribute of this - /// object. unsigned int& subId(); + // Return a reference to the modifiable "SubId" attribute of this + // object. - /// Return a reference to the modifiable "AppId" attribute of this - /// object. bsl::string& appId(); + // Return a reference to the modifiable "AppId" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SubId" attribute of this - /// object. unsigned int subId() const; + // Return the value of the "SubId" attribute of this object. - /// Return a reference to the non-modifiable "AppId" attribute of this - /// object. const bsl::string& appId() const; + // Return a reference offering non-modifiable access to the "AppId" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const SubQueueIdInfo& lhs, + const SubQueueIdInfo& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.subId() == rhs.subId() && lhs.appId() == rhs.appId(); + } + + friend bool operator!=(const SubQueueIdInfo& lhs, + const SubQueueIdInfo& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const SubQueueIdInfo& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const SubQueueIdInfo& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'SubQueueIdInfo'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.subId()); + hashAppend(hashAlg, object.appId()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const SubQueueIdInfo& lhs, const SubQueueIdInfo& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const SubQueueIdInfo& lhs, const SubQueueIdInfo& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const SubQueueIdInfo& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `SubQueueIdInfo`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::SubQueueIdInfo& object); - } // close package namespace // TRAITS @@ -8127,24 +7839,31 @@ namespace bmqp_ctrlmsg { // class SyncPoint // =============== -/// This type represents a `sync point` for a given partition (file store) -/// in the BMQ replicated state machine. Note that sync point is sent as a -/// binary message, not a schema message. This type exists in this schema -/// solely as a convenience for using a generated type instead of writing -/// one by hand. -/// partitionId.............: Id of the applicable partition (file store) -/// primaryLeaseId..........: LeaseId of the sender node (primary for the -/// partition) primaryNodeId...........: NodeId of the sender (primary for -/// the partition) sequenceNum.............: Sequence number of the last -/// message dataFilePositionDwords..: Position of data file when this sync -/// point was issued. class SyncPoint { + // This type represents a 'sync point' for a given partition (file store) + // in the BlazingMQ replicated state machine. Note that sync point is sent + // as a binary message, not a schema message. This type exists in this + // schema solely as a convenience for using a generated type instead of + // writing one by hand. + // partitionId.............: Id of the applicable partition (file store) + // primaryLeaseId..........: LeaseId of the sender node (primary for the + // partition) primaryNodeId...........: NodeId of the sender (primary for + // the partition) sequenceNum.............: Sequence number of the last + // message dataFilePositionDwords..: Position of data file when this sync + // point was issued. + // INSTANCE DATA bsls::Types::Uint64 d_sequenceNum; unsigned int d_primaryLeaseId; unsigned int d_dataFileOffsetDwords; unsigned int d_qlistFileOffsetWords; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const SyncPoint& rhs) const; + public: // TYPES enum { @@ -8170,183 +7889,158 @@ class SyncPoint { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `SyncPoint` having the default value. SyncPoint(); - - /// Create an object of type `SyncPoint` having the value of the - /// specified `original` object. - SyncPoint(const SyncPoint& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `SyncPoint` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - SyncPoint(SyncPoint&& original) = default; -#endif - - /// Destroy this object. - ~SyncPoint(); + // Create an object of type 'SyncPoint' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - SyncPoint& operator=(const SyncPoint& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - SyncPoint& operator=(SyncPoint&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. - /// Return a reference to the modifiable "SequenceNum" attribute of this - /// object. bsls::Types::Uint64& sequenceNum(); + // Return a reference to the modifiable "SequenceNum" attribute of this + // object. - /// Return a reference to the modifiable "DataFileOffsetDwords" - /// attribute of this object. unsigned int& dataFileOffsetDwords(); + // Return a reference to the modifiable "DataFileOffsetDwords" + // attribute of this object. - /// Return a reference to the modifiable "QlistFileOffsetWords" - /// attribute of this object. unsigned int& qlistFileOffsetWords(); + // Return a reference to the modifiable "QlistFileOffsetWords" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNum" attribute of - /// this object. bsls::Types::Uint64 sequenceNum() const; + // Return the value of the "SequenceNum" attribute of this object. - /// Return a reference to the non-modifiable "DataFileOffsetDwords" - /// attribute of this object. unsigned int dataFileOffsetDwords() const; + // Return the value of the "DataFileOffsetDwords" attribute of this + // object. - /// Return a reference to the non-modifiable "QlistFileOffsetWords" - /// attribute of this object. unsigned int qlistFileOffsetWords() const; -}; - -// FREE OPERATORS + // Return the value of the "QlistFileOffsetWords" attribute of this + // object. -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const SyncPoint& lhs, const SyncPoint& rhs); + // HIDDEN FRIENDS + friend bool operator==(const SyncPoint& lhs, const SyncPoint& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const SyncPoint& lhs, const SyncPoint& rhs); + friend bool operator!=(const SyncPoint& lhs, const SyncPoint& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const SyncPoint& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, const SyncPoint& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `SyncPoint`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::SyncPoint& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const SyncPoint& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'SyncPoint'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -8360,27 +8054,28 @@ namespace bmqp_ctrlmsg { // class ClientIdentity // ==================== -/// This represents the `identification` sent by a client to the broker -/// during connection negotiation. -/// protocolVersion...: protocol version used by this client -/// sdkVersion........: version of the SDK used by this client -/// clientType........: type of client trying to connect to the bmqbrkr -/// processName.......: name of the process pid...............: PID of the -/// process sessionId.........: instance count of the session in the task -/// hostName..........: name of the host where the client is running -/// features..........: a space separated list of supported features by the -/// client clusterName.......: used only when `clientType` is `E_TCPBROKER` -/// and contains the name of the Cluster responsible for establishing this -/// inter-broker connectivity; whether this is about a Cluster proxy or a -/// Cluster member. clusterNodeId.....: used only when `clientType` is -/// `E_TCPBROKER` and contains the node id of the broker in that cluster, or -/// -1 if the broker is not part of the cluster (i.e., a -1 value for -/// `clusterNodeId` indicates this connection is about a Cluster proxy; note -/// that this -1 must be equal to `mqbnet::Cluster::k_INVALID_NODE_ID`). -/// sdkLanguage.......: language of the SDK used by this client. -/// guidInfo..........: data provided by bmqp::MessageGUIDGenerator. -/// Contains clientId, current timer tick and number of seconds from epoch. class ClientIdentity { + // This represents the 'identification' sent by a client to the broker + // during connection negotiation. + // protocolVersion...: protocol version used by this client + // sdkVersion........: version of the SDK used by this client + // clientType........: type of client trying to connect to the bmqbrkr + // processName.......: name of the process pid...............: PID of the + // process sessionId.........: instance count of the session in the task + // hostName..........: name of the host where the client is running + // features..........: a space separated list of supported features by the + // client clusterName.......: used only when 'clientType' is 'E_TCPBROKER' + // and contains the name of the Cluster responsible for establishing this + // inter-broker connectivity; whether this is about a Cluster proxy or a + // Cluster member. clusterNodeId.....: used only when 'clientType' is + // 'E_TCPBROKER' and contains the node id of the broker in that cluster, or + // -1 if the broker is not part of the cluster (i.e., a -1 value for + // 'clusterNodeId' indicates this connection is about a Cluster proxy; note + // that this -1 must be equal to 'mqbnet::Cluster::k_INVALID_NODE_ID'). + // sdkLanguage.......: language of the SDK used by this client. + // guidInfo..........: data provided by bmqp::MessageGUIDGenerator. + // Contains clientId, current timer tick and number of seconds from epoch. + // INSTANCE DATA bsl::string d_processName; bsl::string d_hostName; @@ -8395,6 +8090,12 @@ class ClientIdentity { ClientType::Value d_clientType; ClientLanguage::Value d_sdkLanguage; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ClientIdentity& rhs) const; + public: // TYPES enum { @@ -8454,263 +8155,263 @@ class ClientIdentity { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ClientIdentity` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit ClientIdentity(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClientIdentity' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `ClientIdentity` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ClientIdentity(const ClientIdentity& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClientIdentity' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClientIdentity` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ClientIdentity(ClientIdentity&& original) noexcept; + // Create an object of type 'ClientIdentity' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ClientIdentity` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ClientIdentity(ClientIdentity&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ClientIdentity' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ClientIdentity(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ClientIdentity& operator=(const ClientIdentity& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ClientIdentity& operator=(ClientIdentity&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ProtocolVersion" attribute of - /// this object. int& protocolVersion(); + // Return a reference to the modifiable "ProtocolVersion" attribute of + // this object. - /// Return a reference to the modifiable "SdkVersion" attribute of this - /// object. int& sdkVersion(); + // Return a reference to the modifiable "SdkVersion" attribute of this + // object. - /// Return a reference to the modifiable "ClientType" attribute of this - /// object. ClientType::Value& clientType(); + // Return a reference to the modifiable "ClientType" attribute of this + // object. - /// Return a reference to the modifiable "ProcessName" attribute of this - /// object. bsl::string& processName(); + // Return a reference to the modifiable "ProcessName" attribute of this + // object. - /// Return a reference to the modifiable "Pid" attribute of this object. int& pid(); + // Return a reference to the modifiable "Pid" attribute of this object. - /// Return a reference to the modifiable "SessionId" attribute of this - /// object. int& sessionId(); + // Return a reference to the modifiable "SessionId" attribute of this + // object. - /// Return a reference to the modifiable "HostName" attribute of this - /// object. bsl::string& hostName(); + // Return a reference to the modifiable "HostName" attribute of this + // object. - /// Return a reference to the modifiable "Features" attribute of this - /// object. bsl::string& features(); + // Return a reference to the modifiable "Features" attribute of this + // object. - /// Return a reference to the modifiable "ClusterName" attribute of this - /// object. bsl::string& clusterName(); + // Return a reference to the modifiable "ClusterName" attribute of this + // object. - /// Return a reference to the modifiable "ClusterNodeId" attribute of - /// this object. int& clusterNodeId(); + // Return a reference to the modifiable "ClusterNodeId" attribute of + // this object. - /// Return a reference to the modifiable "SdkLanguage" attribute of this - /// object. ClientLanguage::Value& sdkLanguage(); + // Return a reference to the modifiable "SdkLanguage" attribute of this + // object. - /// Return a reference to the modifiable "GuidInfo" attribute of this - /// object. GuidInfo& guidInfo(); + // Return a reference to the modifiable "GuidInfo" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ProtocolVersion" attribute - /// of this object. int protocolVersion() const; + // Return the value of the "ProtocolVersion" attribute of this object. - /// Return a reference to the non-modifiable "SdkVersion" attribute of - /// this object. int sdkVersion() const; + // Return the value of the "SdkVersion" attribute of this object. - /// Return a reference to the non-modifiable "ClientType" attribute of - /// this object. ClientType::Value clientType() const; + // Return the value of the "ClientType" attribute of this object. - /// Return a reference to the non-modifiable "ProcessName" attribute of - /// this object. const bsl::string& processName() const; + // Return a reference offering non-modifiable access to the + // "ProcessName" attribute of this object. - /// Return a reference to the non-modifiable "Pid" attribute of this - /// object. int pid() const; + // Return the value of the "Pid" attribute of this object. - /// Return a reference to the non-modifiable "SessionId" attribute of - /// this object. int sessionId() const; + // Return the value of the "SessionId" attribute of this object. - /// Return a reference to the non-modifiable "HostName" attribute of - /// this object. const bsl::string& hostName() const; + // Return a reference offering non-modifiable access to the "HostName" + // attribute of this object. - /// Return a reference to the non-modifiable "Features" attribute of - /// this object. const bsl::string& features() const; + // Return a reference offering non-modifiable access to the "Features" + // attribute of this object. - /// Return a reference to the non-modifiable "ClusterName" attribute of - /// this object. const bsl::string& clusterName() const; + // Return a reference offering non-modifiable access to the + // "ClusterName" attribute of this object. - /// Return a reference to the non-modifiable "ClusterNodeId" attribute - /// of this object. int clusterNodeId() const; + // Return the value of the "ClusterNodeId" attribute of this object. - /// Return a reference to the non-modifiable "SdkLanguage" attribute of - /// this object. ClientLanguage::Value sdkLanguage() const; + // Return the value of the "SdkLanguage" attribute of this object. - /// Return a reference to the non-modifiable "GuidInfo" attribute of - /// this object. const GuidInfo& guidInfo() const; + // Return a reference offering non-modifiable access to the "GuidInfo" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ClientIdentity& lhs, + const ClientIdentity& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ClientIdentity& lhs, + const ClientIdentity& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClientIdentity& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ClientIdentity& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClientIdentity'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ClientIdentity& lhs, const ClientIdentity& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ClientIdentity& lhs, const ClientIdentity& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClientIdentity& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClientIdentity`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClientIdentity& object); - } // close package namespace // TRAITS @@ -8730,6 +8431,10 @@ class DumpMessages { DumpMsgType::Value d_msgTypeToDump; DumpActionType::Value d_dumpActionType; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -8755,176 +8460,155 @@ class DumpMessages { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `DumpMessages` having the default value. DumpMessages(); - - /// Create an object of type `DumpMessages` having the value of the - /// specified `original` object. - DumpMessages(const DumpMessages& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `DumpMessages` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - DumpMessages(DumpMessages&& original) = default; -#endif - - /// Destroy this object. - ~DumpMessages(); + // Create an object of type 'DumpMessages' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - DumpMessages& operator=(const DumpMessages& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - DumpMessages& operator=(DumpMessages&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "MsgTypeToDump" attribute of - /// this object. DumpMsgType::Value& msgTypeToDump(); + // Return a reference to the modifiable "MsgTypeToDump" attribute of + // this object. - /// Return a reference to the modifiable "DumpActionType" attribute of - /// this object. DumpActionType::Value& dumpActionType(); + // Return a reference to the modifiable "DumpActionType" attribute of + // this object. - /// Return a reference to the modifiable "DumpActionValue" attribute of - /// this object. int& dumpActionValue(); + // Return a reference to the modifiable "DumpActionValue" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "MsgTypeToDump" attribute - /// of this object. DumpMsgType::Value msgTypeToDump() const; + // Return the value of the "MsgTypeToDump" attribute of this object. - /// Return a reference to the non-modifiable "DumpActionType" attribute - /// of this object. DumpActionType::Value dumpActionType() const; + // Return the value of the "DumpActionType" attribute of this object. - /// Return a reference to the non-modifiable "DumpActionValue" attribute - /// of this object. int dumpActionValue() const; + // Return the value of the "DumpActionValue" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const DumpMessages& lhs, const DumpMessages& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.msgTypeToDump() == rhs.msgTypeToDump() && + lhs.dumpActionType() == rhs.dumpActionType() && + lhs.dumpActionValue() == rhs.dumpActionValue(); + } + + friend bool operator!=(const DumpMessages& lhs, const DumpMessages& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DumpMessages& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const DumpMessages& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DumpMessages'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const DumpMessages& lhs, const DumpMessages& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const DumpMessages& lhs, const DumpMessages& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const DumpMessages& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `DumpMessages`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::DumpMessages& object); - } // close package namespace // TRAITS @@ -8953,6 +8637,12 @@ class ElectorMessageChoice { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ElectorMessageChoice& rhs) const; + public: // TYPES @@ -8987,65 +8677,62 @@ class ElectorMessageChoice { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ElectorMessageChoice` having the default - /// value. ElectorMessageChoice(); + // Create an object of type 'ElectorMessageChoice' having the default + // value. - /// Create an object of type `ElectorMessageChoice` having the value of - /// the specified `original` object. ElectorMessageChoice(const ElectorMessageChoice& original); + // Create an object of type 'ElectorMessageChoice' having the value of + // the specified 'original' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ElectorMessageChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ElectorMessageChoice(ElectorMessageChoice&& original) noexcept; + // Create an object of type 'ElectorMessageChoice' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. #endif - /// Destroy this object. ~ElectorMessageChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ElectorMessageChoice& operator=(const ElectorMessageChoice& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ElectorMessageChoice& operator=(ElectorMessageChoice&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). ElectionProposal& makeElectionProposal(); ElectionProposal& makeElectionProposal(const ElectionProposal& value); @@ -9135,204 +8822,216 @@ class ElectorMessageChoice { // "LeadershipCessionNotification". If 'value' is not specified, the // default "LeadershipCessionNotification" value is used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "ElectionProposal" selection of - /// this object if "ElectionProposal" is the current selection. The - /// behavior is undefined unless "ElectionProposal" is the selection of - /// this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + ElectionProposal& electionProposal(); + // Return a reference to the modifiable "ElectionProposal" selection of + // this object if "ElectionProposal" is the current selection. The + // behavior is undefined unless "ElectionProposal" is the selection of + // this object. - /// Return a reference to the modifiable "ElectionResponse" selection of - /// this object if "ElectionResponse" is the current selection. The - /// behavior is undefined unless "ElectionResponse" is the selection of - /// this object. ElectionResponse& electionResponse(); + // Return a reference to the modifiable "ElectionResponse" selection of + // this object if "ElectionResponse" is the current selection. The + // behavior is undefined unless "ElectionResponse" is the selection of + // this object. - /// Return a reference to the modifiable "LeaderHeartbeat" selection of - /// this object if "LeaderHeartbeat" is the current selection. The - /// behavior is undefined unless "LeaderHeartbeat" is the selection of - /// this object. LeaderHeartbeat& leaderHeartbeat(); + // Return a reference to the modifiable "LeaderHeartbeat" selection of + // this object if "LeaderHeartbeat" is the current selection. The + // behavior is undefined unless "LeaderHeartbeat" is the selection of + // this object. - /// Return a reference to the modifiable "ElectorNodeStatus" selection - /// of this object if "ElectorNodeStatus" is the current selection. The - /// behavior is undefined unless "ElectorNodeStatus" is the selection of - /// this object. ElectorNodeStatus& electorNodeStatus(); + // Return a reference to the modifiable "ElectorNodeStatus" selection + // of this object if "ElectorNodeStatus" is the current selection. The + // behavior is undefined unless "ElectorNodeStatus" is the selection of + // this object. - /// Return a reference to the modifiable "HeartbeatResponse" selection - /// of this object if "HeartbeatResponse" is the current selection. The - /// behavior is undefined unless "HeartbeatResponse" is the selection of - /// this object. HeartbeatResponse& heartbeatResponse(); + // Return a reference to the modifiable "HeartbeatResponse" selection + // of this object if "HeartbeatResponse" is the current selection. The + // behavior is undefined unless "HeartbeatResponse" is the selection of + // this object. - /// Return a reference to the modifiable "ScoutingRequest" selection of - /// this object if "ScoutingRequest" is the current selection. The - /// behavior is undefined unless "ScoutingRequest" is the selection of - /// this object. ScoutingRequest& scoutingRequest(); + // Return a reference to the modifiable "ScoutingRequest" selection of + // this object if "ScoutingRequest" is the current selection. The + // behavior is undefined unless "ScoutingRequest" is the selection of + // this object. - /// Return a reference to the modifiable "ScoutingResponse" selection of - /// this object if "ScoutingResponse" is the current selection. The - /// behavior is undefined unless "ScoutingResponse" is the selection of - /// this object. ScoutingResponse& scoutingResponse(); + // Return a reference to the modifiable "ScoutingResponse" selection of + // this object if "ScoutingResponse" is the current selection. The + // behavior is undefined unless "ScoutingResponse" is the selection of + // this object. - /// Return a reference to the modifiable "LeadershipCessionNotification" - /// selection of this object if "LeadershipCessionNotification" is the - /// current selection. The behavior is undefined unless - /// "LeadershipCessionNotification" is the selection of this object. LeadershipCessionNotification& leadershipCessionNotification(); + // Return a reference to the modifiable "LeadershipCessionNotification" + // selection of this object if "LeadershipCessionNotification" is the + // current selection. The behavior is undefined unless + // "LeadershipCessionNotification" is the selection of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; - - /// Return a reference to the non-modifiable "ElectionProposal" - /// selection of this object if "ElectionProposal" is the current - /// selection. The behavior is undefined unless "ElectionProposal" is - /// the selection of this object. const ElectionProposal& electionProposal() const; + // Return a reference to the non-modifiable "ElectionProposal" + // selection of this object if "ElectionProposal" is the current + // selection. The behavior is undefined unless "ElectionProposal" is + // the selection of this object. - /// Return a reference to the non-modifiable "ElectionResponse" - /// selection of this object if "ElectionResponse" is the current - /// selection. The behavior is undefined unless "ElectionResponse" is - /// the selection of this object. const ElectionResponse& electionResponse() const; + // Return a reference to the non-modifiable "ElectionResponse" + // selection of this object if "ElectionResponse" is the current + // selection. The behavior is undefined unless "ElectionResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable "LeaderHeartbeat" selection - /// of this object if "LeaderHeartbeat" is the current selection. The - /// behavior is undefined unless "LeaderHeartbeat" is the selection of - /// this object. const LeaderHeartbeat& leaderHeartbeat() const; + // Return a reference to the non-modifiable "LeaderHeartbeat" selection + // of this object if "LeaderHeartbeat" is the current selection. The + // behavior is undefined unless "LeaderHeartbeat" is the selection of + // this object. - /// Return a reference to the non-modifiable "ElectorNodeStatus" - /// selection of this object if "ElectorNodeStatus" is the current - /// selection. The behavior is undefined unless "ElectorNodeStatus" is - /// the selection of this object. const ElectorNodeStatus& electorNodeStatus() const; + // Return a reference to the non-modifiable "ElectorNodeStatus" + // selection of this object if "ElectorNodeStatus" is the current + // selection. The behavior is undefined unless "ElectorNodeStatus" is + // the selection of this object. - /// Return a reference to the non-modifiable "HeartbeatResponse" - /// selection of this object if "HeartbeatResponse" is the current - /// selection. The behavior is undefined unless "HeartbeatResponse" is - /// the selection of this object. const HeartbeatResponse& heartbeatResponse() const; + // Return a reference to the non-modifiable "HeartbeatResponse" + // selection of this object if "HeartbeatResponse" is the current + // selection. The behavior is undefined unless "HeartbeatResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable "ScoutingRequest" selection - /// of this object if "ScoutingRequest" is the current selection. The - /// behavior is undefined unless "ScoutingRequest" is the selection of - /// this object. const ScoutingRequest& scoutingRequest() const; + // Return a reference to the non-modifiable "ScoutingRequest" selection + // of this object if "ScoutingRequest" is the current selection. The + // behavior is undefined unless "ScoutingRequest" is the selection of + // this object. - /// Return a reference to the non-modifiable "ScoutingResponse" - /// selection of this object if "ScoutingResponse" is the current - /// selection. The behavior is undefined unless "ScoutingResponse" is - /// the selection of this object. const ScoutingResponse& scoutingResponse() const; + // Return a reference to the non-modifiable "ScoutingResponse" + // selection of this object if "ScoutingResponse" is the current + // selection. The behavior is undefined unless "ScoutingResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable - /// "LeadershipCessionNotification" selection of this object if - /// "LeadershipCessionNotification" is the current selection. The - /// behavior is undefined unless "LeadershipCessionNotification" is the - /// selection of this object. const LeadershipCessionNotification& leadershipCessionNotification() const; + // Return a reference to the non-modifiable + // "LeadershipCessionNotification" selection of this object if + // "LeadershipCessionNotification" is the current selection. The + // behavior is undefined unless "LeadershipCessionNotification" is the + // selection of this object. - /// Return `true` if the value of this object is a "ElectionProposal" - /// value, and return `false` otherwise. bool isElectionProposalValue() const; + // Return 'true' if the value of this object is a "ElectionProposal" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ElectionResponse" - /// value, and return `false` otherwise. bool isElectionResponseValue() const; + // Return 'true' if the value of this object is a "ElectionResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "LeaderHeartbeat" - /// value, and return `false` otherwise. bool isLeaderHeartbeatValue() const; + // Return 'true' if the value of this object is a "LeaderHeartbeat" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ElectorNodeStatus" - /// value, and return `false` otherwise. bool isElectorNodeStatusValue() const; + // Return 'true' if the value of this object is a "ElectorNodeStatus" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "HeartbeatResponse" - /// value, and return `false` otherwise. bool isHeartbeatResponseValue() const; + // Return 'true' if the value of this object is a "HeartbeatResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ScoutingRequest" - /// value, and return `false` otherwise. bool isScoutingRequestValue() const; + // Return 'true' if the value of this object is a "ScoutingRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ScoutingResponse" - /// value, and return `false` otherwise. bool isScoutingResponseValue() const; + // Return 'true' if the value of this object is a "ScoutingResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "LeadershipCessionNotification" value, and return `false` otherwise. bool isLeadershipCessionNotificationValue() const; + // Return 'true' if the value of this object is a + // "LeadershipCessionNotification" value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ElectorMessageChoice& lhs, + const ElectorMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'ElectorMessageChoice' objects + // have the same value if either the selections in both objects have + // the same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ElectorMessageChoice& lhs, + const ElectorMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ElectorMessageChoice& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ElectorMessageChoice& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ElectorMessageChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `ElectorMessageChoice` objects have the -/// same value if either the selections in both objects have the same ids and -/// the same values, or both selections are undefined. -inline bool operator==(const ElectorMessageChoice& lhs, - const ElectorMessageChoice& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const ElectorMessageChoice& lhs, - const ElectorMessageChoice& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ElectorMessageChoice& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ElectorMessageChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectorMessageChoice& object); - } // close package namespace // TRAITS @@ -9346,11 +9045,12 @@ namespace bmqp_ctrlmsg { // class Expression // ================ -/// This complex type contains expression to evaluate when selecting -/// Subscription for delivery. -/// version................: expression version (default is HSL) -/// text...................: textual representation of the expression class Expression { + // This complex type contains expression to evaluate when selecting + // Subscription for delivery. + // version................: expression version (default is HSL) + // text...................: textual representation of the expression + // INSTANCE DATA bsl::string d_text; ExpressionVersion::Value d_version; @@ -9372,182 +9072,187 @@ class Expression { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `Expression` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit Expression(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Expression' having the default value. Use + // the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `Expression` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. Expression(const Expression& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Expression' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `Expression` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. Expression(Expression&& original) noexcept; + // Create an object of type 'Expression' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `Expression` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. Expression(Expression&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'Expression' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~Expression(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. Expression& operator=(const Expression& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. Expression& operator=(Expression&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Version" attribute of this - /// object. ExpressionVersion::Value& version(); + // Return a reference to the modifiable "Version" attribute of this + // object. - /// Return a reference to the modifiable "Text" attribute of this - /// object. bsl::string& text(); + // Return a reference to the modifiable "Text" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Version" attribute of this - /// object. ExpressionVersion::Value version() const; + // Return the value of the "Version" attribute of this object. - /// Return a reference to the non-modifiable "Text" attribute of this - /// object. const bsl::string& text() const; + // Return a reference offering non-modifiable access to the "Text" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const Expression& lhs, const Expression& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.version() == rhs.version() && lhs.text() == rhs.text(); + } + + friend bool operator!=(const Expression& lhs, const Expression& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const Expression& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Expression& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Expression'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.version()); + hashAppend(hashAlg, object.text()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const Expression& lhs, const Expression& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const Expression& lhs, const Expression& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const Expression& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `Expression`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::Expression& object); - } // close package namespace // TRAITS @@ -9561,10 +9266,11 @@ namespace bmqp_ctrlmsg { // class FollowerLSNResponse // ========================= -/// This type represents a response to the `FollowerLSNRequest` sent by a -/// follower to the leader. -/// sequenceNumber..: Follower's leader-sequence number class FollowerLSNResponse { + // This type represents a response to the 'FollowerLSNRequest' sent by a + // follower to the leader. + // sequenceNumber..: Follower's leader-sequence number + // INSTANCE DATA LeaderMessageSequence d_sequenceNumber; @@ -9583,164 +9289,144 @@ class FollowerLSNResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `FollowerLSNResponse` having the default - /// value. FollowerLSNResponse(); - - /// Create an object of type `FollowerLSNResponse` having the value of - /// the specified `original` object. - FollowerLSNResponse(const FollowerLSNResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `FollowerLSNResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - FollowerLSNResponse(FollowerLSNResponse&& original) = default; -#endif - - /// Destroy this object. - ~FollowerLSNResponse(); + // Create an object of type 'FollowerLSNResponse' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - FollowerLSNResponse& operator=(const FollowerLSNResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - FollowerLSNResponse& operator=(FollowerLSNResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const FollowerLSNResponse& lhs, + const FollowerLSNResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const FollowerLSNResponse& lhs, + const FollowerLSNResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const FollowerLSNResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const FollowerLSNResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'FollowerLSNResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const FollowerLSNResponse& lhs, - const FollowerLSNResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const FollowerLSNResponse& lhs, - const FollowerLSNResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const FollowerLSNResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `FollowerLSNResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerLSNResponse& object); - } // close package namespace // TRAITS @@ -9754,9 +9440,10 @@ namespace bmqp_ctrlmsg { // class LeaderAdvisoryAck // ======================= -/// This type represents a one way message indicating receipt of a specific -/// leader advisory. class LeaderAdvisoryAck { + // This type represents a one way message indicating receipt of a specific + // leader advisory. + // INSTANCE DATA LeaderMessageSequence d_sequenceNumberAcked; @@ -9775,164 +9462,144 @@ class LeaderAdvisoryAck { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `LeaderAdvisoryAck` having the default - /// value. LeaderAdvisoryAck(); - - /// Create an object of type `LeaderAdvisoryAck` having the value of the - /// specified `original` object. - LeaderAdvisoryAck(const LeaderAdvisoryAck& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderAdvisoryAck` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderAdvisoryAck(LeaderAdvisoryAck&& original) = default; -#endif - - /// Destroy this object. - ~LeaderAdvisoryAck(); + // Create an object of type 'LeaderAdvisoryAck' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderAdvisoryAck& operator=(const LeaderAdvisoryAck& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderAdvisoryAck& operator=(LeaderAdvisoryAck&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumberAcked" attribute - /// of this object. LeaderMessageSequence& sequenceNumberAcked(); + // Return a reference to the modifiable "SequenceNumberAcked" attribute + // of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumberAcked" - /// attribute of this object. const LeaderMessageSequence& sequenceNumberAcked() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumberAcked" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderAdvisoryAck& lhs, + const LeaderAdvisoryAck& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumberAcked() == rhs.sequenceNumberAcked(); + } + + friend bool operator!=(const LeaderAdvisoryAck& lhs, + const LeaderAdvisoryAck& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderAdvisoryAck& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const LeaderAdvisoryAck& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderAdvisoryAck'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumberAcked()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderAdvisoryAck& lhs, - const LeaderAdvisoryAck& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderAdvisoryAck& lhs, - const LeaderAdvisoryAck& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderAdvisoryAck& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderAdvisoryAck`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderAdvisoryAck& object); - } // close package namespace // TRAITS @@ -9946,9 +9613,10 @@ namespace bmqp_ctrlmsg { // class LeaderAdvisoryCommit // ========================== -/// This type represents a one way message indicating commit of a specific -/// leader advisory. class LeaderAdvisoryCommit { + // This type represents a one way message indicating commit of a specific + // leader advisory. + // INSTANCE DATA LeaderMessageSequence d_sequenceNumber; LeaderMessageSequence d_sequenceNumberCommitted; @@ -9974,172 +9642,154 @@ class LeaderAdvisoryCommit { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `LeaderAdvisoryCommit` having the default - /// value. LeaderAdvisoryCommit(); - - /// Create an object of type `LeaderAdvisoryCommit` having the value of - /// the specified `original` object. - LeaderAdvisoryCommit(const LeaderAdvisoryCommit& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderAdvisoryCommit` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - LeaderAdvisoryCommit(LeaderAdvisoryCommit&& original) = default; -#endif - - /// Destroy this object. - ~LeaderAdvisoryCommit(); + // Create an object of type 'LeaderAdvisoryCommit' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderAdvisoryCommit& operator=(const LeaderAdvisoryCommit& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderAdvisoryCommit& operator=(LeaderAdvisoryCommit&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. - /// Return a reference to the modifiable "SequenceNumberCommitted" - /// attribute of this object. LeaderMessageSequence& sequenceNumberCommitted(); + // Return a reference to the modifiable "SequenceNumberCommitted" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumberCommitted" - /// attribute of this object. const LeaderMessageSequence& sequenceNumberCommitted() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumberCommitted" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderAdvisoryCommit& lhs, + const LeaderAdvisoryCommit& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber() && + lhs.sequenceNumberCommitted() == rhs.sequenceNumberCommitted(); + } + + friend bool operator!=(const LeaderAdvisoryCommit& lhs, + const LeaderAdvisoryCommit& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderAdvisoryCommit& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const LeaderAdvisoryCommit& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderAdvisoryCommit'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumber()); + hashAppend(hashAlg, object.sequenceNumberCommitted()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderAdvisoryCommit& lhs, - const LeaderAdvisoryCommit& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderAdvisoryCommit& lhs, - const LeaderAdvisoryCommit& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderAdvisoryCommit& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderAdvisoryCommit`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderAdvisoryCommit& object); - } // close package namespace // TRAITS @@ -10153,9 +9803,10 @@ namespace bmqp_ctrlmsg { // class LeaderSyncStateQueryResponse // ================================== -/// This type represents a response to the `LeaderSyncStateQuery` sent by -/// the follower to the leader. class LeaderSyncStateQueryResponse { + // This type represents a response to the 'LeaderSyncStateQuery' sent by + // the follower to the leader. + // INSTANCE DATA LeaderMessageSequence d_leaderMessageSequence; @@ -10174,168 +9825,144 @@ class LeaderSyncStateQueryResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `LeaderSyncStateQueryResponse` having the - /// default value. LeaderSyncStateQueryResponse(); - - /// Create an object of type `LeaderSyncStateQueryResponse` having the - /// value of the specified `original` object. - LeaderSyncStateQueryResponse(const LeaderSyncStateQueryResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderSyncStateQueryResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. - LeaderSyncStateQueryResponse(LeaderSyncStateQueryResponse&& original) = - default; -#endif - - /// Destroy this object. - ~LeaderSyncStateQueryResponse(); + // Create an object of type 'LeaderSyncStateQueryResponse' having the + // default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - LeaderSyncStateQueryResponse& - operator=(const LeaderSyncStateQueryResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - LeaderSyncStateQueryResponse& - operator=(LeaderSyncStateQueryResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "LeaderMessageSequence" - /// attribute of this object. LeaderMessageSequence& leaderMessageSequence(); + // Return a reference to the modifiable "LeaderMessageSequence" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "LeaderMessageSequence" - /// attribute of this object. const LeaderMessageSequence& leaderMessageSequence() const; + // Return a reference offering non-modifiable access to the + // "LeaderMessageSequence" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderSyncStateQueryResponse& lhs, + const LeaderSyncStateQueryResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.leaderMessageSequence() == rhs.leaderMessageSequence(); + } + + friend bool operator!=(const LeaderSyncStateQueryResponse& lhs, + const LeaderSyncStateQueryResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderSyncStateQueryResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const LeaderSyncStateQueryResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderSyncStateQueryResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.leaderMessageSequence()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderSyncStateQueryResponse& lhs, - const LeaderSyncStateQueryResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderSyncStateQueryResponse& lhs, - const LeaderSyncStateQueryResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderSyncStateQueryResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderSyncStateQueryResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& object); - } // close package namespace // TRAITS @@ -10349,9 +9976,10 @@ namespace bmqp_ctrlmsg { // class NodeStatusAdvisory // ======================== -/// This type represents a one way message sent by a node to its peers -/// whenever its status changes, as it deemed by the node itself. class NodeStatusAdvisory { + // This type represents a one way message sent by a node to its peers + // whenever its status changes, as it deemed by the node itself. + // INSTANCE DATA NodeStatus::Value d_status; @@ -10370,164 +9998,143 @@ class NodeStatusAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `NodeStatusAdvisory` having the default - /// value. NodeStatusAdvisory(); - - /// Create an object of type `NodeStatusAdvisory` having the value of - /// the specified `original` object. - NodeStatusAdvisory(const NodeStatusAdvisory& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `NodeStatusAdvisory` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - NodeStatusAdvisory(NodeStatusAdvisory&& original) = default; -#endif - - /// Destroy this object. - ~NodeStatusAdvisory(); + // Create an object of type 'NodeStatusAdvisory' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - NodeStatusAdvisory& operator=(const NodeStatusAdvisory& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - NodeStatusAdvisory& operator=(NodeStatusAdvisory&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Status" attribute of this - /// object. NodeStatus::Value& status(); + // Return a reference to the modifiable "Status" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Status" attribute of this - /// object. NodeStatus::Value status() const; + // Return the value of the "Status" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const NodeStatusAdvisory& lhs, + const NodeStatusAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.status() == rhs.status(); + } + + friend bool operator!=(const NodeStatusAdvisory& lhs, + const NodeStatusAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const NodeStatusAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const NodeStatusAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'NodeStatusAdvisory'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.status()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const NodeStatusAdvisory& lhs, - const NodeStatusAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const NodeStatusAdvisory& lhs, - const NodeStatusAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const NodeStatusAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `NodeStatusAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::NodeStatusAdvisory& object); - } // close package namespace // TRAITS @@ -10541,10 +10148,11 @@ namespace bmqp_ctrlmsg { // class PartitionPrimaryAdvisory // ============================== -/// This type represents a one way message sent by the leader to all -/// followers with a mapping of partition -> primary node, and other -/// relevant infomration. class PartitionPrimaryAdvisory { + // This type represents a one way message sent by the leader to all + // followers with a mapping of partition -> primary node, and other + // relevant infomration. + // INSTANCE DATA bsl::vector d_partitions; LeaderMessageSequence d_sequenceNumber; @@ -10567,187 +10175,195 @@ class PartitionPrimaryAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionPrimaryAdvisory` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit PartitionPrimaryAdvisory(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'PartitionPrimaryAdvisory' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `PartitionPrimaryAdvisory` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. PartitionPrimaryAdvisory(const PartitionPrimaryAdvisory& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'PartitionPrimaryAdvisory' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionPrimaryAdvisory` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. PartitionPrimaryAdvisory(PartitionPrimaryAdvisory&& original) noexcept; + // Create an object of type 'PartitionPrimaryAdvisory' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `PartitionPrimaryAdvisory` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. PartitionPrimaryAdvisory(PartitionPrimaryAdvisory&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'PartitionPrimaryAdvisory' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~PartitionPrimaryAdvisory(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. PartitionPrimaryAdvisory& operator=(const PartitionPrimaryAdvisory& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. PartitionPrimaryAdvisory& operator=(PartitionPrimaryAdvisory&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. - /// Return a reference to the modifiable "Partitions" attribute of this - /// object. bsl::vector& partitions(); + // Return a reference to the modifiable "Partitions" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "Partitions" attribute of - /// this object. const bsl::vector& partitions() const; + // Return a reference offering non-modifiable access to the + // "Partitions" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionPrimaryAdvisory& lhs, + const PartitionPrimaryAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber() && + lhs.partitions() == rhs.partitions(); + } + + friend bool operator!=(const PartitionPrimaryAdvisory& lhs, + const PartitionPrimaryAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionPrimaryAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionPrimaryAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionPrimaryAdvisory'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumber()); + hashAppend(hashAlg, object.partitions()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionPrimaryAdvisory& lhs, - const PartitionPrimaryAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionPrimaryAdvisory& lhs, - const PartitionPrimaryAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionPrimaryAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionPrimaryAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionPrimaryAdvisory& object); - } // close package namespace // TRAITS @@ -10761,12 +10377,13 @@ namespace bmqp_ctrlmsg { // class PrimaryStateRequest // ========================= -/// This type represents a request sent to the primary by a replica to ask -/// for primary's sequence number. The replica also sends it own sequence -/// number as part of this request. -/// partitionId: partition id for corresponding partition. -/// sequenceNumber: Replica's sequence number for corresponding partition. class PrimaryStateRequest { + // This type represents a request sent to the primary by a replica to ask + // for primary's sequence number. The replica also sends it own sequence + // number as part of this request. + // partitionId: partition id for corresponding partition. + // sequenceNumber: Replica's sequence number for corresponding partition. + // INSTANCE DATA PartitionSequenceNumber d_sequenceNumber; int d_partitionId; @@ -10789,172 +10406,153 @@ class PrimaryStateRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PrimaryStateRequest` having the default - /// value. PrimaryStateRequest(); - - /// Create an object of type `PrimaryStateRequest` having the value of - /// the specified `original` object. - PrimaryStateRequest(const PrimaryStateRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PrimaryStateRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - PrimaryStateRequest(PrimaryStateRequest&& original) = default; -#endif - - /// Destroy this object. - ~PrimaryStateRequest(); + // Create an object of type 'PrimaryStateRequest' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PrimaryStateRequest& operator=(const PrimaryStateRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PrimaryStateRequest& operator=(PrimaryStateRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. PartitionSequenceNumber& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const PartitionSequenceNumber& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PrimaryStateRequest& lhs, + const PrimaryStateRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const PrimaryStateRequest& lhs, + const PrimaryStateRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PrimaryStateRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PrimaryStateRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PrimaryStateRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.partitionId()); + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PrimaryStateRequest& lhs, - const PrimaryStateRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PrimaryStateRequest& lhs, - const PrimaryStateRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PrimaryStateRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PrimaryStateRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PrimaryStateRequest& object); - } // close package namespace // TRAITS @@ -10968,11 +10566,12 @@ namespace bmqp_ctrlmsg { // class PrimaryStateResponse // ========================== -/// This type represents a response sent by a primary to the replica along -/// with its sequence number. -/// partitionId: partition id for corresponding partition. -/// sequenceNumber: Primary's sequence number for corresponding partition. class PrimaryStateResponse { + // This type represents a response sent by a primary to the replica along + // with its sequence number. + // partitionId: partition id for corresponding partition. + // sequenceNumber: Primary's sequence number for corresponding partition. + // INSTANCE DATA PartitionSequenceNumber d_sequenceNumber; int d_partitionId; @@ -10995,172 +10594,153 @@ class PrimaryStateResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PrimaryStateResponse` having the default - /// value. PrimaryStateResponse(); - - /// Create an object of type `PrimaryStateResponse` having the value of - /// the specified `original` object. - PrimaryStateResponse(const PrimaryStateResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PrimaryStateResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - PrimaryStateResponse(PrimaryStateResponse&& original) = default; -#endif - - /// Destroy this object. - ~PrimaryStateResponse(); + // Create an object of type 'PrimaryStateResponse' having the default + // value. // MANIPULATORS + void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Assign to this object the value of the specified `rhs` object. - PrimaryStateResponse& operator=(const PrimaryStateResponse& rhs); + int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PrimaryStateResponse& operator=(PrimaryStateResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). - void reset(); - - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. - int& partitionId(); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. PartitionSequenceNumber& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const PartitionSequenceNumber& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PrimaryStateResponse& lhs, + const PrimaryStateResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const PrimaryStateResponse& lhs, + const PrimaryStateResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PrimaryStateResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PrimaryStateResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PrimaryStateResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.partitionId()); + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PrimaryStateResponse& lhs, - const PrimaryStateResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PrimaryStateResponse& lhs, - const PrimaryStateResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PrimaryStateResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PrimaryStateResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PrimaryStateResponse& object); - } // close package namespace // TRAITS @@ -11174,16 +10754,21 @@ namespace bmqp_ctrlmsg { // class PrimaryStatusAdvisory // =========================== -/// This type represents a message sent by a primary node to the replicas -/// whenever primary's status changes. -/// partitionId..: The corresponding partitionId status.......: Status of -/// the query class PrimaryStatusAdvisory { + // This type represents a message sent by a primary node to the replicas + // whenever primary's status changes. + // partitionId..: The corresponding partitionId status.......: Status of + // the query + // INSTANCE DATA unsigned int d_primaryLeaseId; int d_partitionId; PrimaryStatus::Value d_status; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -11209,180 +10794,158 @@ class PrimaryStatusAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PrimaryStatusAdvisory` having the default - /// value. PrimaryStatusAdvisory(); - - /// Create an object of type `PrimaryStatusAdvisory` having the value of - /// the specified `original` object. - PrimaryStatusAdvisory(const PrimaryStatusAdvisory& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PrimaryStatusAdvisory` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - PrimaryStatusAdvisory(PrimaryStatusAdvisory&& original) = default; -#endif - - /// Destroy this object. - ~PrimaryStatusAdvisory(); + // Create an object of type 'PrimaryStatusAdvisory' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PrimaryStatusAdvisory& operator=(const PrimaryStatusAdvisory& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PrimaryStatusAdvisory& operator=(PrimaryStatusAdvisory&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. - /// Return a reference to the modifiable "Status" attribute of this - /// object. PrimaryStatus::Value& status(); + // Return a reference to the modifiable "Status" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. - /// Return a reference to the non-modifiable "Status" attribute of this - /// object. PrimaryStatus::Value status() const; + // Return the value of the "Status" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PrimaryStatusAdvisory& lhs, + const PrimaryStatusAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.primaryLeaseId() == rhs.primaryLeaseId() && + lhs.status() == rhs.status(); + } + + friend bool operator!=(const PrimaryStatusAdvisory& lhs, + const PrimaryStatusAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PrimaryStatusAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PrimaryStatusAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PrimaryStatusAdvisory'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PrimaryStatusAdvisory& lhs, - const PrimaryStatusAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PrimaryStatusAdvisory& lhs, - const PrimaryStatusAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PrimaryStatusAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PrimaryStatusAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PrimaryStatusAdvisory& object); - } // close package namespace // TRAITS @@ -11396,17 +10959,18 @@ namespace bmqp_ctrlmsg { // class QueueHandleParameters // =========================== -/// This complex type contains various parameters required by an upstream -/// node to create a queue handle for the requester. -/// uri........: URI of the queue to open qId........: id that will be used -/// to reference this queue subIdInfo..: Optional SubQueueId info, -/// applicable if requester is a fanout consumer flags......: flags to use -/// when opening the queue readCount..: the number of `downstream` reader -/// clients aggregated in this open queue request writeCount.: the number of -/// `downstream` writer clients aggregated in this open queue request -/// adminCount.: the number of `downstream` admin clients aggregated in this -/// open queue request class QueueHandleParameters { + // This complex type contains various parameters required by an upstream + // node to create a queue handle for the requester. + // uri........: URI of the queue to open qId........: id that will be used + // to reference this queue subIdInfo..: Optional SubQueueId info, + // applicable if requester is a fanout consumer flags......: flags to use + // when opening the queue readCount..: the number of 'downstream' reader + // clients aggregated in this open queue request writeCount.: the number of + // 'downstream' writer clients aggregated in this open queue request + // adminCount.: the number of 'downstream' admin clients aggregated in this + // open queue request + // INSTANCE DATA bsls::Types::Uint64 d_flags; bsl::string d_uri; @@ -11416,6 +10980,12 @@ class QueueHandleParameters { int d_writeCount; int d_adminCount; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueHandleParameters& rhs) const; + public: // TYPES enum { @@ -11453,224 +11023,224 @@ class QueueHandleParameters { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueHandleParameters` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit QueueHandleParameters(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueHandleParameters' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `QueueHandleParameters` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueHandleParameters(const QueueHandleParameters& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueHandleParameters' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueHandleParameters` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. QueueHandleParameters(QueueHandleParameters&& original) noexcept; + // Create an object of type 'QueueHandleParameters' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `QueueHandleParameters` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. QueueHandleParameters(QueueHandleParameters&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueHandleParameters' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~QueueHandleParameters(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueHandleParameters& operator=(const QueueHandleParameters& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueHandleParameters& operator=(QueueHandleParameters&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Uri" attribute of this object. bsl::string& uri(); + // Return a reference to the modifiable "Uri" attribute of this object. - /// Return a reference to the modifiable "QId" attribute of this object. unsigned int& qId(); + // Return a reference to the modifiable "QId" attribute of this object. - /// Return a reference to the modifiable "SubIdInfo" attribute of this - /// object. bdlb::NullableValue& subIdInfo(); + // Return a reference to the modifiable "SubIdInfo" attribute of this + // object. - /// Return a reference to the modifiable "Flags" attribute of this - /// object. bsls::Types::Uint64& flags(); + // Return a reference to the modifiable "Flags" attribute of this + // object. - /// Return a reference to the modifiable "ReadCount" attribute of this - /// object. int& readCount(); + // Return a reference to the modifiable "ReadCount" attribute of this + // object. - /// Return a reference to the modifiable "WriteCount" attribute of this - /// object. int& writeCount(); + // Return a reference to the modifiable "WriteCount" attribute of this + // object. - /// Return a reference to the modifiable "AdminCount" attribute of this - /// object. int& adminCount(); + // Return a reference to the modifiable "AdminCount" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Uri" attribute of this - /// object. const bsl::string& uri() const; + // Return a reference offering non-modifiable access to the "Uri" + // attribute of this object. - /// Return a reference to the non-modifiable "QId" attribute of this - /// object. unsigned int qId() const; + // Return the value of the "QId" attribute of this object. - /// Return a reference to the non-modifiable "SubIdInfo" attribute of - /// this object. const bdlb::NullableValue& subIdInfo() const; + // Return a reference offering non-modifiable access to the "SubIdInfo" + // attribute of this object. - /// Return a reference to the non-modifiable "Flags" attribute of this - /// object. bsls::Types::Uint64 flags() const; + // Return the value of the "Flags" attribute of this object. - /// Return a reference to the non-modifiable "ReadCount" attribute of - /// this object. int readCount() const; + // Return the value of the "ReadCount" attribute of this object. - /// Return a reference to the non-modifiable "WriteCount" attribute of - /// this object. int writeCount() const; + // Return the value of the "WriteCount" attribute of this object. - /// Return a reference to the non-modifiable "AdminCount" attribute of - /// this object. int adminCount() const; + // Return the value of the "AdminCount" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueHandleParameters& lhs, + const QueueHandleParameters& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const QueueHandleParameters& lhs, + const QueueHandleParameters& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueHandleParameters& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueHandleParameters& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueHandleParameters'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueHandleParameters& lhs, - const QueueHandleParameters& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueHandleParameters& lhs, - const QueueHandleParameters& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueHandleParameters& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueHandleParameters`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueHandleParameters& object); - } // close package namespace // TRAITS @@ -11684,15 +11254,22 @@ namespace bmqp_ctrlmsg { // class QueueInfo // =============== -/// This type represents a queue assignment, that is the key and partitionId -/// assigned to a given URI. class QueueInfo { + // This type represents a queue assignment, that is the key and partitionId + // assigned to a given URI. + // INSTANCE DATA bsl::vector d_key; bsl::vector d_appIds; bsl::string d_uri; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueInfo& rhs) const; + public: // TYPES enum { @@ -11718,194 +11295,196 @@ class QueueInfo { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueInfo` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit QueueInfo(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueInfo' having the default value. Use + // the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `QueueInfo` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueInfo(const QueueInfo& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueInfo' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. QueueInfo(QueueInfo&& original) noexcept; + // Create an object of type 'QueueInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `QueueInfo` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. QueueInfo(QueueInfo&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueInfo' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~QueueInfo(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueInfo& operator=(const QueueInfo& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueInfo& operator=(QueueInfo&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Uri" attribute of this object. bsl::string& uri(); + // Return a reference to the modifiable "Uri" attribute of this object. - /// Return a reference to the modifiable "Key" attribute of this object. bsl::vector& key(); + // Return a reference to the modifiable "Key" attribute of this object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "AppIds" attribute of this - /// object. bsl::vector& appIds(); + // Return a reference to the modifiable "AppIds" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Uri" attribute of this - /// object. const bsl::string& uri() const; + // Return a reference offering non-modifiable access to the "Uri" + // attribute of this object. - /// Return a reference to the non-modifiable "Key" attribute of this - /// object. const bsl::vector& key() const; + // Return a reference offering non-modifiable access to the "Key" + // attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "AppIds" attribute of this - /// object. const bsl::vector& appIds() const; -}; + // Return a reference offering non-modifiable access to the "AppIds" + // attribute of this object. -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueInfo& lhs, const QueueInfo& rhs); + // HIDDEN FRIENDS + friend bool operator==(const QueueInfo& lhs, const QueueInfo& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueInfo& lhs, const QueueInfo& rhs); + friend bool operator!=(const QueueInfo& lhs, const QueueInfo& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const QueueInfo& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, const QueueInfo& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueInfo`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueInfo& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const QueueInfo& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'QueueInfo'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -11920,11 +11499,12 @@ namespace bmqp_ctrlmsg { // class QueueInfoUpdate // ===================== -/// This type represents a queue update, that is the added or removed appIds -/// for a given URI. In the case of (un)registering appIds for a domain -/// without any queues present, the `domain` field will be populated whereas -/// the `uri`, `key` and `partitionId` will all be set to null/invalid. class QueueInfoUpdate { + // This type represents a queue update, that is the added or removed appIds + // for a given URI. In the case of (un)registering appIds for a domain + // without any queues present, the 'domain' field will be populated whereas + // the 'uri', 'key' and 'partitionId' will all be set to null/invalid. + // INSTANCE DATA bsl::vector d_key; bsl::vector d_addedAppIds; @@ -11933,6 +11513,12 @@ class QueueInfoUpdate { bsl::string d_domain; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueInfoUpdate& rhs) const; + public: // TYPES enum { @@ -11962,214 +11548,220 @@ class QueueInfoUpdate { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueInfoUpdate` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit QueueInfoUpdate(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueInfoUpdate' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `QueueInfoUpdate` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueInfoUpdate(const QueueInfoUpdate& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueInfoUpdate' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueInfoUpdate` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. QueueInfoUpdate(QueueInfoUpdate&& original) noexcept; + // Create an object of type 'QueueInfoUpdate' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `QueueInfoUpdate` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. QueueInfoUpdate(QueueInfoUpdate&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueInfoUpdate' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~QueueInfoUpdate(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueInfoUpdate& operator=(const QueueInfoUpdate& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueInfoUpdate& operator=(QueueInfoUpdate&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Uri" attribute of this object. bsl::string& uri(); + // Return a reference to the modifiable "Uri" attribute of this object. - /// Return a reference to the modifiable "Key" attribute of this object. bsl::vector& key(); + // Return a reference to the modifiable "Key" attribute of this object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "AddedAppIds" attribute of this - /// object. bsl::vector& addedAppIds(); + // Return a reference to the modifiable "AddedAppIds" attribute of this + // object. - /// Return a reference to the modifiable "RemovedAppIds" attribute of - /// this object. bsl::vector& removedAppIds(); + // Return a reference to the modifiable "RemovedAppIds" attribute of + // this object. - /// Return a reference to the modifiable "Domain" attribute of this - /// object. bsl::string& domain(); + // Return a reference to the modifiable "Domain" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Uri" attribute of this - /// object. const bsl::string& uri() const; + // Return a reference offering non-modifiable access to the "Uri" + // attribute of this object. - /// Return a reference to the non-modifiable "Key" attribute of this - /// object. const bsl::vector& key() const; + // Return a reference offering non-modifiable access to the "Key" + // attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "AddedAppIds" attribute of - /// this object. const bsl::vector& addedAppIds() const; + // Return a reference offering non-modifiable access to the + // "AddedAppIds" attribute of this object. - /// Return a reference to the non-modifiable "RemovedAppIds" attribute - /// of this object. const bsl::vector& removedAppIds() const; + // Return a reference offering non-modifiable access to the + // "RemovedAppIds" attribute of this object. - /// Return a reference to the non-modifiable "Domain" attribute of this - /// object. const bsl::string& domain() const; + // Return a reference offering non-modifiable access to the "Domain" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueInfoUpdate& lhs, + const QueueInfoUpdate& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const QueueInfoUpdate& lhs, + const QueueInfoUpdate& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueInfoUpdate& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueInfoUpdate& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueInfoUpdate'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueInfoUpdate& lhs, const QueueInfoUpdate& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueInfoUpdate& lhs, const QueueInfoUpdate& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueInfoUpdate& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueInfoUpdate`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueInfoUpdate& object); - } // close package namespace // TRAITS @@ -12183,19 +11775,20 @@ namespace bmqp_ctrlmsg { // class QueueStreamParameters // =========================== -/// This complex type contains various parameters required by an upstream -/// node to configure a queue handle (i.e., a "stream") that has already -/// been created. -/// subIdInfo..............: Optional subQueueId identifying the stream in -/// case downstream node represents a fanout consumer -/// maxUnconfirmedMessages.: maximum number of outstanding delivered but -/// pending confirmation from the client maxUnconfirmedBytes....: maximum -/// cumulated bytes of all outstanding delivered but pending confirmation -/// messages from the client consumerPriority.......: priority as advertised -/// by the downstream node for this stream consumerPriorityCount..: weight -/// of the stream as advertised by the downstream node, having -/// above-mentioned consumer priority class QueueStreamParameters { + // This complex type contains various parameters required by an upstream + // node to configure a queue handle (i.e., a "stream") that has already + // been created. + // subIdInfo..............: Optional subQueueId identifying the stream in + // case downstream node represents a fanout consumer + // maxUnconfirmedMessages.: maximum number of outstanding delivered but + // pending confirmation from the client maxUnconfirmedBytes....: maximum + // cumulated bytes of all outstanding delivered but pending confirmation + // messages from the client consumerPriority.......: priority as advertised + // by the downstream node for this stream consumerPriorityCount..: weight + // of the stream as advertised by the downstream node, having + // above-mentioned consumer priority + // INSTANCE DATA bsls::Types::Int64 d_maxUnconfirmedMessages; bsls::Types::Int64 d_maxUnconfirmedBytes; @@ -12203,6 +11796,12 @@ class QueueStreamParameters { int d_consumerPriority; int d_consumerPriorityCount; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueStreamParameters& rhs) const; + public: // TYPES enum { @@ -12239,210 +11838,214 @@ class QueueStreamParameters { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueStreamParameters` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit QueueStreamParameters(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueStreamParameters' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `QueueStreamParameters` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueStreamParameters(const QueueStreamParameters& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueStreamParameters' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueStreamParameters` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. QueueStreamParameters(QueueStreamParameters&& original) noexcept; + // Create an object of type 'QueueStreamParameters' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `QueueStreamParameters` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. QueueStreamParameters(QueueStreamParameters&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueStreamParameters' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~QueueStreamParameters(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueStreamParameters& operator=(const QueueStreamParameters& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueStreamParameters& operator=(QueueStreamParameters&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SubIdInfo" attribute of this - /// object. bdlb::NullableValue& subIdInfo(); + // Return a reference to the modifiable "SubIdInfo" attribute of this + // object. - /// Return a reference to the modifiable "MaxUnconfirmedMessages" - /// attribute of this object. bsls::Types::Int64& maxUnconfirmedMessages(); + // Return a reference to the modifiable "MaxUnconfirmedMessages" + // attribute of this object. - /// Return a reference to the modifiable "MaxUnconfirmedBytes" attribute - /// of this object. bsls::Types::Int64& maxUnconfirmedBytes(); + // Return a reference to the modifiable "MaxUnconfirmedBytes" attribute + // of this object. - /// Return a reference to the modifiable "ConsumerPriority" attribute of - /// this object. int& consumerPriority(); + // Return a reference to the modifiable "ConsumerPriority" attribute of + // this object. - /// Return a reference to the modifiable "ConsumerPriorityCount" - /// attribute of this object. int& consumerPriorityCount(); + // Return a reference to the modifiable "ConsumerPriorityCount" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SubIdInfo" attribute of - /// this object. const bdlb::NullableValue& subIdInfo() const; + // Return a reference offering non-modifiable access to the "SubIdInfo" + // attribute of this object. - /// Return a reference to the non-modifiable "MaxUnconfirmedMessages" - /// attribute of this object. bsls::Types::Int64 maxUnconfirmedMessages() const; + // Return the value of the "MaxUnconfirmedMessages" attribute of this + // object. - /// Return a reference to the non-modifiable "MaxUnconfirmedBytes" - /// attribute of this object. bsls::Types::Int64 maxUnconfirmedBytes() const; + // Return the value of the "MaxUnconfirmedBytes" attribute of this + // object. - /// Return a reference to the non-modifiable "ConsumerPriority" - /// attribute of this object. int consumerPriority() const; + // Return the value of the "ConsumerPriority" attribute of this object. - /// Return a reference to the non-modifiable "ConsumerPriorityCount" - /// attribute of this object. int consumerPriorityCount() const; + // Return the value of the "ConsumerPriorityCount" attribute of this + // object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueStreamParameters& lhs, + const QueueStreamParameters& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const QueueStreamParameters& lhs, + const QueueStreamParameters& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueStreamParameters& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueStreamParameters& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueStreamParameters'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueStreamParameters& lhs, - const QueueStreamParameters& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueStreamParameters& lhs, - const QueueStreamParameters& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueStreamParameters& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueStreamParameters`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueStreamParameters& object); - } // close package namespace // TRAITS @@ -12456,10 +12059,11 @@ namespace bmqp_ctrlmsg { // class RegistrationRequest // ========================= -/// This type represents a request sent by a follower to the leader to -/// register its leader-sequence number. -/// sequenceNumber..: Follower's leader-sequence number class RegistrationRequest { + // This type represents a request sent by a follower to the leader to + // register its leader-sequence number. + // sequenceNumber..: Follower's leader-sequence number + // INSTANCE DATA LeaderMessageSequence d_sequenceNumber; @@ -12478,164 +12082,144 @@ class RegistrationRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `RegistrationRequest` having the default - /// value. RegistrationRequest(); - - /// Create an object of type `RegistrationRequest` having the value of - /// the specified `original` object. - RegistrationRequest(const RegistrationRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `RegistrationRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - RegistrationRequest(RegistrationRequest&& original) = default; -#endif - - /// Destroy this object. - ~RegistrationRequest(); + // Create an object of type 'RegistrationRequest' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - RegistrationRequest& operator=(const RegistrationRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - RegistrationRequest& operator=(RegistrationRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const RegistrationRequest& lhs, + const RegistrationRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const RegistrationRequest& lhs, + const RegistrationRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const RegistrationRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const RegistrationRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'RegistrationRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const RegistrationRequest& lhs, - const RegistrationRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const RegistrationRequest& lhs, - const RegistrationRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const RegistrationRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `RegistrationRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::RegistrationRequest& object); - } // close package namespace // TRAITS @@ -12649,21 +12233,28 @@ namespace bmqp_ctrlmsg { // class ReplicaDataRequest // ======================== -/// This type represents a request sent to the replica by the primary to -/// start the synchronization of data. -/// replicaDataType: type of request i.e. PULL, PUSH or DROP for -/// corresponding partition. partitionId: partition id for -/// corresponding partition. beginSequenceNumber: Primary's begin sequence -/// number for corresponding partition for corresponding data chunks. -/// endSequenceNumber: Primary's end sequence number for corresponding -/// partition for corresponding data chunks. class ReplicaDataRequest { + // This type represents a request sent to the replica by the primary to + // start the synchronization of data. + // replicaDataType: type of request i.e. PULL, PUSH or DROP for + // corresponding partition. partitionId: partition id for + // corresponding partition. beginSequenceNumber: Primary's begin sequence + // number for corresponding partition for corresponding data chunks. + // endSequenceNumber: Primary's end sequence number for corresponding + // partition for corresponding data chunks. + // INSTANCE DATA PartitionSequenceNumber d_beginSequenceNumber; PartitionSequenceNumber d_endSequenceNumber; int d_partitionId; ReplicaDataType::Value d_replicaDataType; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ReplicaDataRequest& rhs) const; + public: // TYPES enum { @@ -12689,188 +12280,165 @@ class ReplicaDataRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ReplicaDataRequest` having the default - /// value. ReplicaDataRequest(); - - /// Create an object of type `ReplicaDataRequest` having the value of - /// the specified `original` object. - ReplicaDataRequest(const ReplicaDataRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ReplicaDataRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ReplicaDataRequest(ReplicaDataRequest&& original) = default; -#endif - - /// Destroy this object. - ~ReplicaDataRequest(); + // Create an object of type 'ReplicaDataRequest' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ReplicaDataRequest& operator=(const ReplicaDataRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ReplicaDataRequest& operator=(ReplicaDataRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ReplicaDataType" attribute of - /// this object. ReplicaDataType::Value& replicaDataType(); + // Return a reference to the modifiable "ReplicaDataType" attribute of + // this object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "BeginSequenceNumber" attribute - /// of this object. PartitionSequenceNumber& beginSequenceNumber(); + // Return a reference to the modifiable "BeginSequenceNumber" attribute + // of this object. - /// Return a reference to the modifiable "EndSequenceNumber" attribute - /// of this object. PartitionSequenceNumber& endSequenceNumber(); + // Return a reference to the modifiable "EndSequenceNumber" attribute + // of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ReplicaDataType" attribute - /// of this object. ReplicaDataType::Value replicaDataType() const; + // Return the value of the "ReplicaDataType" attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "BeginSequenceNumber" - /// attribute of this object. const PartitionSequenceNumber& beginSequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "BeginSequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "EndSequenceNumber" - /// attribute of this object. const PartitionSequenceNumber& endSequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "EndSequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ReplicaDataRequest& lhs, + const ReplicaDataRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ReplicaDataRequest& lhs, + const ReplicaDataRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ReplicaDataRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ReplicaDataRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ReplicaDataRequest'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ReplicaDataRequest& lhs, - const ReplicaDataRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ReplicaDataRequest& lhs, - const ReplicaDataRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ReplicaDataRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ReplicaDataRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaDataRequest& object); - } // close package namespace // TRAITS @@ -12884,23 +12452,30 @@ namespace bmqp_ctrlmsg { // class ReplicaDataResponse // ========================= -/// This type represents a response sent by a replica to the primary for the -/// data synchronization request received by it. -/// replicaDataType: type of request received i.e. PULL, PUSH or DROP -/// for corresponding partition. Note, this field will be set as per the -/// request received and the primary purpose of sending this field back in -/// response is for debugging and sanity checking. partitionId: -/// partition id for corresponding partition. beginSequenceNumber: -/// Replica's begin sequence number for corresponding partition for -/// corresponding data chunks. endSequenceNumber: Replica's end sequence -/// number for corresponding partition for corresponding data chunks. class ReplicaDataResponse { + // This type represents a response sent by a replica to the primary for the + // data synchronization request received by it. + // replicaDataType: type of request received i.e. PULL, PUSH or DROP + // for corresponding partition. Note, this field will be set as per the + // request received and the primary purpose of sending this field back in + // response is for debugging and sanity checking. partitionId: + // partition id for corresponding partition. beginSequenceNumber: + // Replica's begin sequence number for corresponding partition for + // corresponding data chunks. endSequenceNumber: Replica's end sequence + // number for corresponding partition for corresponding data chunks. + // INSTANCE DATA PartitionSequenceNumber d_beginSequenceNumber; PartitionSequenceNumber d_endSequenceNumber; int d_partitionId; ReplicaDataType::Value d_replicaDataType; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ReplicaDataResponse& rhs) const; + public: // TYPES enum { @@ -12926,188 +12501,165 @@ class ReplicaDataResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ReplicaDataResponse` having the default - /// value. ReplicaDataResponse(); - - /// Create an object of type `ReplicaDataResponse` having the value of - /// the specified `original` object. - ReplicaDataResponse(const ReplicaDataResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ReplicaDataResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ReplicaDataResponse(ReplicaDataResponse&& original) = default; -#endif - - /// Destroy this object. - ~ReplicaDataResponse(); + // Create an object of type 'ReplicaDataResponse' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ReplicaDataResponse& operator=(const ReplicaDataResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ReplicaDataResponse& operator=(ReplicaDataResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ReplicaDataType" attribute of - /// this object. ReplicaDataType::Value& replicaDataType(); + // Return a reference to the modifiable "ReplicaDataType" attribute of + // this object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "BeginSequenceNumber" attribute - /// of this object. PartitionSequenceNumber& beginSequenceNumber(); + // Return a reference to the modifiable "BeginSequenceNumber" attribute + // of this object. - /// Return a reference to the modifiable "EndSequenceNumber" attribute - /// of this object. PartitionSequenceNumber& endSequenceNumber(); + // Return a reference to the modifiable "EndSequenceNumber" attribute + // of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ReplicaDataType" attribute - /// of this object. ReplicaDataType::Value replicaDataType() const; + // Return the value of the "ReplicaDataType" attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "BeginSequenceNumber" - /// attribute of this object. const PartitionSequenceNumber& beginSequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "BeginSequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "EndSequenceNumber" - /// attribute of this object. const PartitionSequenceNumber& endSequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "EndSequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ReplicaDataResponse& lhs, + const ReplicaDataResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ReplicaDataResponse& lhs, + const ReplicaDataResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ReplicaDataResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ReplicaDataResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ReplicaDataResponse'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ReplicaDataResponse& lhs, - const ReplicaDataResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ReplicaDataResponse& lhs, - const ReplicaDataResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ReplicaDataResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ReplicaDataResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaDataResponse& object); - } // close package namespace // TRAITS @@ -13121,12 +12673,13 @@ namespace bmqp_ctrlmsg { // class ReplicaStateRequest // ========================= -/// This type represents a request sent to the replica by the primary to ask -/// for replica's sequence number. The primary also sends its own sequence -/// number as part of this request. -/// partitionId: partition id for corresponding partition. -/// sequenceNumber: Primary's sequence number for corresponding partition. class ReplicaStateRequest { + // This type represents a request sent to the replica by the primary to ask + // for replica's sequence number. The primary also sends its own sequence + // number as part of this request. + // partitionId: partition id for corresponding partition. + // sequenceNumber: Primary's sequence number for corresponding partition. + // INSTANCE DATA PartitionSequenceNumber d_sequenceNumber; int d_partitionId; @@ -13149,172 +12702,153 @@ class ReplicaStateRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ReplicaStateRequest` having the default - /// value. ReplicaStateRequest(); - - /// Create an object of type `ReplicaStateRequest` having the value of - /// the specified `original` object. - ReplicaStateRequest(const ReplicaStateRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ReplicaStateRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ReplicaStateRequest(ReplicaStateRequest&& original) = default; -#endif - - /// Destroy this object. - ~ReplicaStateRequest(); + // Create an object of type 'ReplicaStateRequest' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ReplicaStateRequest& operator=(const ReplicaStateRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ReplicaStateRequest& operator=(ReplicaStateRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. PartitionSequenceNumber& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const PartitionSequenceNumber& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ReplicaStateRequest& lhs, + const ReplicaStateRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const ReplicaStateRequest& lhs, + const ReplicaStateRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ReplicaStateRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ReplicaStateRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ReplicaStateRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.partitionId()); + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ReplicaStateRequest& lhs, - const ReplicaStateRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ReplicaStateRequest& lhs, - const ReplicaStateRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ReplicaStateRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ReplicaStateRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaStateRequest& object); - } // close package namespace // TRAITS @@ -13328,11 +12862,12 @@ namespace bmqp_ctrlmsg { // class ReplicaStateResponse // ========================== -/// This type represents a response sent by a replica to the primary along -/// with its sequence number. -/// partitionId: partition id for corresponding partition. -/// sequenceNumber: Replica's sequence number for corresponding partition. class ReplicaStateResponse { + // This type represents a response sent by a replica to the primary along + // with its sequence number. + // partitionId: partition id for corresponding partition. + // sequenceNumber: Replica's sequence number for corresponding partition. + // INSTANCE DATA PartitionSequenceNumber d_sequenceNumber; int d_partitionId; @@ -13355,172 +12890,153 @@ class ReplicaStateResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ReplicaStateResponse` having the default - /// value. ReplicaStateResponse(); - - /// Create an object of type `ReplicaStateResponse` having the value of - /// the specified `original` object. - ReplicaStateResponse(const ReplicaStateResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ReplicaStateResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ReplicaStateResponse(ReplicaStateResponse&& original) = default; -#endif - - /// Destroy this object. - ~ReplicaStateResponse(); + // Create an object of type 'ReplicaStateResponse' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ReplicaStateResponse& operator=(const ReplicaStateResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ReplicaStateResponse& operator=(ReplicaStateResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. PartitionSequenceNumber& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const PartitionSequenceNumber& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ReplicaStateResponse& lhs, + const ReplicaStateResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.sequenceNumber() == rhs.sequenceNumber(); + } + + friend bool operator!=(const ReplicaStateResponse& lhs, + const ReplicaStateResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ReplicaStateResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ReplicaStateResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ReplicaStateResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.partitionId()); + hashAppend(hashAlg, object.sequenceNumber()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ReplicaStateResponse& lhs, - const ReplicaStateResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ReplicaStateResponse& lhs, - const ReplicaStateResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ReplicaStateResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ReplicaStateResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaStateResponse& object); - } // close package namespace // TRAITS @@ -13542,6 +13058,12 @@ class StateNotificationChoice { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const StateNotificationChoice& rhs) const; + public: // TYPES @@ -13557,66 +13079,63 @@ class StateNotificationChoice { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StateNotificationChoice` having the - /// default value. StateNotificationChoice(); + // Create an object of type 'StateNotificationChoice' having the + // default value. - /// Create an object of type `StateNotificationChoice` having the value - /// of the specified `original` object. StateNotificationChoice(const StateNotificationChoice& original); + // Create an object of type 'StateNotificationChoice' having the value + // of the specified 'original' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StateNotificationChoice` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. StateNotificationChoice(StateNotificationChoice&& original) noexcept; + // Create an object of type 'StateNotificationChoice' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. #endif - /// Destroy this object. ~StateNotificationChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. StateNotificationChoice& operator=(const StateNotificationChoice& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. StateNotificationChoice& operator=(StateNotificationChoice&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). LeaderPassive& makeLeaderPassive(); LeaderPassive& makeLeaderPassive(const LeaderPassive& value); @@ -13628,91 +13147,103 @@ class StateNotificationChoice { // Optionally specify the 'value' of the "LeaderPassive". If 'value' // is not specified, the default "LeaderPassive" value is used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "LeaderPassive" selection of - /// this object if "LeaderPassive" is the current selection. The - /// behavior is undefined unless "LeaderPassive" is the selection of - /// this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + LeaderPassive& leaderPassive(); + // Return a reference to the modifiable "LeaderPassive" selection of + // this object if "LeaderPassive" is the current selection. The + // behavior is undefined unless "LeaderPassive" is the selection of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; - - /// Return a reference to the non-modifiable "LeaderPassive" selection - /// of this object if "LeaderPassive" is the current selection. The - /// behavior is undefined unless "LeaderPassive" is the selection of - /// this object. const LeaderPassive& leaderPassive() const; + // Return a reference to the non-modifiable "LeaderPassive" selection + // of this object if "LeaderPassive" is the current selection. The + // behavior is undefined unless "LeaderPassive" is the selection of + // this object. - /// Return `true` if the value of this object is a "LeaderPassive" - /// value, and return `false` otherwise. bool isLeaderPassiveValue() const; + // Return 'true' if the value of this object is a "LeaderPassive" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StateNotificationChoice& lhs, + const StateNotificationChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'StateNotificationChoice' objects + // have the same value if either the selections in both objects have + // the same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const StateNotificationChoice& lhs, + const StateNotificationChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StateNotificationChoice& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StateNotificationChoice& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StateNotificationChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `StateNotificationChoice` objects have -/// the same value if either the selections in both objects have the same ids -/// and the same values, or both selections are undefined. -inline bool operator==(const StateNotificationChoice& lhs, - const StateNotificationChoice& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const StateNotificationChoice& lhs, - const StateNotificationChoice& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const StateNotificationChoice& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StateNotificationChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StateNotificationChoice& object); - } // close package namespace // TRAITS @@ -13726,16 +13257,21 @@ namespace bmqp_ctrlmsg { // class Status // ============ -/// Generic type to represent a status. -/// category.: the category of the status code.....: an integer value -/// representing the error message..: an optional string describing the -/// error class Status { + // Generic type to represent a status. + // category.: the category of the status code.....: an integer value + // representing the error message..: an optional string describing the + // error + // INSTANCE DATA bsl::string d_message; int d_code; StatusCategory::Value d_category; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -13761,187 +13297,190 @@ class Status { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `Status` having the default value. Use the - /// optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit Status(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Status' having the default value. Use the + // optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `Status` having the value of the specified - /// `original` object. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. Status(const Status& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Status' having the value of the specified + // 'original' object. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `Status` having the value of the specified - /// `original` object. After performing this action, the `original` - /// object will be left in a valid, but unspecified state. Status(Status&& original) noexcept; + // Create an object of type 'Status' having the value of the specified + // 'original' object. After performing this action, the 'original' + // object will be left in a valid, but unspecified state. - /// Create an object of type `Status` having the value of the specified - /// `original` object. After performing this action, the `original` - /// object will be left in a valid, but unspecified state. Use the - /// optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. Status(Status&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'Status' having the value of the specified + // 'original' object. After performing this action, the 'original' + // object will be left in a valid, but unspecified state. Use the + // optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~Status(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. Status& operator=(const Status& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. Status& operator=(Status&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Category" attribute of this - /// object. StatusCategory::Value& category(); + // Return a reference to the modifiable "Category" attribute of this + // object. - /// Return a reference to the modifiable "Code" attribute of this - /// object. int& code(); + // Return a reference to the modifiable "Code" attribute of this + // object. - /// Return a reference to the modifiable "Message" attribute of this - /// object. bsl::string& message(); + // Return a reference to the modifiable "Message" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Category" attribute of - /// this object. StatusCategory::Value category() const; + // Return the value of the "Category" attribute of this object. - /// Return a reference to the non-modifiable "Code" attribute of this - /// object. int code() const; + // Return the value of the "Code" attribute of this object. - /// Return a reference to the non-modifiable "Message" attribute of this - /// object. const bsl::string& message() const; -}; + // Return a reference offering non-modifiable access to the "Message" + // attribute of this object. -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const Status& lhs, const Status& rhs); + // HIDDEN FRIENDS + friend bool operator==(const Status& lhs, const Status& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.category() == rhs.category() && lhs.code() == rhs.code() && + lhs.message() == rhs.message(); + } -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const Status& lhs, const Status& rhs); + friend bool operator!=(const Status& lhs, const Status& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const Status& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, const Status& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `Status`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::Status& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Status& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Status'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -13955,19 +13494,26 @@ namespace bmqp_ctrlmsg { // class StorageSyncResponse // ========================= -/// This type represents the message sent by the peer node in response to a -/// storage sync request. -/// partitionId..............: The corresponding partitionId -/// storageSyncResponseType..: Type of storage sync response (enumeration) -/// beginSyncPoint...........: Starting sync point of the sent storage -/// endSyncPoint.............: Ending sync point of the sent storage class StorageSyncResponse { + // This type represents the message sent by the peer node in response to a + // storage sync request. + // partitionId..............: The corresponding partitionId + // storageSyncResponseType..: Type of storage sync response (enumeration) + // beginSyncPoint...........: Starting sync point of the sent storage + // endSyncPoint.............: Ending sync point of the sent storage + // INSTANCE DATA SyncPoint d_beginSyncPoint; SyncPoint d_endSyncPoint; int d_partitionId; StorageSyncResponseType::Value d_storageSyncResponseType; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const StorageSyncResponse& rhs) const; + public: // TYPES enum { @@ -13993,188 +13539,166 @@ class StorageSyncResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StorageSyncResponse` having the default - /// value. StorageSyncResponse(); - - /// Create an object of type `StorageSyncResponse` having the value of - /// the specified `original` object. - StorageSyncResponse(const StorageSyncResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StorageSyncResponse` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - StorageSyncResponse(StorageSyncResponse&& original) = default; -#endif - - /// Destroy this object. - ~StorageSyncResponse(); + // Create an object of type 'StorageSyncResponse' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - StorageSyncResponse& operator=(const StorageSyncResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - StorageSyncResponse& operator=(StorageSyncResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "StorageSyncResponseType" - /// attribute of this object. StorageSyncResponseType::Value& storageSyncResponseType(); + // Return a reference to the modifiable "StorageSyncResponseType" + // attribute of this object. - /// Return a reference to the modifiable "BeginSyncPoint" attribute of - /// this object. SyncPoint& beginSyncPoint(); + // Return a reference to the modifiable "BeginSyncPoint" attribute of + // this object. - /// Return a reference to the modifiable "EndSyncPoint" attribute of - /// this object. SyncPoint& endSyncPoint(); + // Return a reference to the modifiable "EndSyncPoint" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "StorageSyncResponseType" - /// attribute of this object. StorageSyncResponseType::Value storageSyncResponseType() const; + // Return the value of the "StorageSyncResponseType" attribute of this + // object. - /// Return a reference to the non-modifiable "BeginSyncPoint" attribute - /// of this object. const SyncPoint& beginSyncPoint() const; + // Return a reference offering non-modifiable access to the + // "BeginSyncPoint" attribute of this object. - /// Return a reference to the non-modifiable "EndSyncPoint" attribute of - /// this object. const SyncPoint& endSyncPoint() const; + // Return a reference offering non-modifiable access to the + // "EndSyncPoint" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StorageSyncResponse& lhs, + const StorageSyncResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const StorageSyncResponse& lhs, + const StorageSyncResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StorageSyncResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StorageSyncResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StorageSyncResponse'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const StorageSyncResponse& lhs, - const StorageSyncResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const StorageSyncResponse& lhs, - const StorageSyncResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const StorageSyncResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StorageSyncResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StorageSyncResponse& object); - } // close package namespace // TRAITS @@ -14188,11 +13712,12 @@ namespace bmqp_ctrlmsg { // class SyncPointOffsetPair // ========================= -/// A pair of SyncPt and the offset in the journal where that SyncPt -/// appears. Note that in future, we may introduce a journal-offset field -/// in the SyncPt itself, but that could be different from the offset of -/// SyncPt itself. class SyncPointOffsetPair { + // A pair of SyncPt and the offset in the journal where that SyncPt + // appears. Note that in future, we may introduce a journal-offset field + // in the SyncPt itself, but that could be different from the offset of + // SyncPt itself. + // INSTANCE DATA bsls::Types::Uint64 d_offset; SyncPoint d_syncPoint; @@ -14212,172 +13737,153 @@ class SyncPointOffsetPair { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `SyncPointOffsetPair` having the default - /// value. SyncPointOffsetPair(); - - /// Create an object of type `SyncPointOffsetPair` having the value of - /// the specified `original` object. - SyncPointOffsetPair(const SyncPointOffsetPair& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `SyncPointOffsetPair` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - SyncPointOffsetPair(SyncPointOffsetPair&& original) = default; -#endif - - /// Destroy this object. - ~SyncPointOffsetPair(); + // Create an object of type 'SyncPointOffsetPair' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - SyncPointOffsetPair& operator=(const SyncPointOffsetPair& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - SyncPointOffsetPair& operator=(SyncPointOffsetPair&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SyncPoint" attribute of this - /// object. SyncPoint& syncPoint(); + // Return a reference to the modifiable "SyncPoint" attribute of this + // object. - /// Return a reference to the modifiable "Offset" attribute of this - /// object. bsls::Types::Uint64& offset(); + // Return a reference to the modifiable "Offset" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SyncPoint" attribute of - /// this object. const SyncPoint& syncPoint() const; + // Return a reference offering non-modifiable access to the "SyncPoint" + // attribute of this object. - /// Return a reference to the non-modifiable "Offset" attribute of this - /// object. bsls::Types::Uint64 offset() const; + // Return the value of the "Offset" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const SyncPointOffsetPair& lhs, + const SyncPointOffsetPair& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.syncPoint() == rhs.syncPoint() && + lhs.offset() == rhs.offset(); + } + + friend bool operator!=(const SyncPointOffsetPair& lhs, + const SyncPointOffsetPair& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const SyncPointOffsetPair& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const SyncPointOffsetPair& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'SyncPointOffsetPair'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.syncPoint()); + hashAppend(hashAlg, object.offset()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const SyncPointOffsetPair& lhs, - const SyncPointOffsetPair& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const SyncPointOffsetPair& lhs, - const SyncPointOffsetPair& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const SyncPointOffsetPair& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `SyncPointOffsetPair`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::SyncPointOffsetPair& object); - } // close package namespace // TRAITS @@ -14387,17 +13893,246 @@ BDLAT_DECL_SEQUENCE_WITH_BITWISEMOVEABLE_TRAITS( namespace bmqp_ctrlmsg { -// ==================== -// class BrokerResponse +// ========================== +// class AuthenticateResponse +// ========================== + +class AuthenticateResponse { + // Response of an 'AuthenticateRequest' request indicating the result of + // the operation. The message is sent to a client from a broker during + // authentication. + // status.....: Status of the request lifetimeMs.: The duration (in + // milliseconds) the client's session is valid for. The client must + // re-authenticate before the lifetime expires or it will be disconnected. + + // INSTANCE DATA + bdlb::NullableValue d_lifetimeMs; + Status d_status; + + public: + // TYPES + enum { ATTRIBUTE_ID_STATUS = 0, ATTRIBUTE_ID_LIFETIME_MS = 1 }; + + enum { NUM_ATTRIBUTES = 2 }; + + enum { ATTRIBUTE_INDEX_STATUS = 0, ATTRIBUTE_INDEX_LIFETIME_MS = 1 }; + + // CONSTANTS + static const char CLASS_NAME[]; + + static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]; + + public: + // CLASS METHODS + static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. + + static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, + int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. + + // CREATORS + explicit AuthenticateResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AuthenticateResponse' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. + + AuthenticateResponse(const AuthenticateResponse& original, + bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AuthenticateResponse' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticateResponse(AuthenticateResponse&& original) noexcept; + // Create an object of type 'AuthenticateResponse' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + + AuthenticateResponse(AuthenticateResponse&& original, + bslma::Allocator* basicAllocator); + // Create an object of type 'AuthenticateResponse' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. +#endif + + ~AuthenticateResponse(); + // Destroy this object. + + // MANIPULATORS + AuthenticateResponse& operator=(const AuthenticateResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticateResponse& operator=(AuthenticateResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. +#endif + + void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. + + Status& status(); + // Return a reference to the modifiable "Status" attribute of this + // object. + + bdlb::NullableValue& lifetimeMs(); + // Return a reference to the modifiable "LifetimeMs" attribute of this + // object. + + // ACCESSORS + bsl::ostream& + print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, + const char* name, + int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. + + const Status& status() const; + // Return a reference offering non-modifiable access to the "Status" + // attribute of this object. + + const bdlb::NullableValue& lifetimeMs() const; + // Return a reference offering non-modifiable access to the + // "LifetimeMs" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const AuthenticateResponse& lhs, + const AuthenticateResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.status() == rhs.status() && + lhs.lifetimeMs() == rhs.lifetimeMs(); + } + + friend bool operator!=(const AuthenticateResponse& lhs, + const AuthenticateResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const AuthenticateResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const AuthenticateResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'AuthenticateResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.status()); + hashAppend(hashAlg, object.lifetimeMs()); + } +}; + +} // close package namespace + +// TRAITS + +BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( + bmqp_ctrlmsg::AuthenticateResponse) + +namespace bmqp_ctrlmsg { + +// ==================== +// class BrokerResponse // ==================== -/// This represents the response from the broker to a `ClientIdentity` -/// message during connection negotiation. -/// result..........: the result of the negotiation protocolVersion.: -/// protocol version used by the bmqbrkr brokerVersion...: version of the -/// broker isDeprecatedSdk.: is the version of the client's SDK version -/// deprecated class BrokerResponse { + // This represents the response from the broker to a 'ClientIdentity' + // message during connection negotiation. + // result..........: the result of the negotiation protocolVersion.: + // protocol version used by the bmqbrkr brokerVersion...: version of the + // broker isDeprecatedSdk.: is the version of the client's SDK version + // deprecated + // INSTANCE DATA Status d_result; ClientIdentity d_brokerIdentity; @@ -14407,6 +14142,12 @@ class BrokerResponse { int d_maxMissedHeartbeats; bool d_isDeprecatedSdk; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const BrokerResponse& rhs) const; + public: // TYPES enum { @@ -14444,212 +14185,228 @@ class BrokerResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `BrokerResponse` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit BrokerResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'BrokerResponse' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `BrokerResponse` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. BrokerResponse(const BrokerResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'BrokerResponse' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `BrokerResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. BrokerResponse(BrokerResponse&& original) noexcept; + // Create an object of type 'BrokerResponse' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `BrokerResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. BrokerResponse(BrokerResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'BrokerResponse' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~BrokerResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. BrokerResponse& operator=(const BrokerResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. BrokerResponse& operator=(BrokerResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Result" attribute of this - /// object. Status& result(); + // Return a reference to the modifiable "Result" attribute of this + // object. - /// Return a reference to the modifiable "ProtocolVersion" attribute of - /// this object. int& protocolVersion(); + // Return a reference to the modifiable "ProtocolVersion" attribute of + // this object. - /// Return a reference to the modifiable "BrokerVersion" attribute of - /// this object. int& brokerVersion(); + // Return a reference to the modifiable "BrokerVersion" attribute of + // this object. - /// Return a reference to the modifiable "IsDeprecatedSdk" attribute of - /// this object. bool& isDeprecatedSdk(); + // Return a reference to the modifiable "IsDeprecatedSdk" attribute of + // this object. - /// Return a reference to the modifiable "BrokerIdentity" attribute of - /// this object. ClientIdentity& brokerIdentity(); + // Return a reference to the modifiable "BrokerIdentity" attribute of + // this object. - /// Return a reference to the modifiable "HeartbeatIntervalMs" attribute - /// of this object. int& heartbeatIntervalMs(); + // Return a reference to the modifiable "HeartbeatIntervalMs" attribute + // of this object. - /// Return a reference to the modifiable "MaxMissedHeartbeats" attribute - /// of this object. int& maxMissedHeartbeats(); + // Return a reference to the modifiable "MaxMissedHeartbeats" attribute + // of this object. // ACCESSORS bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Result" attribute of this - /// object. const Status& result() const; + // Return a reference offering non-modifiable access to the "Result" + // attribute of this object. - /// Return a reference to the non-modifiable "ProtocolVersion" attribute - /// of this object. int protocolVersion() const; + // Return the value of the "ProtocolVersion" attribute of this object. - /// Return a reference to the non-modifiable "BrokerVersion" attribute - /// of this object. int brokerVersion() const; + // Return the value of the "BrokerVersion" attribute of this object. - /// Return a reference to the non-modifiable "IsDeprecatedSdk" attribute - /// of this object. bool isDeprecatedSdk() const; + // Return the value of the "IsDeprecatedSdk" attribute of this object. - /// Return a reference to the non-modifiable "BrokerIdentity" attribute - /// of this object. const ClientIdentity& brokerIdentity() const; + // Return a reference offering non-modifiable access to the + // "BrokerIdentity" attribute of this object. - /// Return the value of the "HeartbeatIntervalMs" attribute of this - /// object. int heartbeatIntervalMs() const; + // Return the value of the "HeartbeatIntervalMs" attribute of this + // object. - /// Return the value of the "MaxMissedHeartbeats" attribute of this - /// object. int maxMissedHeartbeats() const; + // Return the value of the "MaxMissedHeartbeats" attribute of this + // object. + + // HIDDEN FRIENDS + friend bool operator==(const BrokerResponse& lhs, + const BrokerResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const BrokerResponse& lhs, + const BrokerResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const BrokerResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const BrokerResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'BrokerResponse'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const BrokerResponse& lhs, const BrokerResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const BrokerResponse& lhs, const BrokerResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const BrokerResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `BrokerResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::BrokerResponse& object); - } // close package namespace // TRAITS @@ -14663,13 +14420,14 @@ namespace bmqp_ctrlmsg { // class CloseQueue // ================ -/// This request contains parameters advertised by the downstream node when -/// it wants to close a queue on an upstream node. -/// handleParameters.: Queue handle parameters as advertised by the -/// downstream node isFinal..........: Flag advertising if downstream node -/// has no more clients for this queue, and upstream node is free to delete -/// the queue handle representing the downstream node class CloseQueue { + // This request contains parameters advertised by the downstream node when + // it wants to close a queue on an upstream node. + // handleParameters.: Queue handle parameters as advertised by the + // downstream node isFinal..........: Flag advertising if downstream node + // has no more clients for this queue, and upstream node is free to delete + // the queue handle representing the downstream node + // INSTANCE DATA QueueHandleParameters d_handleParameters; bool d_isFinal; @@ -14694,182 +14452,188 @@ class CloseQueue { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `CloseQueue` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit CloseQueue(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'CloseQueue' having the default value. Use + // the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `CloseQueue` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. CloseQueue(const CloseQueue& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'CloseQueue' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `CloseQueue` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. CloseQueue(CloseQueue&& original) noexcept; + // Create an object of type 'CloseQueue' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `CloseQueue` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. CloseQueue(CloseQueue&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'CloseQueue' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~CloseQueue(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. CloseQueue& operator=(const CloseQueue& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. CloseQueue& operator=(CloseQueue&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "HandleParameters" attribute of - /// this object. QueueHandleParameters& handleParameters(); + // Return a reference to the modifiable "HandleParameters" attribute of + // this object. - /// Return a reference to the modifiable "IsFinal" attribute of this - /// object. bool& isFinal(); + // Return a reference to the modifiable "IsFinal" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "HandleParameters" - /// attribute of this object. const QueueHandleParameters& handleParameters() const; + // Return a reference offering non-modifiable access to the + // "HandleParameters" attribute of this object. - /// Return a reference to the non-modifiable "IsFinal" attribute of this - /// object. bool isFinal() const; + // Return the value of the "IsFinal" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const CloseQueue& lhs, const CloseQueue& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.handleParameters() == rhs.handleParameters() && + lhs.isFinal() == rhs.isFinal(); + } + + friend bool operator!=(const CloseQueue& lhs, const CloseQueue& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const CloseQueue& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const CloseQueue& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'CloseQueue'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.handleParameters()); + hashAppend(hashAlg, object.isFinal()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const CloseQueue& lhs, const CloseQueue& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const CloseQueue& lhs, const CloseQueue& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const CloseQueue& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `CloseQueue`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::CloseQueue& object); - } // close package namespace // TRAITS @@ -14883,12 +14647,13 @@ namespace bmqp_ctrlmsg { // class ConfigureQueueStream // ========================== -/// This request contains parameters advertised by the downstream node so -/// that upstream node can configure the stream associated with the -/// downstream node. -/// qId..............: Id identifying the queue streamParameters.: -/// Parameters for configuring the stream class ConfigureQueueStream { + // This request contains parameters advertised by the downstream node so + // that upstream node can configure the stream associated with the + // downstream node. + // qId..............: Id identifying the queue streamParameters.: + // Parameters for configuring the stream + // INSTANCE DATA QueueStreamParameters d_streamParameters; unsigned int d_qId; @@ -14908,185 +14673,192 @@ class ConfigureQueueStream { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ConfigureQueueStream` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit ConfigureQueueStream(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureQueueStream' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `ConfigureQueueStream` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ConfigureQueueStream(const ConfigureQueueStream& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureQueueStream' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ConfigureQueueStream` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ConfigureQueueStream(ConfigureQueueStream&& original) noexcept; + // Create an object of type 'ConfigureQueueStream' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ConfigureQueueStream` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ConfigureQueueStream(ConfigureQueueStream&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ConfigureQueueStream' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ConfigureQueueStream(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ConfigureQueueStream& operator=(const ConfigureQueueStream& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ConfigureQueueStream& operator=(ConfigureQueueStream&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "QId" attribute of this object. unsigned int& qId(); + // Return a reference to the modifiable "QId" attribute of this object. - /// Return a reference to the modifiable "StreamParameters" attribute of - /// this object. QueueStreamParameters& streamParameters(); + // Return a reference to the modifiable "StreamParameters" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "QId" attribute of this - /// object. unsigned int qId() const; + // Return the value of the "QId" attribute of this object. - /// Return a reference to the non-modifiable "StreamParameters" - /// attribute of this object. const QueueStreamParameters& streamParameters() const; + // Return a reference offering non-modifiable access to the + // "StreamParameters" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ConfigureQueueStream& lhs, + const ConfigureQueueStream& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.qId() == rhs.qId() && + lhs.streamParameters() == rhs.streamParameters(); + } + + friend bool operator!=(const ConfigureQueueStream& lhs, + const ConfigureQueueStream& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConfigureQueueStream& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ConfigureQueueStream& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ConfigureQueueStream'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.qId()); + hashAppend(hashAlg, object.streamParameters()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ConfigureQueueStream& lhs, - const ConfigureQueueStream& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ConfigureQueueStream& lhs, - const ConfigureQueueStream& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ConfigureQueueStream& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ConfigureQueueStream`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureQueueStream& object); - } // close package namespace // TRAITS @@ -15100,11 +14872,12 @@ namespace bmqp_ctrlmsg { // class ElectorMessage // ==================== -/// This type is the top level type for any message being sent by elector -/// component in the cluster. -/// term....: Term being proposed in the election choice..: Enumerates all -/// the different types of elector messages class ElectorMessage { + // This type is the top level type for any message being sent by elector + // component in the cluster. + // term....: Term being proposed in the election choice..: Enumerates all + // the different types of elector messages + // INSTANCE DATA bsls::Types::Uint64 d_term; ElectorMessageChoice d_choice; @@ -15124,169 +14897,151 @@ class ElectorMessage { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ElectorMessage` having the default value. ElectorMessage(); - - /// Create an object of type `ElectorMessage` having the value of the - /// specified `original` object. - ElectorMessage(const ElectorMessage& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ElectorMessage` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ElectorMessage(ElectorMessage&& original) = default; -#endif - - /// Destroy this object. - ~ElectorMessage(); + // Create an object of type 'ElectorMessage' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ElectorMessage& operator=(const ElectorMessage& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - ElectorMessage& operator=(ElectorMessage&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Term" attribute of this - /// object. bsls::Types::Uint64& term(); + // Return a reference to the modifiable "Term" attribute of this + // object. - /// Return a reference to the modifiable "Choice" attribute of this - /// object. ElectorMessageChoice& choice(); + // Return a reference to the modifiable "Choice" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Term" attribute of this - /// object. bsls::Types::Uint64 term() const; + // Return the value of the "Term" attribute of this object. - /// Return a reference to the non-modifiable "Choice" attribute of this - /// object. const ElectorMessageChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ElectorMessage& lhs, + const ElectorMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.term() == rhs.term() && lhs.choice() == rhs.choice(); + } + + friend bool operator!=(const ElectorMessage& lhs, + const ElectorMessage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ElectorMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ElectorMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ElectorMessage'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.term()); + hashAppend(hashAlg, object.choice()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ElectorMessage& lhs, const ElectorMessage& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ElectorMessage& lhs, const ElectorMessage& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ElectorMessage& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ElectorMessage`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectorMessage& object); - } // close package namespace // TRAITS @@ -15299,14 +15054,19 @@ namespace bmqp_ctrlmsg { // class LeaderAdvisory // ==================== -/// This type represents a one way message sent by the leader to all -/// followers about partition/primary and queue info mappings. class LeaderAdvisory { + // This type represents a one way message sent by the leader to all + // followers about partition/primary and queue info mappings. + // INSTANCE DATA bsl::vector d_queues; bsl::vector d_partitions; LeaderMessageSequence d_sequenceNumber; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -15330,192 +15090,201 @@ class LeaderAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `LeaderAdvisory` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit LeaderAdvisory(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'LeaderAdvisory' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `LeaderAdvisory` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. LeaderAdvisory(const LeaderAdvisory& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'LeaderAdvisory' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderAdvisory` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. LeaderAdvisory(LeaderAdvisory&& original) noexcept; + // Create an object of type 'LeaderAdvisory' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `LeaderAdvisory` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. LeaderAdvisory(LeaderAdvisory&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'LeaderAdvisory' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~LeaderAdvisory(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. LeaderAdvisory& operator=(const LeaderAdvisory& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. LeaderAdvisory& operator=(LeaderAdvisory&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. - /// Return a reference to the modifiable "Partitions" attribute of this - /// object. bsl::vector& partitions(); + // Return a reference to the modifiable "Partitions" attribute of this + // object. - /// Return a reference to the modifiable "Queues" attribute of this - /// object. bsl::vector& queues(); + // Return a reference to the modifiable "Queues" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "Partitions" attribute of - /// this object. const bsl::vector& partitions() const; + // Return a reference offering non-modifiable access to the + // "Partitions" attribute of this object. - /// Return a reference to the non-modifiable "Queues" attribute of this - /// object. const bsl::vector& queues() const; + // Return a reference offering non-modifiable access to the "Queues" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderAdvisory& lhs, + const LeaderAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber() && + lhs.partitions() == rhs.partitions() && + lhs.queues() == rhs.queues(); + } + + friend bool operator!=(const LeaderAdvisory& lhs, + const LeaderAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const LeaderAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderAdvisory'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderAdvisory& lhs, const LeaderAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderAdvisory& lhs, const LeaderAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderAdvisory& object); - } // close package namespace // TRAITS @@ -15529,10 +15298,11 @@ namespace bmqp_ctrlmsg { // class OpenQueue // =============== -/// This request is an indication that the client wants to open a queue, and -/// the upstream node should create a queue handle for the requester. -/// handleParameters.: Parameters for the queue handle to be created class OpenQueue { + // This request is an indication that the client wants to open a queue, and + // the upstream node should create a queue handle for the requester. + // handleParameters.: Parameters for the queue handle to be created + // INSTANCE DATA QueueHandleParameters d_handleParameters; @@ -15551,172 +15321,176 @@ class OpenQueue { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `OpenQueue` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit OpenQueue(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenQueue' having the default value. Use + // the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `OpenQueue` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. OpenQueue(const OpenQueue& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenQueue' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `OpenQueue` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. OpenQueue(OpenQueue&& original) noexcept; + // Create an object of type 'OpenQueue' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `OpenQueue` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. OpenQueue(OpenQueue&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'OpenQueue' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~OpenQueue(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. OpenQueue& operator=(const OpenQueue& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. OpenQueue& operator=(OpenQueue&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "HandleParameters" attribute of - /// this object. QueueHandleParameters& handleParameters(); + // Return a reference to the modifiable "HandleParameters" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "HandleParameters" - /// attribute of this object. const QueueHandleParameters& handleParameters() const; -}; - -// FREE OPERATORS + // Return a reference offering non-modifiable access to the + // "HandleParameters" attribute of this object. -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const OpenQueue& lhs, const OpenQueue& rhs); + // HIDDEN FRIENDS + friend bool operator==(const OpenQueue& lhs, const OpenQueue& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.handleParameters() == rhs.handleParameters(); + } -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const OpenQueue& lhs, const OpenQueue& rhs); + friend bool operator!=(const OpenQueue& lhs, const OpenQueue& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const OpenQueue& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, const OpenQueue& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `OpenQueue`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::OpenQueue& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const OpenQueue& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'OpenQueue'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.handleParameters()); + } +}; } // close package namespace @@ -15744,6 +15518,12 @@ class PartitionMessageChoice { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const PartitionMessageChoice& rhs) const; + public: // TYPES @@ -15774,66 +15554,63 @@ class PartitionMessageChoice { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionMessageChoice` having the default - /// value. PartitionMessageChoice(); + // Create an object of type 'PartitionMessageChoice' having the default + // value. - /// Create an object of type `PartitionMessageChoice` having the value - /// of the specified `original` object. PartitionMessageChoice(const PartitionMessageChoice& original); + // Create an object of type 'PartitionMessageChoice' having the value + // of the specified 'original' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionMessageChoice` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. PartitionMessageChoice(PartitionMessageChoice&& original) noexcept; + // Create an object of type 'PartitionMessageChoice' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. #endif - /// Destroy this object. ~PartitionMessageChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. PartitionMessageChoice& operator=(const PartitionMessageChoice& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. PartitionMessageChoice& operator=(PartitionMessageChoice&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). ReplicaStateRequest& makeReplicaStateRequest(); ReplicaStateRequest& @@ -15909,171 +15686,183 @@ class PartitionMessageChoice { // 'value' is not specified, the default "ReplicaDataResponse" value is // used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "ReplicaStateRequest" selection - /// of this object if "ReplicaStateRequest" is the current selection. - /// The behavior is undefined unless "ReplicaStateRequest" is the - /// selection of this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + ReplicaStateRequest& replicaStateRequest(); + // Return a reference to the modifiable "ReplicaStateRequest" selection + // of this object if "ReplicaStateRequest" is the current selection. + // The behavior is undefined unless "ReplicaStateRequest" is the + // selection of this object. - /// Return a reference to the modifiable "ReplicaStateResponse" - /// selection of this object if "ReplicaStateResponse" is the current - /// selection. The behavior is undefined unless "ReplicaStateResponse" - /// is the selection of this object. ReplicaStateResponse& replicaStateResponse(); + // Return a reference to the modifiable "ReplicaStateResponse" + // selection of this object if "ReplicaStateResponse" is the current + // selection. The behavior is undefined unless "ReplicaStateResponse" + // is the selection of this object. - /// Return a reference to the modifiable "PrimaryStateRequest" selection - /// of this object if "PrimaryStateRequest" is the current selection. - /// The behavior is undefined unless "PrimaryStateRequest" is the - /// selection of this object. PrimaryStateRequest& primaryStateRequest(); + // Return a reference to the modifiable "PrimaryStateRequest" selection + // of this object if "PrimaryStateRequest" is the current selection. + // The behavior is undefined unless "PrimaryStateRequest" is the + // selection of this object. - /// Return a reference to the modifiable "PrimaryStateResponse" - /// selection of this object if "PrimaryStateResponse" is the current - /// selection. The behavior is undefined unless "PrimaryStateResponse" - /// is the selection of this object. PrimaryStateResponse& primaryStateResponse(); + // Return a reference to the modifiable "PrimaryStateResponse" + // selection of this object if "PrimaryStateResponse" is the current + // selection. The behavior is undefined unless "PrimaryStateResponse" + // is the selection of this object. - /// Return a reference to the modifiable "ReplicaDataRequest" selection - /// of this object if "ReplicaDataRequest" is the current selection. - /// The behavior is undefined unless "ReplicaDataRequest" is the - /// selection of this object. ReplicaDataRequest& replicaDataRequest(); + // Return a reference to the modifiable "ReplicaDataRequest" selection + // of this object if "ReplicaDataRequest" is the current selection. + // The behavior is undefined unless "ReplicaDataRequest" is the + // selection of this object. - /// Return a reference to the modifiable "ReplicaDataResponse" selection - /// of this object if "ReplicaDataResponse" is the current selection. - /// The behavior is undefined unless "ReplicaDataResponse" is the - /// selection of this object. ReplicaDataResponse& replicaDataResponse(); + // Return a reference to the modifiable "ReplicaDataResponse" selection + // of this object if "ReplicaDataResponse" is the current selection. + // The behavior is undefined unless "ReplicaDataResponse" is the + // selection of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; - - /// Return a reference to the non-modifiable "ReplicaStateRequest" - /// selection of this object if "ReplicaStateRequest" is the current - /// selection. The behavior is undefined unless "ReplicaStateRequest" - /// is the selection of this object. const ReplicaStateRequest& replicaStateRequest() const; + // Return a reference to the non-modifiable "ReplicaStateRequest" + // selection of this object if "ReplicaStateRequest" is the current + // selection. The behavior is undefined unless "ReplicaStateRequest" + // is the selection of this object. - /// Return a reference to the non-modifiable "ReplicaStateResponse" - /// selection of this object if "ReplicaStateResponse" is the current - /// selection. The behavior is undefined unless "ReplicaStateResponse" - /// is the selection of this object. const ReplicaStateResponse& replicaStateResponse() const; + // Return a reference to the non-modifiable "ReplicaStateResponse" + // selection of this object if "ReplicaStateResponse" is the current + // selection. The behavior is undefined unless "ReplicaStateResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable "PrimaryStateRequest" - /// selection of this object if "PrimaryStateRequest" is the current - /// selection. The behavior is undefined unless "PrimaryStateRequest" - /// is the selection of this object. const PrimaryStateRequest& primaryStateRequest() const; + // Return a reference to the non-modifiable "PrimaryStateRequest" + // selection of this object if "PrimaryStateRequest" is the current + // selection. The behavior is undefined unless "PrimaryStateRequest" + // is the selection of this object. - /// Return a reference to the non-modifiable "PrimaryStateResponse" - /// selection of this object if "PrimaryStateResponse" is the current - /// selection. The behavior is undefined unless "PrimaryStateResponse" - /// is the selection of this object. const PrimaryStateResponse& primaryStateResponse() const; + // Return a reference to the non-modifiable "PrimaryStateResponse" + // selection of this object if "PrimaryStateResponse" is the current + // selection. The behavior is undefined unless "PrimaryStateResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable "ReplicaDataRequest" - /// selection of this object if "ReplicaDataRequest" is the current - /// selection. The behavior is undefined unless "ReplicaDataRequest" is - /// the selection of this object. const ReplicaDataRequest& replicaDataRequest() const; + // Return a reference to the non-modifiable "ReplicaDataRequest" + // selection of this object if "ReplicaDataRequest" is the current + // selection. The behavior is undefined unless "ReplicaDataRequest" is + // the selection of this object. - /// Return a reference to the non-modifiable "ReplicaDataResponse" - /// selection of this object if "ReplicaDataResponse" is the current - /// selection. The behavior is undefined unless "ReplicaDataResponse" - /// is the selection of this object. const ReplicaDataResponse& replicaDataResponse() const; + // Return a reference to the non-modifiable "ReplicaDataResponse" + // selection of this object if "ReplicaDataResponse" is the current + // selection. The behavior is undefined unless "ReplicaDataResponse" + // is the selection of this object. - /// Return `true` if the value of this object is a "ReplicaStateRequest" - /// value, and return `false` otherwise. bool isReplicaStateRequestValue() const; + // Return 'true' if the value of this object is a "ReplicaStateRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "ReplicaStateResponse" value, and return `false` otherwise. bool isReplicaStateResponseValue() const; + // Return 'true' if the value of this object is a + // "ReplicaStateResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "PrimaryStateRequest" - /// value, and return `false` otherwise. bool isPrimaryStateRequestValue() const; + // Return 'true' if the value of this object is a "PrimaryStateRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "PrimaryStateResponse" value, and return `false` otherwise. bool isPrimaryStateResponseValue() const; + // Return 'true' if the value of this object is a + // "PrimaryStateResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ReplicaDataRequest" - /// value, and return `false` otherwise. bool isReplicaDataRequestValue() const; + // Return 'true' if the value of this object is a "ReplicaDataRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ReplicaDataResponse" - /// value, and return `false` otherwise. bool isReplicaDataResponseValue() const; + // Return 'true' if the value of this object is a "ReplicaDataResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionMessageChoice& lhs, + const PartitionMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'PartitionMessageChoice' objects + // have the same value if either the selections in both objects have + // the same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const PartitionMessageChoice& lhs, + const PartitionMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionMessageChoice& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionMessageChoice& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionMessageChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `PartitionMessageChoice` objects have -/// the same value if either the selections in both objects have the same ids -/// and the same values, or both selections are undefined. -inline bool operator==(const PartitionMessageChoice& lhs, - const PartitionMessageChoice& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const PartitionMessageChoice& lhs, - const PartitionMessageChoice& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionMessageChoice& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionMessageChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionMessageChoice& object); - } // close package namespace // TRAITS @@ -16087,11 +15876,12 @@ namespace bmqp_ctrlmsg { // class PartitionSyncDataQuery // ============================ -/// This type represents a request sent by a new primary node to one of the -/// AVAILABLE peers to asking for syncing the partition. -/// partitionId....: The corresponding partitionId lastSyncPoint..: Last -/// sync point of the requester for this partition. class PartitionSyncDataQuery { + // This type represents a request sent by a new primary node to one of the + // AVAILABLE peers to asking for syncing the partition. + // partitionId....: The corresponding partitionId lastSyncPoint..: Last + // sync point of the requester for this partition. + // INSTANCE DATA bsls::Types::Uint64 d_lastSequenceNum; bsls::Types::Uint64 d_uptoSequenceNum; @@ -16100,6 +15890,12 @@ class PartitionSyncDataQuery { unsigned int d_uptoPrimaryLeaseId; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const PartitionSyncDataQuery& rhs) const; + public: // TYPES enum { @@ -16129,205 +15925,180 @@ class PartitionSyncDataQuery { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionSyncDataQuery` having the default - /// value. PartitionSyncDataQuery(); - - /// Create an object of type `PartitionSyncDataQuery` having the value - /// of the specified `original` object. - PartitionSyncDataQuery(const PartitionSyncDataQuery& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionSyncDataQuery` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. - PartitionSyncDataQuery(PartitionSyncDataQuery&& original) = default; -#endif - - /// Destroy this object. - ~PartitionSyncDataQuery(); + // Create an object of type 'PartitionSyncDataQuery' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionSyncDataQuery& operator=(const PartitionSyncDataQuery& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionSyncDataQuery& operator=(PartitionSyncDataQuery&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "LastPrimaryLeaseId" attribute - /// of this object. unsigned int& lastPrimaryLeaseId(); + // Return a reference to the modifiable "LastPrimaryLeaseId" attribute + // of this object. - /// Return a reference to the modifiable "LastSequenceNum" attribute of - /// this object. bsls::Types::Uint64& lastSequenceNum(); + // Return a reference to the modifiable "LastSequenceNum" attribute of + // this object. - /// Return a reference to the modifiable "UptoPrimaryLeaseId" attribute - /// of this object. unsigned int& uptoPrimaryLeaseId(); + // Return a reference to the modifiable "UptoPrimaryLeaseId" attribute + // of this object. - /// Return a reference to the modifiable "UptoSequenceNum" attribute of - /// this object. bsls::Types::Uint64& uptoSequenceNum(); + // Return a reference to the modifiable "UptoSequenceNum" attribute of + // this object. - /// Return a reference to the modifiable "LastSyncPointOffsetPair" - /// attribute of this object. SyncPointOffsetPair& lastSyncPointOffsetPair(); + // Return a reference to the modifiable "LastSyncPointOffsetPair" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "LastPrimaryLeaseId" - /// attribute of this object. unsigned int lastPrimaryLeaseId() const; + // Return the value of the "LastPrimaryLeaseId" attribute of this + // object. - /// Return a reference to the non-modifiable "LastSequenceNum" attribute - /// of this object. bsls::Types::Uint64 lastSequenceNum() const; + // Return the value of the "LastSequenceNum" attribute of this object. - /// Return a reference to the non-modifiable "UptoPrimaryLeaseId" - /// attribute of this object. unsigned int uptoPrimaryLeaseId() const; + // Return the value of the "UptoPrimaryLeaseId" attribute of this + // object. - /// Return a reference to the non-modifiable "UptoSequenceNum" attribute - /// of this object. bsls::Types::Uint64 uptoSequenceNum() const; + // Return the value of the "UptoSequenceNum" attribute of this object. - /// Return a reference to the non-modifiable "LastSyncPointOffsetPair" - /// attribute of this object. const SyncPointOffsetPair& lastSyncPointOffsetPair() const; + // Return a reference offering non-modifiable access to the + // "LastSyncPointOffsetPair" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionSyncDataQuery& lhs, + const PartitionSyncDataQuery& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const PartitionSyncDataQuery& lhs, + const PartitionSyncDataQuery& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionSyncDataQuery& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionSyncDataQuery& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionSyncDataQuery'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionSyncDataQuery& lhs, - const PartitionSyncDataQuery& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionSyncDataQuery& lhs, - const PartitionSyncDataQuery& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionSyncDataQuery& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionSyncDataQuery`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncDataQuery& object); - } // close package namespace // TRAITS @@ -16341,14 +16112,15 @@ namespace bmqp_ctrlmsg { // class PartitionSyncDataQueryStatus // ================================== -/// This type represents a message sent by a peer node to the new primary -/// after it is finished sending partition sync data. This message -/// indicates to the new primary node that partition sync from peer is -/// complete (with appropriate success/failure status indicated in this -/// message). -/// partitionId..: The corresponding partitionId status.......: Status of -/// the query class PartitionSyncDataQueryStatus { + // This type represents a message sent by a peer node to the new primary + // after it is finished sending partition sync data. This message + // indicates to the new primary node that partition sync from peer is + // complete (with appropriate success/failure status indicated in this + // message). + // partitionId..: The corresponding partitionId status.......: Status of + // the query + // INSTANCE DATA Status d_status; int d_partitionId; @@ -16368,191 +16140,198 @@ class PartitionSyncDataQueryStatus { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionSyncDataQueryStatus` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit PartitionSyncDataQueryStatus( bslma::Allocator* basicAllocator = 0); + // Create an object of type 'PartitionSyncDataQueryStatus' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `PartitionSyncDataQueryStatus` having the - /// value of the specified `original` object. Use the optionally - /// specified `basicAllocator` to supply memory. If `basicAllocator` is - /// 0, the currently installed default allocator is used. PartitionSyncDataQueryStatus(const PartitionSyncDataQueryStatus& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'PartitionSyncDataQueryStatus' having the + // value of the specified 'original' object. Use the optionally + // specified 'basicAllocator' to supply memory. If 'basicAllocator' is + // 0, the currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionSyncDataQueryStatus` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. PartitionSyncDataQueryStatus( PartitionSyncDataQueryStatus&& original) noexcept; + // Create an object of type 'PartitionSyncDataQueryStatus' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. - /// Create an object of type `PartitionSyncDataQueryStatus` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. PartitionSyncDataQueryStatus(PartitionSyncDataQueryStatus&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'PartitionSyncDataQueryStatus' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #endif - /// Destroy this object. ~PartitionSyncDataQueryStatus(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. PartitionSyncDataQueryStatus& operator=(const PartitionSyncDataQueryStatus& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. PartitionSyncDataQueryStatus& operator=(PartitionSyncDataQueryStatus&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "Status" attribute of this - /// object. Status& status(); + // Return a reference to the modifiable "Status" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "Status" attribute of this - /// object. const Status& status() const; + // Return a reference offering non-modifiable access to the "Status" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionSyncDataQueryStatus& lhs, + const PartitionSyncDataQueryStatus& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.status() == rhs.status(); + } + + friend bool operator!=(const PartitionSyncDataQueryStatus& lhs, + const PartitionSyncDataQueryStatus& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionSyncDataQueryStatus& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionSyncDataQueryStatus& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionSyncDataQueryStatus'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.partitionId()); + hashAppend(hashAlg, object.status()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionSyncDataQueryStatus& lhs, - const PartitionSyncDataQueryStatus& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionSyncDataQueryStatus& lhs, - const PartitionSyncDataQueryStatus& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionSyncDataQueryStatus& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionSyncDataQueryStatus`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& object); - } // close package namespace // TRAITS @@ -16566,18 +16345,25 @@ namespace bmqp_ctrlmsg { // class PartitionSyncStateQueryResponse // ===================================== -/// This type represents a message sent by a peer node in response to -/// PartitionSyncStateQueryQuery. -/// partitionId....: The corresponding partitionId primaryLeaseId.: Peer's -/// partition's primary leaseId sequenceNum....: Peer's partition's sequence -/// number lastSyncPoint..: Last sync point for this partition class PartitionSyncStateQueryResponse { + // This type represents a message sent by a peer node in response to + // PartitionSyncStateQueryQuery. + // partitionId....: The corresponding partitionId primaryLeaseId.: Peer's + // partition's primary leaseId sequenceNum....: Peer's partition's sequence + // number lastSyncPoint..: Last sync point for this partition + // INSTANCE DATA bsls::Types::Uint64 d_sequenceNum; SyncPointOffsetPair d_lastSyncPointOffsetPair; unsigned int d_primaryLeaseId; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const PartitionSyncStateQueryResponse& rhs) const; + public: // TYPES enum { @@ -16603,194 +16389,164 @@ class PartitionSyncStateQueryResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionSyncStateQueryResponse` having - /// the default value. PartitionSyncStateQueryResponse(); - - /// Create an object of type `PartitionSyncStateQueryResponse` having - /// the value of the specified `original` object. - PartitionSyncStateQueryResponse( - const PartitionSyncStateQueryResponse& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionSyncStateQueryResponse` having - /// the value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. - PartitionSyncStateQueryResponse( - PartitionSyncStateQueryResponse&& original) = default; -#endif - - /// Destroy this object. - ~PartitionSyncStateQueryResponse(); + // Create an object of type 'PartitionSyncStateQueryResponse' having + // the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionSyncStateQueryResponse& - operator=(const PartitionSyncStateQueryResponse& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionSyncStateQueryResponse& - operator=(PartitionSyncStateQueryResponse&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. - /// Return a reference to the modifiable "SequenceNum" attribute of this - /// object. bsls::Types::Uint64& sequenceNum(); + // Return a reference to the modifiable "SequenceNum" attribute of this + // object. - /// Return a reference to the modifiable "LastSyncPointOffsetPair" - /// attribute of this object. SyncPointOffsetPair& lastSyncPointOffsetPair(); + // Return a reference to the modifiable "LastSyncPointOffsetPair" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. - /// Return a reference to the non-modifiable "SequenceNum" attribute of - /// this object. bsls::Types::Uint64 sequenceNum() const; + // Return the value of the "SequenceNum" attribute of this object. - /// Return a reference to the non-modifiable "LastSyncPointOffsetPair" - /// attribute of this object. const SyncPointOffsetPair& lastSyncPointOffsetPair() const; + // Return a reference offering non-modifiable access to the + // "LastSyncPointOffsetPair" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionSyncStateQueryResponse& lhs, + const PartitionSyncStateQueryResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const PartitionSyncStateQueryResponse& lhs, + const PartitionSyncStateQueryResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionSyncStateQueryResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionSyncStateQueryResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionSyncStateQueryResponse'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionSyncStateQueryResponse& lhs, - const PartitionSyncStateQueryResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionSyncStateQueryResponse& lhs, - const PartitionSyncStateQueryResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionSyncStateQueryResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for -/// `PartitionSyncStateQueryResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& object); - } // close package namespace // TRAITS @@ -16804,9 +16560,10 @@ namespace bmqp_ctrlmsg { // class QueueAssignmentAdvisory // ============================= -/// This type represents a one way message sent by the leader to all -/// followers when a queue is assigned a partition. class QueueAssignmentAdvisory { + // This type represents a one way message sent by the leader to all + // followers when a queue is assigned a partition. + // INSTANCE DATA bsl::vector d_queues; LeaderMessageSequence d_sequenceNumber; @@ -16826,187 +16583,195 @@ class QueueAssignmentAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueAssignmentAdvisory` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit QueueAssignmentAdvisory(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueAssignmentAdvisory' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `QueueAssignmentAdvisory` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueAssignmentAdvisory(const QueueAssignmentAdvisory& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueAssignmentAdvisory' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueAssignmentAdvisory` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. QueueAssignmentAdvisory(QueueAssignmentAdvisory&& original) noexcept; + // Create an object of type 'QueueAssignmentAdvisory' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `QueueAssignmentAdvisory` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. QueueAssignmentAdvisory(QueueAssignmentAdvisory&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueAssignmentAdvisory' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~QueueAssignmentAdvisory(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueAssignmentAdvisory& operator=(const QueueAssignmentAdvisory& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueAssignmentAdvisory& operator=(QueueAssignmentAdvisory&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. - /// Return a reference to the modifiable "Queues" attribute of this - /// object. bsl::vector& queues(); + // Return a reference to the modifiable "Queues" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "Queues" attribute of this - /// object. const bsl::vector& queues() const; + // Return a reference offering non-modifiable access to the "Queues" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueAssignmentAdvisory& lhs, + const QueueAssignmentAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber() && + lhs.queues() == rhs.queues(); + } + + friend bool operator!=(const QueueAssignmentAdvisory& lhs, + const QueueAssignmentAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueAssignmentAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueAssignmentAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueAssignmentAdvisory'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumber()); + hashAppend(hashAlg, object.queues()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueAssignmentAdvisory& lhs, - const QueueAssignmentAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueAssignmentAdvisory& lhs, - const QueueAssignmentAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueAssignmentAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueAssignmentAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueAssignmentAdvisory& object); - } // close package namespace // TRAITS @@ -17020,17 +16785,24 @@ namespace bmqp_ctrlmsg { // class QueueUnAssignmentAdvisory // =============================== -/// This type represents a one way message sent by the primary of a -/// partition to all peers when queues are unmapped from that partition. -/// NOTE: The `partitionId` member of `QueueInfo` is unused (superseeded by -/// the `partitionId` at this level of the data structure). class QueueUnAssignmentAdvisory { + // This type represents a one way message sent by the primary of a + // partition to all peers when queues are unmapped from that partition. + // NOTE: The 'partitionId' member of 'QueueInfo' is unused (superseeded by + // the 'partitionId' at this level of the data structure). + // INSTANCE DATA bsl::vector d_queues; unsigned int d_primaryLeaseId; int d_primaryNodeId; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueUnAssignmentAdvisory& rhs) const; + public: // TYPES enum { @@ -17056,203 +16828,205 @@ class QueueUnAssignmentAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueUnAssignmentAdvisory` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit QueueUnAssignmentAdvisory(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUnAssignmentAdvisory' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `QueueUnAssignmentAdvisory` having the - /// value of the specified `original` object. Use the optionally - /// specified `basicAllocator` to supply memory. If `basicAllocator` is - /// 0, the currently installed default allocator is used. QueueUnAssignmentAdvisory(const QueueUnAssignmentAdvisory& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUnAssignmentAdvisory' having the + // value of the specified 'original' object. Use the optionally + // specified 'basicAllocator' to supply memory. If 'basicAllocator' is + // 0, the currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueUnAssignmentAdvisory` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. QueueUnAssignmentAdvisory(QueueUnAssignmentAdvisory&& original) noexcept; + // Create an object of type 'QueueUnAssignmentAdvisory' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. - /// Create an object of type `QueueUnAssignmentAdvisory` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. QueueUnAssignmentAdvisory(QueueUnAssignmentAdvisory&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueUnAssignmentAdvisory' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #endif - /// Destroy this object. ~QueueUnAssignmentAdvisory(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueUnAssignmentAdvisory& operator=(const QueueUnAssignmentAdvisory& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueUnAssignmentAdvisory& operator=(QueueUnAssignmentAdvisory&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PrimaryNodeId" attribute of - /// this object. int& primaryNodeId(); + // Return a reference to the modifiable "PrimaryNodeId" attribute of + // this object. - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "Queues" attribute of this - /// object. bsl::vector& queues(); + // Return a reference to the modifiable "Queues" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PrimaryNodeId" attribute - /// of this object. int primaryNodeId() const; + // Return the value of the "PrimaryNodeId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "Queues" attribute of this - /// object. const bsl::vector& queues() const; + // Return a reference offering non-modifiable access to the "Queues" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueUnAssignmentAdvisory& lhs, + const QueueUnAssignmentAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const QueueUnAssignmentAdvisory& lhs, + const QueueUnAssignmentAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueUnAssignmentAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueUnAssignmentAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueUnAssignmentAdvisory'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueUnAssignmentAdvisory& lhs, - const QueueUnAssignmentAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueUnAssignmentAdvisory& lhs, - const QueueUnAssignmentAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueUnAssignmentAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueUnAssignmentAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& object); - } // close package namespace // TRAITS @@ -17266,12 +17040,13 @@ namespace bmqp_ctrlmsg { // class QueueUnassignedAdvisory // ============================= -/// This type represents a one way message sent by the leader to all peers -/// when queues are unmapped from that partition. Once the logic is updated -/// such that leader broadcasts queue unassigned advisories, primary node -/// will no longer broadcastthem, and the other similar type -/// `QueueUnAssignmentAdvisory` will be removed. class QueueUnassignedAdvisory { + // This type represents a one way message sent by the leader to all peers + // when queues are unmapped from that partition. Once the logic is updated + // such that leader broadcasts queue unassigned advisories, primary node + // will no longer broadcastthem, and the other similar type + // 'QueueUnAssignmentAdvisory' will be removed. + // INSTANCE DATA bsl::vector d_queues; LeaderMessageSequence d_sequenceNumber; @@ -17279,6 +17054,12 @@ class QueueUnassignedAdvisory { int d_partitionId; int d_primaryNodeId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueUnassignedAdvisory& rhs) const; + public: // TYPES enum { @@ -17306,211 +17087,213 @@ class QueueUnassignedAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueUnassignedAdvisory` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit QueueUnassignedAdvisory(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUnassignedAdvisory' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `QueueUnassignedAdvisory` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueUnassignedAdvisory(const QueueUnassignedAdvisory& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUnassignedAdvisory' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueUnassignedAdvisory` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. QueueUnassignedAdvisory(QueueUnassignedAdvisory&& original) noexcept; + // Create an object of type 'QueueUnassignedAdvisory' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `QueueUnassignedAdvisory` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. QueueUnassignedAdvisory(QueueUnassignedAdvisory&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueUnassignedAdvisory' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~QueueUnassignedAdvisory(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueUnassignedAdvisory& operator=(const QueueUnassignedAdvisory& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueUnassignedAdvisory& operator=(QueueUnassignedAdvisory&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "PrimaryLeaseId" attribute of - /// this object. unsigned int& primaryLeaseId(); + // Return a reference to the modifiable "PrimaryLeaseId" attribute of + // this object. - /// Return a reference to the modifiable "PrimaryNodeId" attribute of - /// this object. int& primaryNodeId(); + // Return a reference to the modifiable "PrimaryNodeId" attribute of + // this object. - /// Return a reference to the modifiable "Queues" attribute of this - /// object. bsl::vector& queues(); + // Return a reference to the modifiable "Queues" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryLeaseId" attribute - /// of this object. unsigned int primaryLeaseId() const; + // Return the value of the "PrimaryLeaseId" attribute of this object. - /// Return a reference to the non-modifiable "PrimaryNodeId" attribute - /// of this object. int primaryNodeId() const; + // Return the value of the "PrimaryNodeId" attribute of this object. - /// Return a reference to the non-modifiable "Queues" attribute of this - /// object. const bsl::vector& queues() const; + // Return a reference offering non-modifiable access to the "Queues" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueUnassignedAdvisory& lhs, + const QueueUnassignedAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const QueueUnassignedAdvisory& lhs, + const QueueUnassignedAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueUnassignedAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueUnassignedAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueUnassignedAdvisory'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueUnassignedAdvisory& lhs, - const QueueUnassignedAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueUnassignedAdvisory& lhs, - const QueueUnassignedAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueUnassignedAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueUnassignedAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUnassignedAdvisory& object); - } // close package namespace // TRAITS @@ -17524,9 +17307,10 @@ namespace bmqp_ctrlmsg { // class QueueUpdateAdvisory // ========================= -/// This type represents a one way message sent by the leader to all -/// followers when appIds are added to, or removed from, a queue. class QueueUpdateAdvisory { + // This type represents a one way message sent by the leader to all + // followers when appIds are added to, or removed from, a queue. + // INSTANCE DATA bsl::vector d_queueUpdates; LeaderMessageSequence d_sequenceNumber; @@ -17549,186 +17333,194 @@ class QueueUpdateAdvisory { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `QueueUpdateAdvisory` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit QueueUpdateAdvisory(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUpdateAdvisory' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `QueueUpdateAdvisory` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. QueueUpdateAdvisory(const QueueUpdateAdvisory& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'QueueUpdateAdvisory' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QueueUpdateAdvisory` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. QueueUpdateAdvisory(QueueUpdateAdvisory&& original) noexcept; + // Create an object of type 'QueueUpdateAdvisory' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `QueueUpdateAdvisory` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. QueueUpdateAdvisory(QueueUpdateAdvisory&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'QueueUpdateAdvisory' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~QueueUpdateAdvisory(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QueueUpdateAdvisory& operator=(const QueueUpdateAdvisory& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. QueueUpdateAdvisory& operator=(QueueUpdateAdvisory&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SequenceNumber" attribute of - /// this object. LeaderMessageSequence& sequenceNumber(); + // Return a reference to the modifiable "SequenceNumber" attribute of + // this object. - /// Return a reference to the modifiable "QueueUpdates" attribute of - /// this object. bsl::vector& queueUpdates(); + // Return a reference to the modifiable "QueueUpdates" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SequenceNumber" attribute - /// of this object. const LeaderMessageSequence& sequenceNumber() const; + // Return a reference offering non-modifiable access to the + // "SequenceNumber" attribute of this object. - /// Return a reference to the non-modifiable "QueueUpdates" attribute of - /// this object. const bsl::vector& queueUpdates() const; + // Return a reference offering non-modifiable access to the + // "QueueUpdates" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QueueUpdateAdvisory& lhs, + const QueueUpdateAdvisory& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sequenceNumber() == rhs.sequenceNumber() && + lhs.queueUpdates() == rhs.queueUpdates(); + } + + friend bool operator!=(const QueueUpdateAdvisory& lhs, + const QueueUpdateAdvisory& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueUpdateAdvisory& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueUpdateAdvisory& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueUpdateAdvisory'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.sequenceNumber()); + hashAppend(hashAlg, object.queueUpdates()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const QueueUpdateAdvisory& lhs, - const QueueUpdateAdvisory& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const QueueUpdateAdvisory& lhs, - const QueueUpdateAdvisory& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueUpdateAdvisory& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `QueueUpdateAdvisory`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUpdateAdvisory& object); - } // close package namespace // TRAITS @@ -17742,11 +17534,12 @@ namespace bmqp_ctrlmsg { // class StateNotification // ======================= -/// Choice of all the various cluster state notifications sent from a node -/// in the cluster to a peer node with the capacity to take action upon the -/// notification. -/// leaderPassive..: Leader is passive class StateNotification { + // Choice of all the various cluster state notifications sent from a node + // in the cluster to a peer node with the capacity to take action upon the + // notification. + // leaderPassive..: Leader is passive + // INSTANCE DATA StateNotificationChoice d_choice; @@ -17765,164 +17558,144 @@ class StateNotification { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StateNotification` having the default - /// value. StateNotification(); - - /// Create an object of type `StateNotification` having the value of the - /// specified `original` object. - StateNotification(const StateNotification& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StateNotification` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - StateNotification(StateNotification&& original) = default; -#endif - - /// Destroy this object. - ~StateNotification(); + // Create an object of type 'StateNotification' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - StateNotification& operator=(const StateNotification& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - StateNotification& operator=(StateNotification&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Choice" attribute of this - /// object. StateNotificationChoice& choice(); + // Return a reference to the modifiable "Choice" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Choice" attribute of this - /// object. const StateNotificationChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StateNotification& lhs, + const StateNotification& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.choice() == rhs.choice(); + } + + friend bool operator!=(const StateNotification& lhs, + const StateNotification& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StateNotification& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StateNotification& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StateNotification'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.choice()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const StateNotification& lhs, - const StateNotification& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const StateNotification& lhs, - const StateNotification& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const StateNotification& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StateNotification`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StateNotification& object); - } // close package namespace // TRAITS @@ -17936,17 +17709,22 @@ namespace bmqp_ctrlmsg { // class StorageSyncRequest // ======================== -/// This type represents a request sent by a cluster node to a peer node in -/// the cluster requesting to initiate storage sync. -/// partitionId.....: The corresponding partitionId beginSyncPoint..: -/// Optional starting sync point of the missing storage endSyncPoint....: -/// Optional ending sync point of the missing storage class StorageSyncRequest { + // This type represents a request sent by a cluster node to a peer node in + // the cluster requesting to initiate storage sync. + // partitionId.....: The corresponding partitionId beginSyncPoint..: + // Optional starting sync point of the missing storage endSyncPoint....: + // Optional ending sync point of the missing storage + // INSTANCE DATA bdlb::NullableValue d_beginSyncPointOffsetPair; bdlb::NullableValue d_endSyncPointOffsetPair; int d_partitionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -17970,182 +17748,163 @@ class StorageSyncRequest { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StorageSyncRequest` having the default - /// value. StorageSyncRequest(); - - /// Create an object of type `StorageSyncRequest` having the value of - /// the specified `original` object. - StorageSyncRequest(const StorageSyncRequest& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StorageSyncRequest` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - StorageSyncRequest(StorageSyncRequest&& original) = default; -#endif - - /// Destroy this object. - ~StorageSyncRequest(); + // Create an object of type 'StorageSyncRequest' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - StorageSyncRequest& operator=(const StorageSyncRequest& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - StorageSyncRequest& operator=(StorageSyncRequest&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "PartitionId" attribute of this - /// object. int& partitionId(); + // Return a reference to the modifiable "PartitionId" attribute of this + // object. - /// Return a reference to the modifiable "BeginSyncPointOffsetPair" - /// attribute of this object. bdlb::NullableValue& beginSyncPointOffsetPair(); + // Return a reference to the modifiable "BeginSyncPointOffsetPair" + // attribute of this object. - /// Return a reference to the modifiable "EndSyncPointOffsetPair" - /// attribute of this object. bdlb::NullableValue& endSyncPointOffsetPair(); + // Return a reference to the modifiable "EndSyncPointOffsetPair" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "PartitionId" attribute of - /// this object. int partitionId() const; + // Return the value of the "PartitionId" attribute of this object. - /// Return a reference to the non-modifiable "BeginSyncPointOffsetPair" - /// attribute of this object. const bdlb::NullableValue& beginSyncPointOffsetPair() const; + // Return a reference offering non-modifiable access to the + // "BeginSyncPointOffsetPair" attribute of this object. - /// Return a reference to the non-modifiable "EndSyncPointOffsetPair" - /// attribute of this object. const bdlb::NullableValue& endSyncPointOffsetPair() const; + // Return a reference offering non-modifiable access to the + // "EndSyncPointOffsetPair" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StorageSyncRequest& lhs, + const StorageSyncRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.partitionId() == rhs.partitionId() && + lhs.beginSyncPointOffsetPair() == + rhs.beginSyncPointOffsetPair() && + lhs.endSyncPointOffsetPair() == rhs.endSyncPointOffsetPair(); + } + + friend bool operator!=(const StorageSyncRequest& lhs, + const StorageSyncRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StorageSyncRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StorageSyncRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StorageSyncRequest'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const StorageSyncRequest& lhs, - const StorageSyncRequest& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const StorageSyncRequest& lhs, - const StorageSyncRequest& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const StorageSyncRequest& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StorageSyncRequest`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StorageSyncRequest& object); - } // close package namespace // TRAITS @@ -18159,17 +17918,22 @@ namespace bmqp_ctrlmsg { // class Subscription // ================== -/// This complex type contains various parameters required by an upstream -/// node to configure subscription for a queue handle that has already been -/// created. -/// sId....................: subscription identifier -/// consumers..............: consumer parameters class Subscription { + // This complex type contains various parameters required by an upstream + // node to configure subscription for a queue handle that has already been + // created. + // sId....................: subscription identifier + // consumers..............: consumer parameters + // INSTANCE DATA bsl::vector d_consumers; Expression d_expression; unsigned int d_sId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -18193,195 +17957,470 @@ class Subscription { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `Subscription` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit Subscription(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Subscription' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `Subscription` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. Subscription(const Subscription& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Subscription' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `Subscription` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. Subscription(Subscription&& original) noexcept; + // Create an object of type 'Subscription' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `Subscription` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. Subscription(Subscription&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'Subscription' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~Subscription(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. Subscription& operator=(const Subscription& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. Subscription& operator=(Subscription&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "SId" attribute of this object. unsigned int& sId(); + // Return a reference to the modifiable "SId" attribute of this object. - /// Return a reference to the modifiable "Expression" attribute of this - /// object. Expression& expression(); + // Return a reference to the modifiable "Expression" attribute of this + // object. - /// Return a reference to the modifiable "Consumers" attribute of this - /// object. bsl::vector& consumers(); + // Return a reference to the modifiable "Consumers" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "SId" attribute of this - /// object. unsigned int sId() const; + // Return the value of the "SId" attribute of this object. - /// Return a reference to the non-modifiable "Expression" attribute of - /// this object. const Expression& expression() const; + // Return a reference offering non-modifiable access to the + // "Expression" attribute of this object. - /// Return a reference to the non-modifiable "Consumers" attribute of - /// this object. const bsl::vector& consumers() const; + // Return a reference offering non-modifiable access to the "Consumers" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const Subscription& lhs, const Subscription& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.sId() == rhs.sId() && + lhs.expression() == rhs.expression() && + lhs.consumers() == rhs.consumers(); + } + + friend bool operator!=(const Subscription& lhs, const Subscription& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const Subscription& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const Subscription& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'Subscription'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS +} // close package namespace + +// TRAITS + +BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( + bmqp_ctrlmsg::Subscription) + +namespace bmqp_ctrlmsg { + +// =========================== +// class AuthenticationMessage +// =========================== + +class AuthenticationMessage { + // This type is the top level type for any message being exchanged during + // authentication of a connection with the broker, whether by a BlazingMQ + // client or another broker. + // choice.: enumerates all the different type of authentication packets + // During negotiation, the process (whether a client using the libbmq SDK, + // or a bmqbrkr) sends a 'authenticateRequest' message; to which the remote + // peer will reply with a 'authenticateResponse' message. + + // INSTANCE DATA + union { + bsls::ObjectBuffer d_authenticateRequest; + bsls::ObjectBuffer d_authenticateResponse; + }; + + int d_selectionId; + bslma::Allocator* d_allocator_p; + + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const AuthenticationMessage& rhs) const; + + public: + // TYPES + + enum { + SELECTION_ID_UNDEFINED = -1, + SELECTION_ID_AUTHENTICATE_REQUEST = 0, + SELECTION_ID_AUTHENTICATE_RESPONSE = 1 + }; + + enum { NUM_SELECTIONS = 2 }; + + enum { + SELECTION_INDEX_AUTHENTICATE_REQUEST = 0, + SELECTION_INDEX_AUTHENTICATE_RESPONSE = 1 + }; + + // CONSTANTS + static const char CLASS_NAME[]; + + static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; + + // CLASS METHODS + static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. + + static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, + int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. + + // CREATORS + explicit AuthenticationMessage(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AuthenticationMessage' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. + + AuthenticationMessage(const AuthenticationMessage& original, + bslma::Allocator* basicAllocator = 0); + // Create an object of type 'AuthenticationMessage' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticationMessage(AuthenticationMessage&& original) noexcept; + // Create an object of type 'AuthenticationMessage' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + + AuthenticationMessage(AuthenticationMessage&& original, + bslma::Allocator* basicAllocator); + // Create an object of type 'AuthenticationMessage' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. +#endif + + ~AuthenticationMessage(); + // Destroy this object. + + // MANIPULATORS + AuthenticationMessage& operator=(const AuthenticationMessage& rhs); + // Assign to this object the value of the specified 'rhs' object. + +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticationMessage& operator=(AuthenticationMessage&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. +#endif + + void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). + + int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). + + int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). + + AuthenticateRequest& makeAuthenticateRequest(); + AuthenticateRequest& + makeAuthenticateRequest(const AuthenticateRequest& value); +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticateRequest& makeAuthenticateRequest(AuthenticateRequest&& value); +#endif + // Set the value of this object to be a "AuthenticateRequest" value. + // Optionally specify the 'value' of the "AuthenticateRequest". If + // 'value' is not specified, the default "AuthenticateRequest" value is + // used. + + AuthenticateResponse& makeAuthenticateResponse(); + AuthenticateResponse& + makeAuthenticateResponse(const AuthenticateResponse& value); +#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ + defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) + AuthenticateResponse& + makeAuthenticateResponse(AuthenticateResponse&& value); +#endif + // Set the value of this object to be a "AuthenticateResponse" value. + // Optionally specify the 'value' of the "AuthenticateResponse". If + // 'value' is not specified, the default "AuthenticateResponse" value + // is used. + + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + + AuthenticateRequest& authenticateRequest(); + // Return a reference to the modifiable "AuthenticateRequest" selection + // of this object if "AuthenticateRequest" is the current selection. + // The behavior is undefined unless "AuthenticateRequest" is the + // selection of this object. + + AuthenticateResponse& authenticateResponse(); + // Return a reference to the modifiable "AuthenticateResponse" + // selection of this object if "AuthenticateResponse" is the current + // selection. The behavior is undefined unless "AuthenticateResponse" + // is the selection of this object. -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const Subscription& lhs, const Subscription& rhs); + // ACCESSORS + bsl::ostream& + print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const Subscription& lhs, const Subscription& rhs); + int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. + + const AuthenticateRequest& authenticateRequest() const; + // Return a reference to the non-modifiable "AuthenticateRequest" + // selection of this object if "AuthenticateRequest" is the current + // selection. The behavior is undefined unless "AuthenticateRequest" + // is the selection of this object. + + const AuthenticateResponse& authenticateResponse() const; + // Return a reference to the non-modifiable "AuthenticateResponse" + // selection of this object if "AuthenticateResponse" is the current + // selection. The behavior is undefined unless "AuthenticateResponse" + // is the selection of this object. + + bool isAuthenticateRequestValue() const; + // Return 'true' if the value of this object is a "AuthenticateRequest" + // value, and return 'false' otherwise. + + bool isAuthenticateResponseValue() const; + // Return 'true' if the value of this object is a + // "AuthenticateResponse" value, and return 'false' otherwise. -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, const Subscription& rhs); + bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `Subscription`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::Subscription& object); + const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const AuthenticationMessage& lhs, + const AuthenticationMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'AuthenticationMessage' objects + // have the same value if either the selections in both objects have + // the same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const AuthenticationMessage& lhs, + const AuthenticationMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const AuthenticationMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const AuthenticationMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'AuthenticationMessage'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace // TRAITS -BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( - bmqp_ctrlmsg::Subscription) +BDLAT_DECL_CHOICE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( + bmqp_ctrlmsg::AuthenticationMessage) namespace bmqp_ctrlmsg { @@ -18389,9 +18428,10 @@ namespace bmqp_ctrlmsg { // class ConfigureQueueStreamResponse // ================================== -/// Response of a `ConfigureQueueStream` request, indicating success of the -/// operation. class ConfigureQueueStreamResponse { + // Response of a 'ConfigureQueueStream' request, indicating success of the + // operation. + // INSTANCE DATA ConfigureQueueStream d_request; @@ -18410,183 +18450,189 @@ class ConfigureQueueStreamResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ConfigureQueueStreamResponse` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit ConfigureQueueStreamResponse( bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureQueueStreamResponse' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `ConfigureQueueStreamResponse` having the - /// value of the specified `original` object. Use the optionally - /// specified `basicAllocator` to supply memory. If `basicAllocator` is - /// 0, the currently installed default allocator is used. ConfigureQueueStreamResponse(const ConfigureQueueStreamResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureQueueStreamResponse' having the + // value of the specified 'original' object. Use the optionally + // specified 'basicAllocator' to supply memory. If 'basicAllocator' is + // 0, the currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ConfigureQueueStreamResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. ConfigureQueueStreamResponse( ConfigureQueueStreamResponse&& original) noexcept; + // Create an object of type 'ConfigureQueueStreamResponse' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. - /// Create an object of type `ConfigureQueueStreamResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. ConfigureQueueStreamResponse(ConfigureQueueStreamResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ConfigureQueueStreamResponse' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #endif - /// Destroy this object. ~ConfigureQueueStreamResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ConfigureQueueStreamResponse& operator=(const ConfigureQueueStreamResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ConfigureQueueStreamResponse& operator=(ConfigureQueueStreamResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Request" attribute of this - /// object. ConfigureQueueStream& request(); + // Return a reference to the modifiable "Request" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Request" attribute of this - /// object. const ConfigureQueueStream& request() const; + // Return a reference offering non-modifiable access to the "Request" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ConfigureQueueStreamResponse& lhs, + const ConfigureQueueStreamResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.request() == rhs.request(); + } + + friend bool operator!=(const ConfigureQueueStreamResponse& lhs, + const ConfigureQueueStreamResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConfigureQueueStreamResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ConfigureQueueStreamResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ConfigureQueueStreamResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.request()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ConfigureQueueStreamResponse& lhs, - const ConfigureQueueStreamResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ConfigureQueueStreamResponse& lhs, - const ConfigureQueueStreamResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ConfigureQueueStreamResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ConfigureQueueStreamResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureQueueStreamResponse& object); - } // close package namespace // TRAITS @@ -18600,12 +18646,13 @@ namespace bmqp_ctrlmsg { // class FollowerClusterStateResponse // ================================== -/// This type represents a response to the `FollowerClusterStateRequest` -/// sent by the highest LSN follower to the leader, containing its cluster -/// state snapshot. -/// clusterStateSnapshot..: Encoded cluster state snapshot, in the form of a -/// leader advisory. class FollowerClusterStateResponse { + // This type represents a response to the 'FollowerClusterStateRequest' + // sent by the highest LSN follower to the leader, containing its cluster + // state snapshot. + // clusterStateSnapshot..: Encoded cluster state snapshot, in the form of a + // leader advisory. + // INSTANCE DATA LeaderAdvisory d_clusterStateSnapshot; @@ -18624,183 +18671,189 @@ class FollowerClusterStateResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `FollowerClusterStateResponse` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit FollowerClusterStateResponse( bslma::Allocator* basicAllocator = 0); + // Create an object of type 'FollowerClusterStateResponse' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `FollowerClusterStateResponse` having the - /// value of the specified `original` object. Use the optionally - /// specified `basicAllocator` to supply memory. If `basicAllocator` is - /// 0, the currently installed default allocator is used. FollowerClusterStateResponse(const FollowerClusterStateResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'FollowerClusterStateResponse' having the + // value of the specified 'original' object. Use the optionally + // specified 'basicAllocator' to supply memory. If 'basicAllocator' is + // 0, the currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `FollowerClusterStateResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. FollowerClusterStateResponse( FollowerClusterStateResponse&& original) noexcept; + // Create an object of type 'FollowerClusterStateResponse' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. - /// Create an object of type `FollowerClusterStateResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. FollowerClusterStateResponse(FollowerClusterStateResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'FollowerClusterStateResponse' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #endif - /// Destroy this object. ~FollowerClusterStateResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. FollowerClusterStateResponse& operator=(const FollowerClusterStateResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. FollowerClusterStateResponse& operator=(FollowerClusterStateResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "ClusterStateSnapshot" - /// attribute of this object. LeaderAdvisory& clusterStateSnapshot(); + // Return a reference to the modifiable "ClusterStateSnapshot" + // attribute of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "ClusterStateSnapshot" - /// attribute of this object. const LeaderAdvisory& clusterStateSnapshot() const; + // Return a reference offering non-modifiable access to the + // "ClusterStateSnapshot" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const FollowerClusterStateResponse& lhs, + const FollowerClusterStateResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.clusterStateSnapshot() == rhs.clusterStateSnapshot(); + } + + friend bool operator!=(const FollowerClusterStateResponse& lhs, + const FollowerClusterStateResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const FollowerClusterStateResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const FollowerClusterStateResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'FollowerClusterStateResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.clusterStateSnapshot()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const FollowerClusterStateResponse& lhs, - const FollowerClusterStateResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const FollowerClusterStateResponse& lhs, - const FollowerClusterStateResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const FollowerClusterStateResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `FollowerClusterStateResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerClusterStateResponse& object); - } // close package namespace // TRAITS @@ -18814,9 +18867,10 @@ namespace bmqp_ctrlmsg { // class LeaderSyncDataQueryResponse // ================================= -/// This type represents a response to the `LeaderSyncDataQuery` sent by the -/// follower to the leader. class LeaderSyncDataQueryResponse { + // This type represents a response to the 'LeaderSyncDataQuery' sent by the + // follower to the leader. + // INSTANCE DATA LeaderAdvisory d_leaderSyncData; @@ -18835,181 +18889,187 @@ class LeaderSyncDataQueryResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `LeaderSyncDataQueryResponse` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit LeaderSyncDataQueryResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'LeaderSyncDataQueryResponse' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `LeaderSyncDataQueryResponse` having the - /// value of the specified `original` object. Use the optionally - /// specified `basicAllocator` to supply memory. If `basicAllocator` is - /// 0, the currently installed default allocator is used. LeaderSyncDataQueryResponse(const LeaderSyncDataQueryResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'LeaderSyncDataQueryResponse' having the + // value of the specified 'original' object. Use the optionally + // specified 'basicAllocator' to supply memory. If 'basicAllocator' is + // 0, the currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `LeaderSyncDataQueryResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. LeaderSyncDataQueryResponse( LeaderSyncDataQueryResponse&& original) noexcept; + // Create an object of type 'LeaderSyncDataQueryResponse' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. - /// Create an object of type `LeaderSyncDataQueryResponse` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. LeaderSyncDataQueryResponse(LeaderSyncDataQueryResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'LeaderSyncDataQueryResponse' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #endif - /// Destroy this object. ~LeaderSyncDataQueryResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. LeaderSyncDataQueryResponse& operator=(const LeaderSyncDataQueryResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. LeaderSyncDataQueryResponse& operator=(LeaderSyncDataQueryResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "LeaderSyncData" attribute of - /// this object. LeaderAdvisory& leaderSyncData(); + // Return a reference to the modifiable "LeaderSyncData" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "LeaderSyncData" attribute - /// of this object. const LeaderAdvisory& leaderSyncData() const; + // Return a reference offering non-modifiable access to the + // "LeaderSyncData" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const LeaderSyncDataQueryResponse& lhs, + const LeaderSyncDataQueryResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.leaderSyncData() == rhs.leaderSyncData(); + } + + friend bool operator!=(const LeaderSyncDataQueryResponse& lhs, + const LeaderSyncDataQueryResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const LeaderSyncDataQueryResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const LeaderSyncDataQueryResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'LeaderSyncDataQueryResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.leaderSyncData()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const LeaderSyncDataQueryResponse& lhs, - const LeaderSyncDataQueryResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const LeaderSyncDataQueryResponse& lhs, - const LeaderSyncDataQueryResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const LeaderSyncDataQueryResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `LeaderSyncDataQueryResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& object); - } // close package namespace // TRAITS @@ -19023,18 +19083,19 @@ namespace bmqp_ctrlmsg { // class NegotiationMessage // ======================== -/// This type is the top level type for any message being exchanged during -/// negotiation of a connection with the broker, whether by a bmq client or -/// another broker. -/// choice.: enumerates all the different type of negotiation packets -/// During negotiation, the process (whether a client using the libbmq SDK, -/// or a bmqbrkr) sends a `clientIdentity` message; to which the remote peer -/// will reply with a `brokerResponse` message, embedding a `clientIdentity` -/// representing its own identity. In order to support reverse connection, -/// the negotiation will be 3 steps: first, a `reverseConnectionRequest` -/// will be sent, which will trigger the `normal` 2-steps negotiation to be -/// initiated by the remote peer. class NegotiationMessage { + // This type is the top level type for any message being exchanged during + // negotiation of a connection with the broker, whether by a BlazingMQ + // client or another broker. + // choice.: enumerates all the different type of negotiation packets + // During negotiation, the process (whether a client using the libbmq SDK, + // or a bmqbrkr) sends a 'clientIdentity' message; to which the remote peer + // will reply with a 'brokerResponse' message, embedding a 'clientIdentity' + // representing its own identity. In order to support reverse connection, + // the negotiation will be 3 steps: first, a 'reverseConnectionRequest' + // will be sent, which will trigger the 'normal' 2-steps negotiation to be + // initiated by the remote peer. + // INSTANCE DATA union { bsls::ObjectBuffer d_clientIdentity; @@ -19046,6 +19107,12 @@ class NegotiationMessage { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const NegotiationMessage& rhs) const; + public: // TYPES @@ -19070,79 +19137,76 @@ class NegotiationMessage { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `NegotiationMessage` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit NegotiationMessage(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'NegotiationMessage' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `NegotiationMessage` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. NegotiationMessage(const NegotiationMessage& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'NegotiationMessage' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `NegotiationMessage` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. NegotiationMessage(NegotiationMessage&& original) noexcept; + // Create an object of type 'NegotiationMessage' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `NegotiationMessage` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. NegotiationMessage(NegotiationMessage&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'NegotiationMessage' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~NegotiationMessage(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. NegotiationMessage& operator=(const NegotiationMessage& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. NegotiationMessage& operator=(NegotiationMessage&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). ClientIdentity& makeClientIdentity(); ClientIdentity& makeClientIdentity(const ClientIdentity& value); @@ -19177,123 +19241,135 @@ class NegotiationMessage { // "ReverseConnectionRequest". If 'value' is not specified, the // default "ReverseConnectionRequest" value is used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "ClientIdentity" selection of - /// this object if "ClientIdentity" is the current selection. The - /// behavior is undefined unless "ClientIdentity" is the selection of - /// this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + ClientIdentity& clientIdentity(); + // Return a reference to the modifiable "ClientIdentity" selection of + // this object if "ClientIdentity" is the current selection. The + // behavior is undefined unless "ClientIdentity" is the selection of + // this object. - /// Return a reference to the modifiable "BrokerResponse" selection of - /// this object if "BrokerResponse" is the current selection. The - /// behavior is undefined unless "BrokerResponse" is the selection of - /// this object. BrokerResponse& brokerResponse(); + // Return a reference to the modifiable "BrokerResponse" selection of + // this object if "BrokerResponse" is the current selection. The + // behavior is undefined unless "BrokerResponse" is the selection of + // this object. - /// Return a reference to the modifiable "ReverseConnectionRequest" - /// selection of this object if "ReverseConnectionRequest" is the - /// current selection. The behavior is undefined unless - /// "ReverseConnectionRequest" is the selection of this object. ReverseConnectionRequest& reverseConnectionRequest(); + // Return a reference to the modifiable "ReverseConnectionRequest" + // selection of this object if "ReverseConnectionRequest" is the + // current selection. The behavior is undefined unless + // "ReverseConnectionRequest" is the selection of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; - - /// Return a reference to the non-modifiable "ClientIdentity" selection - /// of this object if "ClientIdentity" is the current selection. The - /// behavior is undefined unless "ClientIdentity" is the selection of - /// this object. const ClientIdentity& clientIdentity() const; + // Return a reference to the non-modifiable "ClientIdentity" selection + // of this object if "ClientIdentity" is the current selection. The + // behavior is undefined unless "ClientIdentity" is the selection of + // this object. - /// Return a reference to the non-modifiable "BrokerResponse" selection - /// of this object if "BrokerResponse" is the current selection. The - /// behavior is undefined unless "BrokerResponse" is the selection of - /// this object. const BrokerResponse& brokerResponse() const; + // Return a reference to the non-modifiable "BrokerResponse" selection + // of this object if "BrokerResponse" is the current selection. The + // behavior is undefined unless "BrokerResponse" is the selection of + // this object. - /// Return a reference to the non-modifiable "ReverseConnectionRequest" - /// selection of this object if "ReverseConnectionRequest" is the - /// current selection. The behavior is undefined unless - /// "ReverseConnectionRequest" is the selection of this object. const ReverseConnectionRequest& reverseConnectionRequest() const; + // Return a reference to the non-modifiable "ReverseConnectionRequest" + // selection of this object if "ReverseConnectionRequest" is the + // current selection. The behavior is undefined unless + // "ReverseConnectionRequest" is the selection of this object. - /// Return `true` if the value of this object is a "ClientIdentity" - /// value, and return `false` otherwise. bool isClientIdentityValue() const; + // Return 'true' if the value of this object is a "ClientIdentity" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "BrokerResponse" - /// value, and return `false` otherwise. bool isBrokerResponseValue() const; + // Return 'true' if the value of this object is a "BrokerResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "ReverseConnectionRequest" value, and return `false` otherwise. bool isReverseConnectionRequestValue() const; + // Return 'true' if the value of this object is a + // "ReverseConnectionRequest" value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const NegotiationMessage& lhs, + const NegotiationMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'NegotiationMessage' objects have + // the same value if either the selections in both objects have the + // same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const NegotiationMessage& lhs, + const NegotiationMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const NegotiationMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const NegotiationMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'NegotiationMessage'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `NegotiationMessage` objects have the -/// same value if either the selections in both objects have the same ids and -/// the same values, or both selections are undefined. -inline bool operator==(const NegotiationMessage& lhs, - const NegotiationMessage& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const NegotiationMessage& lhs, - const NegotiationMessage& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const NegotiationMessage& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `NegotiationMessage`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::NegotiationMessage& object); - } // close package namespace // TRAITS @@ -19307,19 +19383,24 @@ namespace bmqp_ctrlmsg { // class OpenQueueResponse // ======================= -/// Response of an `OpenQueue` request indicating success of the operation. -/// -/// originalRequest......: original request this `OpenQueueResponse` is the -/// response of routingConfiguration.: routing info to be used by the -/// downstream node to distribute messages to consumers attached to it -/// deduplicationTimeMs........: timeout, in milliseconds, to keep GUID of -/// PUT message for the purpose of detecting duplicate PUTs. class OpenQueueResponse { + // Response of an 'OpenQueue' request indicating success of the operation. + // + // originalRequest......: original request this 'OpenQueueResponse' is the + // response of routingConfiguration.: routing info to be used by the + // downstream node to distribute messages to consumers attached to it + // deduplicationTimeMs........: timeout, in milliseconds, to keep GUID of + // PUT message for the purpose of detecting duplicate PUTs. + // INSTANCE DATA RoutingConfiguration d_routingConfiguration; OpenQueue d_originalRequest; int d_deduplicationTimeMs; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -19345,194 +19426,201 @@ class OpenQueueResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `OpenQueueResponse` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit OpenQueueResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenQueueResponse' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `OpenQueueResponse` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. OpenQueueResponse(const OpenQueueResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenQueueResponse' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `OpenQueueResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. OpenQueueResponse(OpenQueueResponse&& original) noexcept; + // Create an object of type 'OpenQueueResponse' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `OpenQueueResponse` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. OpenQueueResponse(OpenQueueResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'OpenQueueResponse' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~OpenQueueResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. OpenQueueResponse& operator=(const OpenQueueResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. OpenQueueResponse& operator=(OpenQueueResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "OriginalRequest" attribute of - /// this object. OpenQueue& originalRequest(); + // Return a reference to the modifiable "OriginalRequest" attribute of + // this object. - /// Return a reference to the modifiable "RoutingConfiguration" - /// attribute of this object. RoutingConfiguration& routingConfiguration(); + // Return a reference to the modifiable "RoutingConfiguration" + // attribute of this object. - /// Return a reference to the modifiable "DeduplicationTimeMs" attribute - /// of this object. int& deduplicationTimeMs(); + // Return a reference to the modifiable "DeduplicationTimeMs" attribute + // of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "OriginalRequest" attribute - /// of this object. const OpenQueue& originalRequest() const; + // Return a reference offering non-modifiable access to the + // "OriginalRequest" attribute of this object. - /// Return a reference to the non-modifiable "RoutingConfiguration" - /// attribute of this object. const RoutingConfiguration& routingConfiguration() const; + // Return a reference offering non-modifiable access to the + // "RoutingConfiguration" attribute of this object. - /// Return a reference to the non-modifiable "DeduplicationTimeMs" - /// attribute of this object. int deduplicationTimeMs() const; + // Return the value of the "DeduplicationTimeMs" attribute of this + // object. + + // HIDDEN FRIENDS + friend bool operator==(const OpenQueueResponse& lhs, + const OpenQueueResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.originalRequest() == rhs.originalRequest() && + lhs.routingConfiguration() == rhs.routingConfiguration() && + lhs.deduplicationTimeMs() == rhs.deduplicationTimeMs(); + } + + friend bool operator!=(const OpenQueueResponse& lhs, + const OpenQueueResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const OpenQueueResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const OpenQueueResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'OpenQueueResponse'. + { + object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const OpenQueueResponse& lhs, - const OpenQueueResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const OpenQueueResponse& lhs, - const OpenQueueResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const OpenQueueResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `OpenQueueResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::OpenQueueResponse& object); - } // close package namespace // TRAITS @@ -19546,12 +19634,13 @@ namespace bmqp_ctrlmsg { // class PartitionMessage // ====================== -/// This type is the top level type for any message being sent by a node -/// inside the cluster to one or more peer nodes to exchange partition -/// state. Note that this type of message is not sent outside the cluster. -/// -/// choice.: enumerates all the different types of partition messages class PartitionMessage { + // This type is the top level type for any message being sent by a node + // inside the cluster to one or more peer nodes to exchange partition + // state. Note that this type of message is not sent outside the cluster. + // + // choice.: enumerates all the different types of partition messages + // INSTANCE DATA PartitionMessageChoice d_choice; @@ -19570,164 +19659,144 @@ class PartitionMessage { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `PartitionMessage` having the default - /// value. PartitionMessage(); - - /// Create an object of type `PartitionMessage` having the value of the - /// specified `original` object. - PartitionMessage(const PartitionMessage& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `PartitionMessage` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - PartitionMessage(PartitionMessage&& original) = default; -#endif - - /// Destroy this object. - ~PartitionMessage(); + // Create an object of type 'PartitionMessage' having the default + // value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - PartitionMessage& operator=(const PartitionMessage& rhs); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. - PartitionMessage& operator=(PartitionMessage&& rhs); -#endif - - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Choice" attribute of this - /// object. PartitionMessageChoice& choice(); + // Return a reference to the modifiable "Choice" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Choice" attribute of this - /// object. const PartitionMessageChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const PartitionMessage& lhs, + const PartitionMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.choice() == rhs.choice(); + } + + friend bool operator!=(const PartitionMessage& lhs, + const PartitionMessage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PartitionMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PartitionMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'PartitionMessage'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.choice()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const PartitionMessage& lhs, - const PartitionMessage& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const PartitionMessage& lhs, - const PartitionMessage& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const PartitionMessage& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `PartitionMessage`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionMessage& object); - } // close package namespace // TRAITS @@ -19740,13 +19809,14 @@ namespace bmqp_ctrlmsg { // class StreamParameters // ====================== -/// This request contains parameters advertised by the downstream node so -/// that upstream node can configure subscriptions associated with the given -/// queue on the downstream node. -/// appId..................: Application-provided unique string identifier -/// for a given fanout consumer subscriptions..........: Parameters for -/// configuring subscriptions class StreamParameters { + // This request contains parameters advertised by the downstream node so + // that upstream node can configure subscriptions associated with the given + // queue on the downstream node. + // appId..................: Application-provided unique string identifier + // for a given fanout consumer subscriptions..........: Parameters for + // configuring subscriptions + // INSTANCE DATA bsl::vector d_subscriptions; bsl::string d_appId; @@ -19768,186 +19838,194 @@ class StreamParameters { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `StreamParameters` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit StreamParameters(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'StreamParameters' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `StreamParameters` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. StreamParameters(const StreamParameters& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'StreamParameters' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StreamParameters` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. StreamParameters(StreamParameters&& original) noexcept; + // Create an object of type 'StreamParameters' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `StreamParameters` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. StreamParameters(StreamParameters&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'StreamParameters' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~StreamParameters(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. StreamParameters& operator=(const StreamParameters& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. StreamParameters& operator=(StreamParameters&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "AppId" attribute of this - /// object. bsl::string& appId(); + // Return a reference to the modifiable "AppId" attribute of this + // object. - /// Return a reference to the modifiable "Subscriptions" attribute of - /// this object. bsl::vector& subscriptions(); + // Return a reference to the modifiable "Subscriptions" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "AppId" attribute of this - /// object. const bsl::string& appId() const; + // Return a reference offering non-modifiable access to the "AppId" + // attribute of this object. - /// Return a reference to the non-modifiable "Subscriptions" attribute - /// of this object. const bsl::vector& subscriptions() const; + // Return a reference offering non-modifiable access to the + // "Subscriptions" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StreamParameters& lhs, + const StreamParameters& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.appId() == rhs.appId() && + lhs.subscriptions() == rhs.subscriptions(); + } + + friend bool operator!=(const StreamParameters& lhs, + const StreamParameters& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StreamParameters& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StreamParameters& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StreamParameters'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.appId()); + hashAppend(hashAlg, object.subscriptions()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const StreamParameters& lhs, - const StreamParameters& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const StreamParameters& lhs, - const StreamParameters& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const StreamParameters& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `StreamParameters`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StreamParameters& object); - } // close package namespace // TRAITS @@ -19977,6 +20055,12 @@ class ClusterStateFSMMessageChoice { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ClusterStateFSMMessageChoice& rhs) const; + public: // TYPES @@ -20007,84 +20091,81 @@ class ClusterStateFSMMessageChoice { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ClusterStateFSMMessageChoice` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit ClusterStateFSMMessageChoice( bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterStateFSMMessageChoice' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `ClusterStateFSMMessageChoice` having the - /// value of the specified `original` object. Use the optionally - /// specified `basicAllocator` to supply memory. If `basicAllocator` is - /// 0, the currently installed default allocator is used. ClusterStateFSMMessageChoice(const ClusterStateFSMMessageChoice& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterStateFSMMessageChoice' having the + // value of the specified 'original' object. Use the optionally + // specified 'basicAllocator' to supply memory. If 'basicAllocator' is + // 0, the currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClusterStateFSMMessageChoice` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. ClusterStateFSMMessageChoice( ClusterStateFSMMessageChoice&& original) noexcept; + // Create an object of type 'ClusterStateFSMMessageChoice' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. - /// Create an object of type `ClusterStateFSMMessageChoice` having the - /// value of the specified `original` object. After performing this - /// action, the `original` object will be left in a valid, but - /// unspecified state. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. ClusterStateFSMMessageChoice(ClusterStateFSMMessageChoice&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ClusterStateFSMMessageChoice' having the + // value of the specified 'original' object. After performing this + // action, the 'original' object will be left in a valid, but + // unspecified state. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. #endif - /// Destroy this object. ~ClusterStateFSMMessageChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ClusterStateFSMMessageChoice& operator=(const ClusterStateFSMMessageChoice& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ClusterStateFSMMessageChoice& operator=(ClusterStateFSMMessageChoice&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). FollowerLSNRequest& makeFollowerLSNRequest(); FollowerLSNRequest& @@ -20161,173 +20242,186 @@ class ClusterStateFSMMessageChoice { // "FollowerClusterStateResponse". If 'value' is not specified, the // default "FollowerClusterStateResponse" value is used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "FollowerLSNRequest" selection - /// of this object if "FollowerLSNRequest" is the current selection. - /// The behavior is undefined unless "FollowerLSNRequest" is the - /// selection of this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + FollowerLSNRequest& followerLSNRequest(); + // Return a reference to the modifiable "FollowerLSNRequest" selection + // of this object if "FollowerLSNRequest" is the current selection. + // The behavior is undefined unless "FollowerLSNRequest" is the + // selection of this object. - /// Return a reference to the modifiable "FollowerLSNResponse" selection - /// of this object if "FollowerLSNResponse" is the current selection. - /// The behavior is undefined unless "FollowerLSNResponse" is the - /// selection of this object. FollowerLSNResponse& followerLSNResponse(); + // Return a reference to the modifiable "FollowerLSNResponse" selection + // of this object if "FollowerLSNResponse" is the current selection. + // The behavior is undefined unless "FollowerLSNResponse" is the + // selection of this object. - /// Return a reference to the modifiable "RegistrationRequest" selection - /// of this object if "RegistrationRequest" is the current selection. - /// The behavior is undefined unless "RegistrationRequest" is the - /// selection of this object. RegistrationRequest& registrationRequest(); + // Return a reference to the modifiable "RegistrationRequest" selection + // of this object if "RegistrationRequest" is the current selection. + // The behavior is undefined unless "RegistrationRequest" is the + // selection of this object. - /// Return a reference to the modifiable "RegistrationResponse" - /// selection of this object if "RegistrationResponse" is the current - /// selection. The behavior is undefined unless "RegistrationResponse" - /// is the selection of this object. RegistrationResponse& registrationResponse(); + // Return a reference to the modifiable "RegistrationResponse" + // selection of this object if "RegistrationResponse" is the current + // selection. The behavior is undefined unless "RegistrationResponse" + // is the selection of this object. - /// Return a reference to the modifiable "FollowerClusterStateRequest" - /// selection of this object if "FollowerClusterStateRequest" is the - /// current selection. The behavior is undefined unless - /// "FollowerClusterStateRequest" is the selection of this object. FollowerClusterStateRequest& followerClusterStateRequest(); + // Return a reference to the modifiable "FollowerClusterStateRequest" + // selection of this object if "FollowerClusterStateRequest" is the + // current selection. The behavior is undefined unless + // "FollowerClusterStateRequest" is the selection of this object. - /// Return a reference to the modifiable "FollowerClusterStateResponse" - /// selection of this object if "FollowerClusterStateResponse" is the - /// current selection. The behavior is undefined unless - /// "FollowerClusterStateResponse" is the selection of this object. FollowerClusterStateResponse& followerClusterStateResponse(); + // Return a reference to the modifiable "FollowerClusterStateResponse" + // selection of this object if "FollowerClusterStateResponse" is the + // current selection. The behavior is undefined unless + // "FollowerClusterStateResponse" is the selection of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; - - /// Return a reference to the non-modifiable "FollowerLSNRequest" - /// selection of this object if "FollowerLSNRequest" is the current - /// selection. The behavior is undefined unless "FollowerLSNRequest" is - /// the selection of this object. const FollowerLSNRequest& followerLSNRequest() const; + // Return a reference to the non-modifiable "FollowerLSNRequest" + // selection of this object if "FollowerLSNRequest" is the current + // selection. The behavior is undefined unless "FollowerLSNRequest" is + // the selection of this object. - /// Return a reference to the non-modifiable "FollowerLSNResponse" - /// selection of this object if "FollowerLSNResponse" is the current - /// selection. The behavior is undefined unless "FollowerLSNResponse" - /// is the selection of this object. const FollowerLSNResponse& followerLSNResponse() const; + // Return a reference to the non-modifiable "FollowerLSNResponse" + // selection of this object if "FollowerLSNResponse" is the current + // selection. The behavior is undefined unless "FollowerLSNResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable "RegistrationRequest" - /// selection of this object if "RegistrationRequest" is the current - /// selection. The behavior is undefined unless "RegistrationRequest" - /// is the selection of this object. const RegistrationRequest& registrationRequest() const; + // Return a reference to the non-modifiable "RegistrationRequest" + // selection of this object if "RegistrationRequest" is the current + // selection. The behavior is undefined unless "RegistrationRequest" + // is the selection of this object. - /// Return a reference to the non-modifiable "RegistrationResponse" - /// selection of this object if "RegistrationResponse" is the current - /// selection. The behavior is undefined unless "RegistrationResponse" - /// is the selection of this object. const RegistrationResponse& registrationResponse() const; + // Return a reference to the non-modifiable "RegistrationResponse" + // selection of this object if "RegistrationResponse" is the current + // selection. The behavior is undefined unless "RegistrationResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable - /// "FollowerClusterStateRequest" selection of this object if - /// "FollowerClusterStateRequest" is the current selection. The - /// behavior is undefined unless "FollowerClusterStateRequest" is the - /// selection of this object. const FollowerClusterStateRequest& followerClusterStateRequest() const; + // Return a reference to the non-modifiable + // "FollowerClusterStateRequest" selection of this object if + // "FollowerClusterStateRequest" is the current selection. The + // behavior is undefined unless "FollowerClusterStateRequest" is the + // selection of this object. - /// Return a reference to the non-modifiable - /// "FollowerClusterStateResponse" selection of this object if - /// "FollowerClusterStateResponse" is the current selection. The - /// behavior is undefined unless "FollowerClusterStateResponse" is the - /// selection of this object. const FollowerClusterStateResponse& followerClusterStateResponse() const; + // Return a reference to the non-modifiable + // "FollowerClusterStateResponse" selection of this object if + // "FollowerClusterStateResponse" is the current selection. The + // behavior is undefined unless "FollowerClusterStateResponse" is the + // selection of this object. - /// Return `true` if the value of this object is a "FollowerLSNRequest" - /// value, and return `false` otherwise. bool isFollowerLSNRequestValue() const; + // Return 'true' if the value of this object is a "FollowerLSNRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "FollowerLSNResponse" - /// value, and return `false` otherwise. bool isFollowerLSNResponseValue() const; + // Return 'true' if the value of this object is a "FollowerLSNResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "RegistrationRequest" - /// value, and return `false` otherwise. bool isRegistrationRequestValue() const; + // Return 'true' if the value of this object is a "RegistrationRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "RegistrationResponse" value, and return `false` otherwise. bool isRegistrationResponseValue() const; + // Return 'true' if the value of this object is a + // "RegistrationResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "FollowerClusterStateRequest" value, and return `false` otherwise. bool isFollowerClusterStateRequestValue() const; + // Return 'true' if the value of this object is a + // "FollowerClusterStateRequest" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "FollowerClusterStateResponse" value, and return `false` otherwise. bool isFollowerClusterStateResponseValue() const; + // Return 'true' if the value of this object is a + // "FollowerClusterStateResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ClusterStateFSMMessageChoice& lhs, + const ClusterStateFSMMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'ClusterStateFSMMessageChoice' + // objects have the same value if either the selections in both objects + // have the same ids and the same values, or both selections are + // undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ClusterStateFSMMessageChoice& lhs, + const ClusterStateFSMMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClusterStateFSMMessageChoice& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ClusterStateFSMMessageChoice& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClusterStateFSMMessageChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `ClusterStateFSMMessageChoice` objects -/// have the same value if either the selections in both objects have the same -/// ids and the same values, or both selections are undefined. -inline bool operator==(const ClusterStateFSMMessageChoice& lhs, - const ClusterStateFSMMessageChoice& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const ClusterStateFSMMessageChoice& lhs, - const ClusterStateFSMMessageChoice& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClusterStateFSMMessageChoice& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClusterStateFSMMessageChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& object); - } // close package namespace // TRAITS @@ -20341,12 +20435,13 @@ namespace bmqp_ctrlmsg { // class ConfigureStream // ===================== -/// This request contains parameters advertised by the downstream node so -/// that upstream node can configure subscriptions associated with the given -/// queue on the downstream node. -/// qId....................: Id identifying the queue -/// subscriptionParameters.: Parameters for configuring subscriptions class ConfigureStream { + // This request contains parameters advertised by the downstream node so + // that upstream node can configure subscriptions associated with the given + // queue on the downstream node. + // qId....................: Id identifying the queue + // subscriptionParameters.: Parameters for configuring subscriptions + // INSTANCE DATA StreamParameters d_streamParameters; unsigned int d_qId; @@ -20366,183 +20461,192 @@ class ConfigureStream { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ConfigureStream` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit ConfigureStream(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureStream' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `ConfigureStream` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ConfigureStream(const ConfigureStream& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureStream' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ConfigureStream` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ConfigureStream(ConfigureStream&& original) noexcept; + // Create an object of type 'ConfigureStream' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ConfigureStream` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ConfigureStream(ConfigureStream&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ConfigureStream' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ConfigureStream(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ConfigureStream& operator=(const ConfigureStream& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ConfigureStream& operator=(ConfigureStream&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "QId" attribute of this object. unsigned int& qId(); + // Return a reference to the modifiable "QId" attribute of this object. - /// Return a reference to the modifiable "StreamParameters" attribute of - /// this object. StreamParameters& streamParameters(); + // Return a reference to the modifiable "StreamParameters" attribute of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "QId" attribute of this - /// object. unsigned int qId() const; + // Return the value of the "QId" attribute of this object. - /// Return a reference to the non-modifiable "StreamParameters" - /// attribute of this object. const StreamParameters& streamParameters() const; + // Return a reference offering non-modifiable access to the + // "StreamParameters" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ConfigureStream& lhs, + const ConfigureStream& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.qId() == rhs.qId() && + lhs.streamParameters() == rhs.streamParameters(); + } + + friend bool operator!=(const ConfigureStream& lhs, + const ConfigureStream& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConfigureStream& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ConfigureStream& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ConfigureStream'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.qId()); + hashAppend(hashAlg, object.streamParameters()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ConfigureStream& lhs, const ConfigureStream& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ConfigureStream& lhs, const ConfigureStream& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ConfigureStream& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ConfigureStream`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureStream& object); - } // close package namespace // TRAITS @@ -20556,12 +20660,13 @@ namespace bmqp_ctrlmsg { // class ClusterStateFSMMessage // ============================ -/// This type is the top level type for any message being sent by a node -/// inside the cluster to one or more peer nodes that triggers an event in -/// the Cluster State FSM. Note that this type of message is not sent -/// outside the cluster. -/// choice.: enumerates all the different types of cluster state messages class ClusterStateFSMMessage { + // This type is the top level type for any message being sent by a node + // inside the cluster to one or more peer nodes that triggers an event in + // the Cluster State FSM. Note that this type of message is not sent + // outside the cluster. + // choice.: enumerates all the different types of cluster state messages + // INSTANCE DATA ClusterStateFSMMessageChoice d_choice; @@ -20580,179 +20685,185 @@ class ClusterStateFSMMessage { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ClusterStateFSMMessage` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit ClusterStateFSMMessage(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterStateFSMMessage' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `ClusterStateFSMMessage` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ClusterStateFSMMessage(const ClusterStateFSMMessage& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterStateFSMMessage' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClusterStateFSMMessage` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. ClusterStateFSMMessage(ClusterStateFSMMessage&& original) noexcept; + // Create an object of type 'ClusterStateFSMMessage' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `ClusterStateFSMMessage` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. ClusterStateFSMMessage(ClusterStateFSMMessage&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ClusterStateFSMMessage' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~ClusterStateFSMMessage(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ClusterStateFSMMessage& operator=(const ClusterStateFSMMessage& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ClusterStateFSMMessage& operator=(ClusterStateFSMMessage&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Choice" attribute of this - /// object. ClusterStateFSMMessageChoice& choice(); + // Return a reference to the modifiable "Choice" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Choice" attribute of this - /// object. const ClusterStateFSMMessageChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ClusterStateFSMMessage& lhs, + const ClusterStateFSMMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.choice() == rhs.choice(); + } + + friend bool operator!=(const ClusterStateFSMMessage& lhs, + const ClusterStateFSMMessage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClusterStateFSMMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ClusterStateFSMMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClusterStateFSMMessage'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.choice()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ClusterStateFSMMessage& lhs, - const ClusterStateFSMMessage& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ClusterStateFSMMessage& lhs, - const ClusterStateFSMMessage& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClusterStateFSMMessage& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClusterStateFSMMessage`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterStateFSMMessage& object); - } // close package namespace // TRAITS @@ -20766,9 +20877,10 @@ namespace bmqp_ctrlmsg { // class ConfigureStreamResponse // ============================= -/// Response of a `ConfigureStream` request, indicating success of the -/// operation. class ConfigureStreamResponse { + // Response of a 'ConfigureStream' request, indicating success of the + // operation. + // INSTANCE DATA ConfigureStream d_request; @@ -20787,179 +20899,185 @@ class ConfigureStreamResponse { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ConfigureStreamResponse` having the - /// default value. Use the optionally specified `basicAllocator` to - /// supply memory. If `basicAllocator` is 0, the currently installed - /// default allocator is used. explicit ConfigureStreamResponse(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureStreamResponse' having the + // default value. Use the optionally specified 'basicAllocator' to + // supply memory. If 'basicAllocator' is 0, the currently installed + // default allocator is used. - /// Create an object of type `ConfigureStreamResponse` having the value - /// of the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ConfigureStreamResponse(const ConfigureStreamResponse& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureStreamResponse' having the value + // of the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ConfigureStreamResponse` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. ConfigureStreamResponse(ConfigureStreamResponse&& original) noexcept; + // Create an object of type 'ConfigureStreamResponse' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. - /// Create an object of type `ConfigureStreamResponse` having the value - /// of the specified `original` object. After performing this action, - /// the `original` object will be left in a valid, but unspecified - /// state. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. ConfigureStreamResponse(ConfigureStreamResponse&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ConfigureStreamResponse' having the value + // of the specified 'original' object. After performing this action, + // the 'original' object will be left in a valid, but unspecified + // state. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. #endif - /// Destroy this object. ~ConfigureStreamResponse(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ConfigureStreamResponse& operator=(const ConfigureStreamResponse& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ConfigureStreamResponse& operator=(ConfigureStreamResponse&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Request" attribute of this - /// object. ConfigureStream& request(); + // Return a reference to the modifiable "Request" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Request" attribute of this - /// object. const ConfigureStream& request() const; + // Return a reference offering non-modifiable access to the "Request" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ConfigureStreamResponse& lhs, + const ConfigureStreamResponse& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.request() == rhs.request(); + } + + friend bool operator!=(const ConfigureStreamResponse& lhs, + const ConfigureStreamResponse& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConfigureStreamResponse& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ConfigureStreamResponse& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ConfigureStreamResponse'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.request()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ConfigureStreamResponse& lhs, - const ConfigureStreamResponse& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ConfigureStreamResponse& lhs, - const ConfigureStreamResponse& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ConfigureStreamResponse& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ConfigureStreamResponse`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureStreamResponse& object); - } // close package namespace // TRAITS @@ -21019,6 +21137,12 @@ class ClusterMessageChoice { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ClusterMessageChoice& rhs) const; + public: // TYPES @@ -21097,79 +21221,76 @@ class ClusterMessageChoice { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ClusterMessageChoice` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit ClusterMessageChoice(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterMessageChoice' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `ClusterMessageChoice` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ClusterMessageChoice(const ClusterMessageChoice& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterMessageChoice' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClusterMessageChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ClusterMessageChoice(ClusterMessageChoice&& original) noexcept; + // Create an object of type 'ClusterMessageChoice' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ClusterMessageChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ClusterMessageChoice(ClusterMessageChoice&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ClusterMessageChoice' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ClusterMessageChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ClusterMessageChoice& operator=(const ClusterMessageChoice& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ClusterMessageChoice& operator=(ClusterMessageChoice&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). PartitionPrimaryAdvisory& makePartitionPrimaryAdvisory(); PartitionPrimaryAdvisory& @@ -21541,564 +21662,576 @@ class ClusterMessageChoice { // 'value' is not specified, the default "PartitionMessage" value is // used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "PartitionPrimaryAdvisory" - /// selection of this object if "PartitionPrimaryAdvisory" is the - /// current selection. The behavior is undefined unless - /// "PartitionPrimaryAdvisory" is the selection of this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + PartitionPrimaryAdvisory& partitionPrimaryAdvisory(); + // Return a reference to the modifiable "PartitionPrimaryAdvisory" + // selection of this object if "PartitionPrimaryAdvisory" is the + // current selection. The behavior is undefined unless + // "PartitionPrimaryAdvisory" is the selection of this object. - /// Return a reference to the modifiable "LeaderAdvisory" selection of - /// this object if "LeaderAdvisory" is the current selection. The - /// behavior is undefined unless "LeaderAdvisory" is the selection of - /// this object. LeaderAdvisory& leaderAdvisory(); + // Return a reference to the modifiable "LeaderAdvisory" selection of + // this object if "LeaderAdvisory" is the current selection. The + // behavior is undefined unless "LeaderAdvisory" is the selection of + // this object. - /// Return a reference to the modifiable "QueueAssignmentAdvisory" - /// selection of this object if "QueueAssignmentAdvisory" is the current - /// selection. The behavior is undefined unless - /// "QueueAssignmentAdvisory" is the selection of this object. QueueAssignmentAdvisory& queueAssignmentAdvisory(); + // Return a reference to the modifiable "QueueAssignmentAdvisory" + // selection of this object if "QueueAssignmentAdvisory" is the current + // selection. The behavior is undefined unless + // "QueueAssignmentAdvisory" is the selection of this object. - /// Return a reference to the modifiable "NodeStatusAdvisory" selection - /// of this object if "NodeStatusAdvisory" is the current selection. - /// The behavior is undefined unless "NodeStatusAdvisory" is the - /// selection of this object. NodeStatusAdvisory& nodeStatusAdvisory(); + // Return a reference to the modifiable "NodeStatusAdvisory" selection + // of this object if "NodeStatusAdvisory" is the current selection. + // The behavior is undefined unless "NodeStatusAdvisory" is the + // selection of this object. - /// Return a reference to the modifiable "LeaderSyncStateQuery" - /// selection of this object if "LeaderSyncStateQuery" is the current - /// selection. The behavior is undefined unless "LeaderSyncStateQuery" - /// is the selection of this object. LeaderSyncStateQuery& leaderSyncStateQuery(); + // Return a reference to the modifiable "LeaderSyncStateQuery" + // selection of this object if "LeaderSyncStateQuery" is the current + // selection. The behavior is undefined unless "LeaderSyncStateQuery" + // is the selection of this object. - /// Return a reference to the modifiable "LeaderSyncStateQueryResponse" - /// selection of this object if "LeaderSyncStateQueryResponse" is the - /// current selection. The behavior is undefined unless - /// "LeaderSyncStateQueryResponse" is the selection of this object. LeaderSyncStateQueryResponse& leaderSyncStateQueryResponse(); + // Return a reference to the modifiable "LeaderSyncStateQueryResponse" + // selection of this object if "LeaderSyncStateQueryResponse" is the + // current selection. The behavior is undefined unless + // "LeaderSyncStateQueryResponse" is the selection of this object. - /// Return a reference to the modifiable "LeaderSyncDataQuery" selection - /// of this object if "LeaderSyncDataQuery" is the current selection. - /// The behavior is undefined unless "LeaderSyncDataQuery" is the - /// selection of this object. LeaderSyncDataQuery& leaderSyncDataQuery(); + // Return a reference to the modifiable "LeaderSyncDataQuery" selection + // of this object if "LeaderSyncDataQuery" is the current selection. + // The behavior is undefined unless "LeaderSyncDataQuery" is the + // selection of this object. - /// Return a reference to the modifiable "LeaderSyncDataQueryResponse" - /// selection of this object if "LeaderSyncDataQueryResponse" is the - /// current selection. The behavior is undefined unless - /// "LeaderSyncDataQueryResponse" is the selection of this object. LeaderSyncDataQueryResponse& leaderSyncDataQueryResponse(); + // Return a reference to the modifiable "LeaderSyncDataQueryResponse" + // selection of this object if "LeaderSyncDataQueryResponse" is the + // current selection. The behavior is undefined unless + // "LeaderSyncDataQueryResponse" is the selection of this object. - /// Return a reference to the modifiable "QueueAssignmentRequest" - /// selection of this object if "QueueAssignmentRequest" is the current - /// selection. The behavior is undefined unless - /// "QueueAssignmentRequest" is the selection of this object. QueueAssignmentRequest& queueAssignmentRequest(); + // Return a reference to the modifiable "QueueAssignmentRequest" + // selection of this object if "QueueAssignmentRequest" is the current + // selection. The behavior is undefined unless + // "QueueAssignmentRequest" is the selection of this object. - /// Return a reference to the modifiable "StorageSyncRequest" selection - /// of this object if "StorageSyncRequest" is the current selection. - /// The behavior is undefined unless "StorageSyncRequest" is the - /// selection of this object. StorageSyncRequest& storageSyncRequest(); + // Return a reference to the modifiable "StorageSyncRequest" selection + // of this object if "StorageSyncRequest" is the current selection. + // The behavior is undefined unless "StorageSyncRequest" is the + // selection of this object. - /// Return a reference to the modifiable "StorageSyncResponse" selection - /// of this object if "StorageSyncResponse" is the current selection. - /// The behavior is undefined unless "StorageSyncResponse" is the - /// selection of this object. StorageSyncResponse& storageSyncResponse(); + // Return a reference to the modifiable "StorageSyncResponse" selection + // of this object if "StorageSyncResponse" is the current selection. + // The behavior is undefined unless "StorageSyncResponse" is the + // selection of this object. - /// Return a reference to the modifiable "PartitionSyncStateQuery" - /// selection of this object if "PartitionSyncStateQuery" is the current - /// selection. The behavior is undefined unless - /// "PartitionSyncStateQuery" is the selection of this object. PartitionSyncStateQuery& partitionSyncStateQuery(); + // Return a reference to the modifiable "PartitionSyncStateQuery" + // selection of this object if "PartitionSyncStateQuery" is the current + // selection. The behavior is undefined unless + // "PartitionSyncStateQuery" is the selection of this object. - /// Return a reference to the modifiable - /// "PartitionSyncStateQueryResponse" selection of this object if - /// "PartitionSyncStateQueryResponse" is the current selection. The - /// behavior is undefined unless "PartitionSyncStateQueryResponse" is - /// the selection of this object. PartitionSyncStateQueryResponse& partitionSyncStateQueryResponse(); + // Return a reference to the modifiable + // "PartitionSyncStateQueryResponse" selection of this object if + // "PartitionSyncStateQueryResponse" is the current selection. The + // behavior is undefined unless "PartitionSyncStateQueryResponse" is + // the selection of this object. - /// Return a reference to the modifiable "PartitionSyncDataQuery" - /// selection of this object if "PartitionSyncDataQuery" is the current - /// selection. The behavior is undefined unless - /// "PartitionSyncDataQuery" is the selection of this object. PartitionSyncDataQuery& partitionSyncDataQuery(); + // Return a reference to the modifiable "PartitionSyncDataQuery" + // selection of this object if "PartitionSyncDataQuery" is the current + // selection. The behavior is undefined unless + // "PartitionSyncDataQuery" is the selection of this object. - /// Return a reference to the modifiable - /// "PartitionSyncDataQueryResponse" selection of this object if - /// "PartitionSyncDataQueryResponse" is the current selection. The - /// behavior is undefined unless "PartitionSyncDataQueryResponse" is the - /// selection of this object. PartitionSyncDataQueryResponse& partitionSyncDataQueryResponse(); + // Return a reference to the modifiable + // "PartitionSyncDataQueryResponse" selection of this object if + // "PartitionSyncDataQueryResponse" is the current selection. The + // behavior is undefined unless "PartitionSyncDataQueryResponse" is the + // selection of this object. - /// Return a reference to the modifiable "PartitionSyncDataQueryStatus" - /// selection of this object if "PartitionSyncDataQueryStatus" is the - /// current selection. The behavior is undefined unless - /// "PartitionSyncDataQueryStatus" is the selection of this object. PartitionSyncDataQueryStatus& partitionSyncDataQueryStatus(); + // Return a reference to the modifiable "PartitionSyncDataQueryStatus" + // selection of this object if "PartitionSyncDataQueryStatus" is the + // current selection. The behavior is undefined unless + // "PartitionSyncDataQueryStatus" is the selection of this object. - /// Return a reference to the modifiable "PrimaryStatusAdvisory" - /// selection of this object if "PrimaryStatusAdvisory" is the current - /// selection. The behavior is undefined unless "PrimaryStatusAdvisory" - /// is the selection of this object. PrimaryStatusAdvisory& primaryStatusAdvisory(); + // Return a reference to the modifiable "PrimaryStatusAdvisory" + // selection of this object if "PrimaryStatusAdvisory" is the current + // selection. The behavior is undefined unless "PrimaryStatusAdvisory" + // is the selection of this object. - /// Return a reference to the modifiable "ClusterSyncRequest" selection - /// of this object if "ClusterSyncRequest" is the current selection. - /// The behavior is undefined unless "ClusterSyncRequest" is the - /// selection of this object. ClusterSyncRequest& clusterSyncRequest(); + // Return a reference to the modifiable "ClusterSyncRequest" selection + // of this object if "ClusterSyncRequest" is the current selection. + // The behavior is undefined unless "ClusterSyncRequest" is the + // selection of this object. - /// Return a reference to the modifiable "ClusterSyncResponse" selection - /// of this object if "ClusterSyncResponse" is the current selection. - /// The behavior is undefined unless "ClusterSyncResponse" is the - /// selection of this object. ClusterSyncResponse& clusterSyncResponse(); + // Return a reference to the modifiable "ClusterSyncResponse" selection + // of this object if "ClusterSyncResponse" is the current selection. + // The behavior is undefined unless "ClusterSyncResponse" is the + // selection of this object. - /// Return a reference to the modifiable "QueueUnAssignmentAdvisory" - /// selection of this object if "QueueUnAssignmentAdvisory" is the - /// current selection. The behavior is undefined unless - /// "QueueUnAssignmentAdvisory" is the selection of this object. QueueUnAssignmentAdvisory& queueUnAssignmentAdvisory(); + // Return a reference to the modifiable "QueueUnAssignmentAdvisory" + // selection of this object if "QueueUnAssignmentAdvisory" is the + // current selection. The behavior is undefined unless + // "QueueUnAssignmentAdvisory" is the selection of this object. - /// Return a reference to the modifiable "QueueUnassignedAdvisory" - /// selection of this object if "QueueUnassignedAdvisory" is the current - /// selection. The behavior is undefined unless - /// "QueueUnassignedAdvisory" is the selection of this object. QueueUnassignedAdvisory& queueUnassignedAdvisory(); + // Return a reference to the modifiable "QueueUnassignedAdvisory" + // selection of this object if "QueueUnassignedAdvisory" is the current + // selection. The behavior is undefined unless + // "QueueUnassignedAdvisory" is the selection of this object. - /// Return a reference to the modifiable "LeaderAdvisoryAck" selection - /// of this object if "LeaderAdvisoryAck" is the current selection. The - /// behavior is undefined unless "LeaderAdvisoryAck" is the selection of - /// this object. LeaderAdvisoryAck& leaderAdvisoryAck(); + // Return a reference to the modifiable "LeaderAdvisoryAck" selection + // of this object if "LeaderAdvisoryAck" is the current selection. The + // behavior is undefined unless "LeaderAdvisoryAck" is the selection of + // this object. - /// Return a reference to the modifiable "LeaderAdvisoryCommit" - /// selection of this object if "LeaderAdvisoryCommit" is the current - /// selection. The behavior is undefined unless "LeaderAdvisoryCommit" - /// is the selection of this object. LeaderAdvisoryCommit& leaderAdvisoryCommit(); + // Return a reference to the modifiable "LeaderAdvisoryCommit" + // selection of this object if "LeaderAdvisoryCommit" is the current + // selection. The behavior is undefined unless "LeaderAdvisoryCommit" + // is the selection of this object. - /// Return a reference to the modifiable "StateNotification" selection - /// of this object if "StateNotification" is the current selection. The - /// behavior is undefined unless "StateNotification" is the selection of - /// this object. StateNotification& stateNotification(); + // Return a reference to the modifiable "StateNotification" selection + // of this object if "StateNotification" is the current selection. The + // behavior is undefined unless "StateNotification" is the selection of + // this object. - /// Return a reference to the modifiable "StopRequest" selection of this - /// object if "StopRequest" is the current selection. The behavior is - /// undefined unless "StopRequest" is the selection of this object. StopRequest& stopRequest(); + // Return a reference to the modifiable "StopRequest" selection of this + // object if "StopRequest" is the current selection. The behavior is + // undefined unless "StopRequest" is the selection of this object. - /// Return a reference to the modifiable "StopResponse" selection of - /// this object if "StopResponse" is the current selection. The - /// behavior is undefined unless "StopResponse" is the selection of this - /// object. StopResponse& stopResponse(); + // Return a reference to the modifiable "StopResponse" selection of + // this object if "StopResponse" is the current selection. The + // behavior is undefined unless "StopResponse" is the selection of this + // object. - /// Return a reference to the modifiable "QueueUnassignmentRequest" - /// selection of this object if "QueueUnassignmentRequest" is the - /// current selection. The behavior is undefined unless - /// "QueueUnassignmentRequest" is the selection of this object. QueueUnassignmentRequest& queueUnassignmentRequest(); + // Return a reference to the modifiable "QueueUnassignmentRequest" + // selection of this object if "QueueUnassignmentRequest" is the + // current selection. The behavior is undefined unless + // "QueueUnassignmentRequest" is the selection of this object. - /// Return a reference to the modifiable "QueueUpdateAdvisory" selection - /// of this object if "QueueUpdateAdvisory" is the current selection. - /// The behavior is undefined unless "QueueUpdateAdvisory" is the - /// selection of this object. QueueUpdateAdvisory& queueUpdateAdvisory(); + // Return a reference to the modifiable "QueueUpdateAdvisory" selection + // of this object if "QueueUpdateAdvisory" is the current selection. + // The behavior is undefined unless "QueueUpdateAdvisory" is the + // selection of this object. - /// Return a reference to the modifiable "ClusterStateFSMMessage" - /// selection of this object if "ClusterStateFSMMessage" is the current - /// selection. The behavior is undefined unless - /// "ClusterStateFSMMessage" is the selection of this object. ClusterStateFSMMessage& clusterStateFSMMessage(); + // Return a reference to the modifiable "ClusterStateFSMMessage" + // selection of this object if "ClusterStateFSMMessage" is the current + // selection. The behavior is undefined unless + // "ClusterStateFSMMessage" is the selection of this object. - /// Return a reference to the modifiable "PartitionMessage" selection of - /// this object if "PartitionMessage" is the current selection. The - /// behavior is undefined unless "PartitionMessage" is the selection of - /// this object. PartitionMessage& partitionMessage(); + // Return a reference to the modifiable "PartitionMessage" selection of + // this object if "PartitionMessage" is the current selection. The + // behavior is undefined unless "PartitionMessage" is the selection of + // this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. + + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; - - /// Return a reference to the non-modifiable "PartitionPrimaryAdvisory" - /// selection of this object if "PartitionPrimaryAdvisory" is the - /// current selection. The behavior is undefined unless - /// "PartitionPrimaryAdvisory" is the selection of this object. const PartitionPrimaryAdvisory& partitionPrimaryAdvisory() const; + // Return a reference to the non-modifiable "PartitionPrimaryAdvisory" + // selection of this object if "PartitionPrimaryAdvisory" is the + // current selection. The behavior is undefined unless + // "PartitionPrimaryAdvisory" is the selection of this object. - /// Return a reference to the non-modifiable "LeaderAdvisory" selection - /// of this object if "LeaderAdvisory" is the current selection. The - /// behavior is undefined unless "LeaderAdvisory" is the selection of - /// this object. const LeaderAdvisory& leaderAdvisory() const; + // Return a reference to the non-modifiable "LeaderAdvisory" selection + // of this object if "LeaderAdvisory" is the current selection. The + // behavior is undefined unless "LeaderAdvisory" is the selection of + // this object. - /// Return a reference to the non-modifiable "QueueAssignmentAdvisory" - /// selection of this object if "QueueAssignmentAdvisory" is the current - /// selection. The behavior is undefined unless - /// "QueueAssignmentAdvisory" is the selection of this object. const QueueAssignmentAdvisory& queueAssignmentAdvisory() const; + // Return a reference to the non-modifiable "QueueAssignmentAdvisory" + // selection of this object if "QueueAssignmentAdvisory" is the current + // selection. The behavior is undefined unless + // "QueueAssignmentAdvisory" is the selection of this object. - /// Return a reference to the non-modifiable "NodeStatusAdvisory" - /// selection of this object if "NodeStatusAdvisory" is the current - /// selection. The behavior is undefined unless "NodeStatusAdvisory" is - /// the selection of this object. const NodeStatusAdvisory& nodeStatusAdvisory() const; + // Return a reference to the non-modifiable "NodeStatusAdvisory" + // selection of this object if "NodeStatusAdvisory" is the current + // selection. The behavior is undefined unless "NodeStatusAdvisory" is + // the selection of this object. - /// Return a reference to the non-modifiable "LeaderSyncStateQuery" - /// selection of this object if "LeaderSyncStateQuery" is the current - /// selection. The behavior is undefined unless "LeaderSyncStateQuery" - /// is the selection of this object. const LeaderSyncStateQuery& leaderSyncStateQuery() const; + // Return a reference to the non-modifiable "LeaderSyncStateQuery" + // selection of this object if "LeaderSyncStateQuery" is the current + // selection. The behavior is undefined unless "LeaderSyncStateQuery" + // is the selection of this object. - /// Return a reference to the non-modifiable - /// "LeaderSyncStateQueryResponse" selection of this object if - /// "LeaderSyncStateQueryResponse" is the current selection. The - /// behavior is undefined unless "LeaderSyncStateQueryResponse" is the - /// selection of this object. const LeaderSyncStateQueryResponse& leaderSyncStateQueryResponse() const; + // Return a reference to the non-modifiable + // "LeaderSyncStateQueryResponse" selection of this object if + // "LeaderSyncStateQueryResponse" is the current selection. The + // behavior is undefined unless "LeaderSyncStateQueryResponse" is the + // selection of this object. - /// Return a reference to the non-modifiable "LeaderSyncDataQuery" - /// selection of this object if "LeaderSyncDataQuery" is the current - /// selection. The behavior is undefined unless "LeaderSyncDataQuery" - /// is the selection of this object. const LeaderSyncDataQuery& leaderSyncDataQuery() const; + // Return a reference to the non-modifiable "LeaderSyncDataQuery" + // selection of this object if "LeaderSyncDataQuery" is the current + // selection. The behavior is undefined unless "LeaderSyncDataQuery" + // is the selection of this object. - /// Return a reference to the non-modifiable - /// "LeaderSyncDataQueryResponse" selection of this object if - /// "LeaderSyncDataQueryResponse" is the current selection. The - /// behavior is undefined unless "LeaderSyncDataQueryResponse" is the - /// selection of this object. const LeaderSyncDataQueryResponse& leaderSyncDataQueryResponse() const; + // Return a reference to the non-modifiable + // "LeaderSyncDataQueryResponse" selection of this object if + // "LeaderSyncDataQueryResponse" is the current selection. The + // behavior is undefined unless "LeaderSyncDataQueryResponse" is the + // selection of this object. - /// Return a reference to the non-modifiable "QueueAssignmentRequest" - /// selection of this object if "QueueAssignmentRequest" is the current - /// selection. The behavior is undefined unless - /// "QueueAssignmentRequest" is the selection of this object. const QueueAssignmentRequest& queueAssignmentRequest() const; + // Return a reference to the non-modifiable "QueueAssignmentRequest" + // selection of this object if "QueueAssignmentRequest" is the current + // selection. The behavior is undefined unless + // "QueueAssignmentRequest" is the selection of this object. - /// Return a reference to the non-modifiable "StorageSyncRequest" - /// selection of this object if "StorageSyncRequest" is the current - /// selection. The behavior is undefined unless "StorageSyncRequest" is - /// the selection of this object. const StorageSyncRequest& storageSyncRequest() const; + // Return a reference to the non-modifiable "StorageSyncRequest" + // selection of this object if "StorageSyncRequest" is the current + // selection. The behavior is undefined unless "StorageSyncRequest" is + // the selection of this object. - /// Return a reference to the non-modifiable "StorageSyncResponse" - /// selection of this object if "StorageSyncResponse" is the current - /// selection. The behavior is undefined unless "StorageSyncResponse" - /// is the selection of this object. const StorageSyncResponse& storageSyncResponse() const; + // Return a reference to the non-modifiable "StorageSyncResponse" + // selection of this object if "StorageSyncResponse" is the current + // selection. The behavior is undefined unless "StorageSyncResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable "PartitionSyncStateQuery" - /// selection of this object if "PartitionSyncStateQuery" is the current - /// selection. The behavior is undefined unless - /// "PartitionSyncStateQuery" is the selection of this object. const PartitionSyncStateQuery& partitionSyncStateQuery() const; + // Return a reference to the non-modifiable "PartitionSyncStateQuery" + // selection of this object if "PartitionSyncStateQuery" is the current + // selection. The behavior is undefined unless + // "PartitionSyncStateQuery" is the selection of this object. - /// Return a reference to the non-modifiable - /// "PartitionSyncStateQueryResponse" selection of this object if - /// "PartitionSyncStateQueryResponse" is the current selection. The - /// behavior is undefined unless "PartitionSyncStateQueryResponse" is - /// the selection of this object. const PartitionSyncStateQueryResponse& partitionSyncStateQueryResponse() const; + // Return a reference to the non-modifiable + // "PartitionSyncStateQueryResponse" selection of this object if + // "PartitionSyncStateQueryResponse" is the current selection. The + // behavior is undefined unless "PartitionSyncStateQueryResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable "PartitionSyncDataQuery" - /// selection of this object if "PartitionSyncDataQuery" is the current - /// selection. The behavior is undefined unless - /// "PartitionSyncDataQuery" is the selection of this object. const PartitionSyncDataQuery& partitionSyncDataQuery() const; + // Return a reference to the non-modifiable "PartitionSyncDataQuery" + // selection of this object if "PartitionSyncDataQuery" is the current + // selection. The behavior is undefined unless + // "PartitionSyncDataQuery" is the selection of this object. - /// Return a reference to the non-modifiable - /// "PartitionSyncDataQueryResponse" selection of this object if - /// "PartitionSyncDataQueryResponse" is the current selection. The - /// behavior is undefined unless "PartitionSyncDataQueryResponse" is the - /// selection of this object. const PartitionSyncDataQueryResponse& partitionSyncDataQueryResponse() const; + // Return a reference to the non-modifiable + // "PartitionSyncDataQueryResponse" selection of this object if + // "PartitionSyncDataQueryResponse" is the current selection. The + // behavior is undefined unless "PartitionSyncDataQueryResponse" is the + // selection of this object. - /// Return a reference to the non-modifiable - /// "PartitionSyncDataQueryStatus" selection of this object if - /// "PartitionSyncDataQueryStatus" is the current selection. The - /// behavior is undefined unless "PartitionSyncDataQueryStatus" is the - /// selection of this object. const PartitionSyncDataQueryStatus& partitionSyncDataQueryStatus() const; + // Return a reference to the non-modifiable + // "PartitionSyncDataQueryStatus" selection of this object if + // "PartitionSyncDataQueryStatus" is the current selection. The + // behavior is undefined unless "PartitionSyncDataQueryStatus" is the + // selection of this object. - /// Return a reference to the non-modifiable "PrimaryStatusAdvisory" - /// selection of this object if "PrimaryStatusAdvisory" is the current - /// selection. The behavior is undefined unless "PrimaryStatusAdvisory" - /// is the selection of this object. const PrimaryStatusAdvisory& primaryStatusAdvisory() const; + // Return a reference to the non-modifiable "PrimaryStatusAdvisory" + // selection of this object if "PrimaryStatusAdvisory" is the current + // selection. The behavior is undefined unless "PrimaryStatusAdvisory" + // is the selection of this object. - /// Return a reference to the non-modifiable "ClusterSyncRequest" - /// selection of this object if "ClusterSyncRequest" is the current - /// selection. The behavior is undefined unless "ClusterSyncRequest" is - /// the selection of this object. const ClusterSyncRequest& clusterSyncRequest() const; + // Return a reference to the non-modifiable "ClusterSyncRequest" + // selection of this object if "ClusterSyncRequest" is the current + // selection. The behavior is undefined unless "ClusterSyncRequest" is + // the selection of this object. - /// Return a reference to the non-modifiable "ClusterSyncResponse" - /// selection of this object if "ClusterSyncResponse" is the current - /// selection. The behavior is undefined unless "ClusterSyncResponse" - /// is the selection of this object. const ClusterSyncResponse& clusterSyncResponse() const; + // Return a reference to the non-modifiable "ClusterSyncResponse" + // selection of this object if "ClusterSyncResponse" is the current + // selection. The behavior is undefined unless "ClusterSyncResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable "QueueUnAssignmentAdvisory" - /// selection of this object if "QueueUnAssignmentAdvisory" is the - /// current selection. The behavior is undefined unless - /// "QueueUnAssignmentAdvisory" is the selection of this object. const QueueUnAssignmentAdvisory& queueUnAssignmentAdvisory() const; + // Return a reference to the non-modifiable "QueueUnAssignmentAdvisory" + // selection of this object if "QueueUnAssignmentAdvisory" is the + // current selection. The behavior is undefined unless + // "QueueUnAssignmentAdvisory" is the selection of this object. - /// Return a reference to the non-modifiable "QueueUnassignedAdvisory" - /// selection of this object if "QueueUnassignedAdvisory" is the current - /// selection. The behavior is undefined unless - /// "QueueUnassignedAdvisory" is the selection of this object. const QueueUnassignedAdvisory& queueUnassignedAdvisory() const; + // Return a reference to the non-modifiable "QueueUnassignedAdvisory" + // selection of this object if "QueueUnassignedAdvisory" is the current + // selection. The behavior is undefined unless + // "QueueUnassignedAdvisory" is the selection of this object. - /// Return a reference to the non-modifiable "LeaderAdvisoryAck" - /// selection of this object if "LeaderAdvisoryAck" is the current - /// selection. The behavior is undefined unless "LeaderAdvisoryAck" is - /// the selection of this object. const LeaderAdvisoryAck& leaderAdvisoryAck() const; + // Return a reference to the non-modifiable "LeaderAdvisoryAck" + // selection of this object if "LeaderAdvisoryAck" is the current + // selection. The behavior is undefined unless "LeaderAdvisoryAck" is + // the selection of this object. - /// Return a reference to the non-modifiable "LeaderAdvisoryCommit" - /// selection of this object if "LeaderAdvisoryCommit" is the current - /// selection. The behavior is undefined unless "LeaderAdvisoryCommit" - /// is the selection of this object. const LeaderAdvisoryCommit& leaderAdvisoryCommit() const; + // Return a reference to the non-modifiable "LeaderAdvisoryCommit" + // selection of this object if "LeaderAdvisoryCommit" is the current + // selection. The behavior is undefined unless "LeaderAdvisoryCommit" + // is the selection of this object. - /// Return a reference to the non-modifiable "StateNotification" - /// selection of this object if "StateNotification" is the current - /// selection. The behavior is undefined unless "StateNotification" is - /// the selection of this object. const StateNotification& stateNotification() const; + // Return a reference to the non-modifiable "StateNotification" + // selection of this object if "StateNotification" is the current + // selection. The behavior is undefined unless "StateNotification" is + // the selection of this object. - /// Return a reference to the non-modifiable "StopRequest" selection of - /// this object if "StopRequest" is the current selection. The behavior - /// is undefined unless "StopRequest" is the selection of this object. const StopRequest& stopRequest() const; + // Return a reference to the non-modifiable "StopRequest" selection of + // this object if "StopRequest" is the current selection. The behavior + // is undefined unless "StopRequest" is the selection of this object. - /// Return a reference to the non-modifiable "StopResponse" selection of - /// this object if "StopResponse" is the current selection. The - /// behavior is undefined unless "StopResponse" is the selection of this - /// object. const StopResponse& stopResponse() const; + // Return a reference to the non-modifiable "StopResponse" selection of + // this object if "StopResponse" is the current selection. The + // behavior is undefined unless "StopResponse" is the selection of this + // object. - /// Return a reference to the non-modifiable "QueueUnassignmentRequest" - /// selection of this object if "QueueUnassignmentRequest" is the - /// current selection. The behavior is undefined unless - /// "QueueUnassignmentRequest" is the selection of this object. const QueueUnassignmentRequest& queueUnassignmentRequest() const; + // Return a reference to the non-modifiable "QueueUnassignmentRequest" + // selection of this object if "QueueUnassignmentRequest" is the + // current selection. The behavior is undefined unless + // "QueueUnassignmentRequest" is the selection of this object. - /// Return a reference to the non-modifiable "QueueUpdateAdvisory" - /// selection of this object if "QueueUpdateAdvisory" is the current - /// selection. The behavior is undefined unless "QueueUpdateAdvisory" - /// is the selection of this object. const QueueUpdateAdvisory& queueUpdateAdvisory() const; + // Return a reference to the non-modifiable "QueueUpdateAdvisory" + // selection of this object if "QueueUpdateAdvisory" is the current + // selection. The behavior is undefined unless "QueueUpdateAdvisory" + // is the selection of this object. - /// Return a reference to the non-modifiable "ClusterStateFSMMessage" - /// selection of this object if "ClusterStateFSMMessage" is the current - /// selection. The behavior is undefined unless - /// "ClusterStateFSMMessage" is the selection of this object. const ClusterStateFSMMessage& clusterStateFSMMessage() const; + // Return a reference to the non-modifiable "ClusterStateFSMMessage" + // selection of this object if "ClusterStateFSMMessage" is the current + // selection. The behavior is undefined unless + // "ClusterStateFSMMessage" is the selection of this object. - /// Return a reference to the non-modifiable "PartitionMessage" - /// selection of this object if "PartitionMessage" is the current - /// selection. The behavior is undefined unless "PartitionMessage" is - /// the selection of this object. const PartitionMessage& partitionMessage() const; + // Return a reference to the non-modifiable "PartitionMessage" + // selection of this object if "PartitionMessage" is the current + // selection. The behavior is undefined unless "PartitionMessage" is + // the selection of this object. - /// Return `true` if the value of this object is a - /// "PartitionPrimaryAdvisory" value, and return `false` otherwise. bool isPartitionPrimaryAdvisoryValue() const; + // Return 'true' if the value of this object is a + // "PartitionPrimaryAdvisory" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "LeaderAdvisory" - /// value, and return `false` otherwise. bool isLeaderAdvisoryValue() const; + // Return 'true' if the value of this object is a "LeaderAdvisory" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "QueueAssignmentAdvisory" value, and return `false` otherwise. bool isQueueAssignmentAdvisoryValue() const; + // Return 'true' if the value of this object is a + // "QueueAssignmentAdvisory" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "NodeStatusAdvisory" - /// value, and return `false` otherwise. bool isNodeStatusAdvisoryValue() const; + // Return 'true' if the value of this object is a "NodeStatusAdvisory" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "LeaderSyncStateQuery" value, and return `false` otherwise. bool isLeaderSyncStateQueryValue() const; + // Return 'true' if the value of this object is a + // "LeaderSyncStateQuery" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "LeaderSyncStateQueryResponse" value, and return `false` otherwise. bool isLeaderSyncStateQueryResponseValue() const; + // Return 'true' if the value of this object is a + // "LeaderSyncStateQueryResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "LeaderSyncDataQuery" - /// value, and return `false` otherwise. bool isLeaderSyncDataQueryValue() const; + // Return 'true' if the value of this object is a "LeaderSyncDataQuery" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "LeaderSyncDataQueryResponse" value, and return `false` otherwise. bool isLeaderSyncDataQueryResponseValue() const; + // Return 'true' if the value of this object is a + // "LeaderSyncDataQueryResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "QueueAssignmentRequest" value, and return `false` otherwise. bool isQueueAssignmentRequestValue() const; + // Return 'true' if the value of this object is a + // "QueueAssignmentRequest" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "StorageSyncRequest" - /// value, and return `false` otherwise. bool isStorageSyncRequestValue() const; + // Return 'true' if the value of this object is a "StorageSyncRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "StorageSyncResponse" - /// value, and return `false` otherwise. bool isStorageSyncResponseValue() const; + // Return 'true' if the value of this object is a "StorageSyncResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "PartitionSyncStateQuery" value, and return `false` otherwise. bool isPartitionSyncStateQueryValue() const; + // Return 'true' if the value of this object is a + // "PartitionSyncStateQuery" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "PartitionSyncStateQueryResponse" value, and return `false` - /// otherwise. bool isPartitionSyncStateQueryResponseValue() const; + // Return 'true' if the value of this object is a + // "PartitionSyncStateQueryResponse" value, and return 'false' + // otherwise. - /// Return `true` if the value of this object is a - /// "PartitionSyncDataQuery" value, and return `false` otherwise. bool isPartitionSyncDataQueryValue() const; + // Return 'true' if the value of this object is a + // "PartitionSyncDataQuery" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "PartitionSyncDataQueryResponse" value, and return `false` - /// otherwise. bool isPartitionSyncDataQueryResponseValue() const; + // Return 'true' if the value of this object is a + // "PartitionSyncDataQueryResponse" value, and return 'false' + // otherwise. - /// Return `true` if the value of this object is a - /// "PartitionSyncDataQueryStatus" value, and return `false` otherwise. bool isPartitionSyncDataQueryStatusValue() const; + // Return 'true' if the value of this object is a + // "PartitionSyncDataQueryStatus" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "PrimaryStatusAdvisory" value, and return `false` otherwise. bool isPrimaryStatusAdvisoryValue() const; + // Return 'true' if the value of this object is a + // "PrimaryStatusAdvisory" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ClusterSyncRequest" - /// value, and return `false` otherwise. bool isClusterSyncRequestValue() const; + // Return 'true' if the value of this object is a "ClusterSyncRequest" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ClusterSyncResponse" - /// value, and return `false` otherwise. bool isClusterSyncResponseValue() const; + // Return 'true' if the value of this object is a "ClusterSyncResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "QueueUnAssignmentAdvisory" value, and return `false` otherwise. bool isQueueUnAssignmentAdvisoryValue() const; + // Return 'true' if the value of this object is a + // "QueueUnAssignmentAdvisory" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "QueueUnassignedAdvisory" value, and return `false` otherwise. bool isQueueUnassignedAdvisoryValue() const; + // Return 'true' if the value of this object is a + // "QueueUnassignedAdvisory" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "LeaderAdvisoryAck" - /// value, and return `false` otherwise. bool isLeaderAdvisoryAckValue() const; + // Return 'true' if the value of this object is a "LeaderAdvisoryAck" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "LeaderAdvisoryCommit" value, and return `false` otherwise. bool isLeaderAdvisoryCommitValue() const; + // Return 'true' if the value of this object is a + // "LeaderAdvisoryCommit" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "StateNotification" - /// value, and return `false` otherwise. bool isStateNotificationValue() const; + // Return 'true' if the value of this object is a "StateNotification" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "StopRequest" value, - /// and return `false` otherwise. bool isStopRequestValue() const; + // Return 'true' if the value of this object is a "StopRequest" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "StopResponse" value, - /// and return `false` otherwise. bool isStopResponseValue() const; + // Return 'true' if the value of this object is a "StopResponse" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "QueueUnassignmentRequest" value, and return `false` otherwise. bool isQueueUnassignmentRequestValue() const; + // Return 'true' if the value of this object is a + // "QueueUnassignmentRequest" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "QueueUpdateAdvisory" - /// value, and return `false` otherwise. bool isQueueUpdateAdvisoryValue() const; + // Return 'true' if the value of this object is a "QueueUpdateAdvisory" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "ClusterStateFSMMessage" value, and return `false` otherwise. bool isClusterStateFSMMessageValue() const; + // Return 'true' if the value of this object is a + // "ClusterStateFSMMessage" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "PartitionMessage" - /// value, and return `false` otherwise. bool isPartitionMessageValue() const; + // Return 'true' if the value of this object is a "PartitionMessage" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ClusterMessageChoice& lhs, + const ClusterMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'ClusterMessageChoice' objects + // have the same value if either the selections in both objects have + // the same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ClusterMessageChoice& lhs, + const ClusterMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClusterMessageChoice& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ClusterMessageChoice& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClusterMessageChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `ClusterMessageChoice` objects have the -/// same value if either the selections in both objects have the same ids and -/// the same values, or both selections are undefined. -inline bool operator==(const ClusterMessageChoice& lhs, - const ClusterMessageChoice& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const ClusterMessageChoice& lhs, - const ClusterMessageChoice& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClusterMessageChoice& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClusterMessageChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterMessageChoice& object); - } // close package namespace // TRAITS @@ -22112,11 +22245,12 @@ namespace bmqp_ctrlmsg { // class ClusterMessage // ==================== -/// This type is the top level type for any message being sent by a node -/// inside the cluster to one or more peer nodes. Note that this type of -/// message is not sent outside the cluster. -/// choice.: enumerates all the different types of cluster messages class ClusterMessage { + // This type is the top level type for any message being sent by a node + // inside the cluster to one or more peer nodes. Note that this type of + // message is not sent outside the cluster. + // choice.: enumerates all the different types of cluster messages + // INSTANCE DATA ClusterMessageChoice d_choice; @@ -22135,176 +22269,184 @@ class ClusterMessage { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ClusterMessage` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit ClusterMessage(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterMessage' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `ClusterMessage` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ClusterMessage(const ClusterMessage& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ClusterMessage' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ClusterMessage` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ClusterMessage(ClusterMessage&& original) noexcept; + // Create an object of type 'ClusterMessage' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ClusterMessage` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ClusterMessage(ClusterMessage&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ClusterMessage' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ClusterMessage(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ClusterMessage& operator=(const ClusterMessage& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ClusterMessage& operator=(ClusterMessage&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "Choice" attribute of this - /// object. ClusterMessageChoice& choice(); + // Return a reference to the modifiable "Choice" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "Choice" attribute of this - /// object. const ClusterMessageChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ClusterMessage& lhs, + const ClusterMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.choice() == rhs.choice(); + } + + friend bool operator!=(const ClusterMessage& lhs, + const ClusterMessage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ClusterMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ClusterMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ClusterMessage'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.choice()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ClusterMessage& lhs, const ClusterMessage& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ClusterMessage& lhs, const ClusterMessage& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ClusterMessage& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ClusterMessage`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterMessage& object); - } // close package namespace // TRAITS @@ -22341,6 +22483,12 @@ class ControlMessageChoice { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ControlMessageChoice& rhs) const; + public: // TYPES @@ -22387,79 +22535,76 @@ class ControlMessageChoice { static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]; // CLASS METHODS - - /// Return selection information for the selection indicated by the - /// specified `id` if the selection exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(int id); + // Return selection information for the selection indicated by the + // specified 'id' if the selection exists, and 0 otherwise. - /// Return selection information for the selection indicated by the - /// specified `name` of the specified `nameLength` if the selection - /// exists, and 0 otherwise. static const bdlat_SelectionInfo* lookupSelectionInfo(const char* name, int nameLength); + // Return selection information for the selection indicated by the + // specified 'name' of the specified 'nameLength' if the selection + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ControlMessageChoice` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit ControlMessageChoice(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ControlMessageChoice' having the default + // value. Use the optionally specified 'basicAllocator' to supply + // memory. If 'basicAllocator' is 0, the currently installed default + // allocator is used. - /// Create an object of type `ControlMessageChoice` having the value of - /// the specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ControlMessageChoice(const ControlMessageChoice& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ControlMessageChoice' having the value of + // the specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ControlMessageChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ControlMessageChoice(ControlMessageChoice&& original) noexcept; + // Create an object of type 'ControlMessageChoice' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ControlMessageChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ControlMessageChoice(ControlMessageChoice&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ControlMessageChoice' having the value of + // the specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ControlMessageChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ControlMessageChoice& operator=(const ControlMessageChoice& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ControlMessageChoice& operator=(ControlMessageChoice&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon default - /// construction). void reset(); + // Reset this object to the default value (i.e., its value upon default + // construction). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `selectionId`. Return 0 on success, and - /// non-zero value otherwise (i.e., the selection is not found). int makeSelection(int selectionId); + // Set the value of this object to be the default for the selection + // indicated by the specified 'selectionId'. Return 0 on success, and + // non-zero value otherwise (i.e., the selection is not found). - /// Set the value of this object to be the default for the selection - /// indicated by the specified `name` of the specified `nameLength`. - /// Return 0 on success, and non-zero value otherwise (i.e., the - /// selection is not found). int makeSelection(const char* name, int nameLength); + // Set the value of this object to be the default for the selection + // indicated by the specified 'name' of the specified 'nameLength'. + // Return 0 on success, and non-zero value otherwise (i.e., the + // selection is not found). Status& makeStatus(); Status& makeStatus(const Status& value); @@ -22618,292 +22763,304 @@ class ControlMessageChoice { // "ConfigureStreamResponse". If 'value' is not specified, the default // "ConfigureStreamResponse" value is used. - /// Invoke the specified `manipulator` on the address of the modifiable - /// selection, supplying `manipulator` with the corresponding selection - /// information structure. Return the value returned from the - /// invocation of `manipulator` if this object has a defined selection, - /// and -1 otherwise. - template - int manipulateSelection(MANIPULATOR& manipulator); - - /// Return a reference to the modifiable "Status" selection of this - /// object if "Status" is the current selection. The behavior is - /// undefined unless "Status" is the selection of this object. + template + int manipulateSelection(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' on the address of the modifiable + // selection, supplying 'manipulator' with the corresponding selection + // information structure. Return the value returned from the + // invocation of 'manipulator' if this object has a defined selection, + // and -1 otherwise. + Status& status(); + // Return a reference to the modifiable "Status" selection of this + // object if "Status" is the current selection. The behavior is + // undefined unless "Status" is the selection of this object. - /// Return a reference to the modifiable "Disconnect" selection of this - /// object if "Disconnect" is the current selection. The behavior is - /// undefined unless "Disconnect" is the selection of this object. Disconnect& disconnect(); + // Return a reference to the modifiable "Disconnect" selection of this + // object if "Disconnect" is the current selection. The behavior is + // undefined unless "Disconnect" is the selection of this object. - /// Return a reference to the modifiable "DisconnectResponse" selection - /// of this object if "DisconnectResponse" is the current selection. - /// The behavior is undefined unless "DisconnectResponse" is the - /// selection of this object. DisconnectResponse& disconnectResponse(); + // Return a reference to the modifiable "DisconnectResponse" selection + // of this object if "DisconnectResponse" is the current selection. + // The behavior is undefined unless "DisconnectResponse" is the + // selection of this object. - /// Return a reference to the modifiable "AdminCommand" selection of - /// this object if "AdminCommand" is the current selection. The - /// behavior is undefined unless "AdminCommand" is the selection of this - /// object. AdminCommand& adminCommand(); + // Return a reference to the modifiable "AdminCommand" selection of + // this object if "AdminCommand" is the current selection. The + // behavior is undefined unless "AdminCommand" is the selection of this + // object. - /// Return a reference to the modifiable "AdminCommandResponse" - /// selection of this object if "AdminCommandResponse" is the current - /// selection. The behavior is undefined unless "AdminCommandResponse" - /// is the selection of this object. AdminCommandResponse& adminCommandResponse(); + // Return a reference to the modifiable "AdminCommandResponse" + // selection of this object if "AdminCommandResponse" is the current + // selection. The behavior is undefined unless "AdminCommandResponse" + // is the selection of this object. - /// Return a reference to the modifiable "ClusterMessage" selection of - /// this object if "ClusterMessage" is the current selection. The - /// behavior is undefined unless "ClusterMessage" is the selection of - /// this object. ClusterMessage& clusterMessage(); + // Return a reference to the modifiable "ClusterMessage" selection of + // this object if "ClusterMessage" is the current selection. The + // behavior is undefined unless "ClusterMessage" is the selection of + // this object. - /// Return a reference to the modifiable "OpenQueue" selection of this - /// object if "OpenQueue" is the current selection. The behavior is - /// undefined unless "OpenQueue" is the selection of this object. OpenQueue& openQueue(); + // Return a reference to the modifiable "OpenQueue" selection of this + // object if "OpenQueue" is the current selection. The behavior is + // undefined unless "OpenQueue" is the selection of this object. - /// Return a reference to the modifiable "OpenQueueResponse" selection - /// of this object if "OpenQueueResponse" is the current selection. The - /// behavior is undefined unless "OpenQueueResponse" is the selection of - /// this object. OpenQueueResponse& openQueueResponse(); + // Return a reference to the modifiable "OpenQueueResponse" selection + // of this object if "OpenQueueResponse" is the current selection. The + // behavior is undefined unless "OpenQueueResponse" is the selection of + // this object. - /// Return a reference to the modifiable "CloseQueue" selection of this - /// object if "CloseQueue" is the current selection. The behavior is - /// undefined unless "CloseQueue" is the selection of this object. CloseQueue& closeQueue(); + // Return a reference to the modifiable "CloseQueue" selection of this + // object if "CloseQueue" is the current selection. The behavior is + // undefined unless "CloseQueue" is the selection of this object. - /// Return a reference to the modifiable "CloseQueueResponse" selection - /// of this object if "CloseQueueResponse" is the current selection. - /// The behavior is undefined unless "CloseQueueResponse" is the - /// selection of this object. CloseQueueResponse& closeQueueResponse(); + // Return a reference to the modifiable "CloseQueueResponse" selection + // of this object if "CloseQueueResponse" is the current selection. + // The behavior is undefined unless "CloseQueueResponse" is the + // selection of this object. - /// Return a reference to the modifiable "ConfigureQueueStream" - /// selection of this object if "ConfigureQueueStream" is the current - /// selection. The behavior is undefined unless "ConfigureQueueStream" - /// is the selection of this object. ConfigureQueueStream& configureQueueStream(); + // Return a reference to the modifiable "ConfigureQueueStream" + // selection of this object if "ConfigureQueueStream" is the current + // selection. The behavior is undefined unless "ConfigureQueueStream" + // is the selection of this object. - /// Return a reference to the modifiable "ConfigureQueueStreamResponse" - /// selection of this object if "ConfigureQueueStreamResponse" is the - /// current selection. The behavior is undefined unless - /// "ConfigureQueueStreamResponse" is the selection of this object. ConfigureQueueStreamResponse& configureQueueStreamResponse(); + // Return a reference to the modifiable "ConfigureQueueStreamResponse" + // selection of this object if "ConfigureQueueStreamResponse" is the + // current selection. The behavior is undefined unless + // "ConfigureQueueStreamResponse" is the selection of this object. - /// Return a reference to the modifiable "ConfigureStream" selection of - /// this object if "ConfigureStream" is the current selection. The - /// behavior is undefined unless "ConfigureStream" is the selection of - /// this object. ConfigureStream& configureStream(); + // Return a reference to the modifiable "ConfigureStream" selection of + // this object if "ConfigureStream" is the current selection. The + // behavior is undefined unless "ConfigureStream" is the selection of + // this object. - /// Return a reference to the modifiable "ConfigureStreamResponse" - /// selection of this object if "ConfigureStreamResponse" is the current - /// selection. The behavior is undefined unless - /// "ConfigureStreamResponse" is the selection of this object. ConfigureStreamResponse& configureStreamResponse(); + // Return a reference to the modifiable "ConfigureStreamResponse" + // selection of this object if "ConfigureStreamResponse" is the current + // selection. The behavior is undefined unless + // "ConfigureStreamResponse" is the selection of this object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. - /// Return the id of the current selection if the selection is defined, - /// and -1 otherwise. int selectionId() const; + // Return the id of the current selection if the selection is defined, + // and -1 otherwise. - /// Invoke the specified `accessor` on the non-modifiable selection, - /// supplying `accessor` with the corresponding selection information - /// structure. Return the value returned from the invocation of - /// `accessor` if this object has a defined selection, and -1 otherwise. - template - int accessSelection(ACCESSOR& accessor) const; + template + int accessSelection(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' on the non-modifiable selection, + // supplying 'accessor' with the corresponding selection information + // structure. Return the value returned from the invocation of + // 'accessor' if this object has a defined selection, and -1 otherwise. - /// Return a reference to the non-modifiable "Status" selection of this - /// object if "Status" is the current selection. The behavior is - /// undefined unless "Status" is the selection of this object. const Status& status() const; + // Return a reference to the non-modifiable "Status" selection of this + // object if "Status" is the current selection. The behavior is + // undefined unless "Status" is the selection of this object. - /// Return a reference to the non-modifiable "Disconnect" selection of - /// this object if "Disconnect" is the current selection. The behavior - /// is undefined unless "Disconnect" is the selection of this object. const Disconnect& disconnect() const; + // Return a reference to the non-modifiable "Disconnect" selection of + // this object if "Disconnect" is the current selection. The behavior + // is undefined unless "Disconnect" is the selection of this object. - /// Return a reference to the non-modifiable "DisconnectResponse" - /// selection of this object if "DisconnectResponse" is the current - /// selection. The behavior is undefined unless "DisconnectResponse" is - /// the selection of this object. const DisconnectResponse& disconnectResponse() const; + // Return a reference to the non-modifiable "DisconnectResponse" + // selection of this object if "DisconnectResponse" is the current + // selection. The behavior is undefined unless "DisconnectResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable "AdminCommand" selection of - /// this object if "AdminCommand" is the current selection. The - /// behavior is undefined unless "AdminCommand" is the selection of this - /// object. const AdminCommand& adminCommand() const; + // Return a reference to the non-modifiable "AdminCommand" selection of + // this object if "AdminCommand" is the current selection. The + // behavior is undefined unless "AdminCommand" is the selection of this + // object. - /// Return a reference to the non-modifiable "AdminCommandResponse" - /// selection of this object if "AdminCommandResponse" is the current - /// selection. The behavior is undefined unless "AdminCommandResponse" - /// is the selection of this object. const AdminCommandResponse& adminCommandResponse() const; + // Return a reference to the non-modifiable "AdminCommandResponse" + // selection of this object if "AdminCommandResponse" is the current + // selection. The behavior is undefined unless "AdminCommandResponse" + // is the selection of this object. - /// Return a reference to the non-modifiable "ClusterMessage" selection - /// of this object if "ClusterMessage" is the current selection. The - /// behavior is undefined unless "ClusterMessage" is the selection of - /// this object. const ClusterMessage& clusterMessage() const; + // Return a reference to the non-modifiable "ClusterMessage" selection + // of this object if "ClusterMessage" is the current selection. The + // behavior is undefined unless "ClusterMessage" is the selection of + // this object. - /// Return a reference to the non-modifiable "OpenQueue" selection of - /// this object if "OpenQueue" is the current selection. The behavior - /// is undefined unless "OpenQueue" is the selection of this object. const OpenQueue& openQueue() const; + // Return a reference to the non-modifiable "OpenQueue" selection of + // this object if "OpenQueue" is the current selection. The behavior + // is undefined unless "OpenQueue" is the selection of this object. - /// Return a reference to the non-modifiable "OpenQueueResponse" - /// selection of this object if "OpenQueueResponse" is the current - /// selection. The behavior is undefined unless "OpenQueueResponse" is - /// the selection of this object. const OpenQueueResponse& openQueueResponse() const; + // Return a reference to the non-modifiable "OpenQueueResponse" + // selection of this object if "OpenQueueResponse" is the current + // selection. The behavior is undefined unless "OpenQueueResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable "CloseQueue" selection of - /// this object if "CloseQueue" is the current selection. The behavior - /// is undefined unless "CloseQueue" is the selection of this object. const CloseQueue& closeQueue() const; + // Return a reference to the non-modifiable "CloseQueue" selection of + // this object if "CloseQueue" is the current selection. The behavior + // is undefined unless "CloseQueue" is the selection of this object. - /// Return a reference to the non-modifiable "CloseQueueResponse" - /// selection of this object if "CloseQueueResponse" is the current - /// selection. The behavior is undefined unless "CloseQueueResponse" is - /// the selection of this object. const CloseQueueResponse& closeQueueResponse() const; + // Return a reference to the non-modifiable "CloseQueueResponse" + // selection of this object if "CloseQueueResponse" is the current + // selection. The behavior is undefined unless "CloseQueueResponse" is + // the selection of this object. - /// Return a reference to the non-modifiable "ConfigureQueueStream" - /// selection of this object if "ConfigureQueueStream" is the current - /// selection. The behavior is undefined unless "ConfigureQueueStream" - /// is the selection of this object. const ConfigureQueueStream& configureQueueStream() const; + // Return a reference to the non-modifiable "ConfigureQueueStream" + // selection of this object if "ConfigureQueueStream" is the current + // selection. The behavior is undefined unless "ConfigureQueueStream" + // is the selection of this object. - /// Return a reference to the non-modifiable - /// "ConfigureQueueStreamResponse" selection of this object if - /// "ConfigureQueueStreamResponse" is the current selection. The - /// behavior is undefined unless "ConfigureQueueStreamResponse" is the - /// selection of this object. const ConfigureQueueStreamResponse& configureQueueStreamResponse() const; + // Return a reference to the non-modifiable + // "ConfigureQueueStreamResponse" selection of this object if + // "ConfigureQueueStreamResponse" is the current selection. The + // behavior is undefined unless "ConfigureQueueStreamResponse" is the + // selection of this object. - /// Return a reference to the non-modifiable "ConfigureStream" selection - /// of this object if "ConfigureStream" is the current selection. The - /// behavior is undefined unless "ConfigureStream" is the selection of - /// this object. const ConfigureStream& configureStream() const; + // Return a reference to the non-modifiable "ConfigureStream" selection + // of this object if "ConfigureStream" is the current selection. The + // behavior is undefined unless "ConfigureStream" is the selection of + // this object. - /// Return a reference to the non-modifiable "ConfigureStreamResponse" - /// selection of this object if "ConfigureStreamResponse" is the current - /// selection. The behavior is undefined unless - /// "ConfigureStreamResponse" is the selection of this object. const ConfigureStreamResponse& configureStreamResponse() const; + // Return a reference to the non-modifiable "ConfigureStreamResponse" + // selection of this object if "ConfigureStreamResponse" is the current + // selection. The behavior is undefined unless + // "ConfigureStreamResponse" is the selection of this object. - /// Return `true` if the value of this object is a "Status" value, and - /// return `false` otherwise. bool isStatusValue() const; + // Return 'true' if the value of this object is a "Status" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "Disconnect" value, - /// and return `false` otherwise. bool isDisconnectValue() const; + // Return 'true' if the value of this object is a "Disconnect" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "DisconnectResponse" - /// value, and return `false` otherwise. bool isDisconnectResponseValue() const; + // Return 'true' if the value of this object is a "DisconnectResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "AdminCommand" value, - /// and return `false` otherwise. bool isAdminCommandValue() const; + // Return 'true' if the value of this object is a "AdminCommand" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "AdminCommandResponse" value, and return `false` otherwise. bool isAdminCommandResponseValue() const; + // Return 'true' if the value of this object is a + // "AdminCommandResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ClusterMessage" - /// value, and return `false` otherwise. bool isClusterMessageValue() const; + // Return 'true' if the value of this object is a "ClusterMessage" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "OpenQueue" value, - /// and return `false` otherwise. bool isOpenQueueValue() const; + // Return 'true' if the value of this object is a "OpenQueue" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "OpenQueueResponse" - /// value, and return `false` otherwise. bool isOpenQueueResponseValue() const; + // Return 'true' if the value of this object is a "OpenQueueResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "CloseQueue" value, - /// and return `false` otherwise. bool isCloseQueueValue() const; + // Return 'true' if the value of this object is a "CloseQueue" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "CloseQueueResponse" - /// value, and return `false` otherwise. bool isCloseQueueResponseValue() const; + // Return 'true' if the value of this object is a "CloseQueueResponse" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "ConfigureQueueStream" value, and return `false` otherwise. bool isConfigureQueueStreamValue() const; + // Return 'true' if the value of this object is a + // "ConfigureQueueStream" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "ConfigureQueueStreamResponse" value, and return `false` otherwise. bool isConfigureQueueStreamResponseValue() const; + // Return 'true' if the value of this object is a + // "ConfigureQueueStreamResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is a "ConfigureStream" - /// value, and return `false` otherwise. bool isConfigureStreamValue() const; + // Return 'true' if the value of this object is a "ConfigureStream" + // value, and return 'false' otherwise. - /// Return `true` if the value of this object is a - /// "ConfigureStreamResponse" value, and return `false` otherwise. bool isConfigureStreamResponseValue() const; + // Return 'true' if the value of this object is a + // "ConfigureStreamResponse" value, and return 'false' otherwise. - /// Return `true` if the value of this object is undefined, and `false` - /// otherwise. bool isUndefinedValue() const; + // Return 'true' if the value of this object is undefined, and 'false' + // otherwise. - /// Return the symbolic name of the current selection of this object. const char* selectionName() const; + // Return the symbolic name of the current selection of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ControlMessageChoice& lhs, + const ControlMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'ControlMessageChoice' objects + // have the same value if either the selections in both objects have + // the same ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } + + friend bool operator!=(const ControlMessageChoice& lhs, + const ControlMessageChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ControlMessageChoice& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ControlMessageChoice& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ControlMessageChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `ControlMessageChoice` objects have the -/// same value if either the selections in both objects have the same ids and -/// the same values, or both selections are undefined. -inline bool operator==(const ControlMessageChoice& lhs, - const ControlMessageChoice& rhs); - -/// Return `true` if the specified `lhs` and `rhs` objects do not have the -/// same values, as determined by `operator==`, and `false` otherwise. -inline bool operator!=(const ControlMessageChoice& lhs, - const ControlMessageChoice& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ControlMessageChoice& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ControlMessageChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ControlMessageChoice& object); - } // close package namespace // TRAITS @@ -22917,14 +23074,15 @@ namespace bmqp_ctrlmsg { // class ControlMessage // ==================== -/// This type is the top level type for any message being sent by a client -/// to the broker or a broker to another broker. Each message can be -/// associated with an optional `rId` (requestId) that, if specified, will -/// be set to the same value as part of the response to correlate the -/// request and the response together. -/// rId....: optional id of this specific request choice.: enumerates all -/// the different types of control messages class ControlMessage { + // This type is the top level type for any message being sent by a client + // to the broker or a broker to another broker. Each message can be + // associated with an optional 'rId' (requestId) that, if specified, will + // be set to the same value as part of the response to correlate the + // request and the response together. + // rId....: optional id of this specific request choice.: enumerates all + // the different types of control messages + // INSTANCE DATA ControlMessageChoice d_choice; bdlb::NullableValue d_rId; @@ -22944,183 +23102,192 @@ class ControlMessage { public: // CLASS METHODS - - /// Return attribute information for the attribute indicated by the - /// specified `id` if the attribute exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(int id); + // Return attribute information for the attribute indicated by the + // specified 'id' if the attribute exists, and 0 otherwise. - /// Return attribute information for the attribute indicated by the - /// specified `name` of the specified `nameLength` if the attribute - /// exists, and 0 otherwise. static const bdlat_AttributeInfo* lookupAttributeInfo(const char* name, int nameLength); + // Return attribute information for the attribute indicated by the + // specified 'name' of the specified 'nameLength' if the attribute + // exists, and 0 otherwise. // CREATORS - - /// Create an object of type `ControlMessage` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit ControlMessage(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ControlMessage' having the default value. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. - /// Create an object of type `ControlMessage` having the value of the - /// specified `original` object. Use the optionally specified - /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the - /// currently installed default allocator is used. ControlMessage(const ControlMessage& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ControlMessage' having the value of the + // specified 'original' object. Use the optionally specified + // 'basicAllocator' to supply memory. If 'basicAllocator' is 0, the + // currently installed default allocator is used. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ControlMessage` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ControlMessage(ControlMessage&& original) noexcept; + // Create an object of type 'ControlMessage' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. - /// Create an object of type `ControlMessage` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. ControlMessage(ControlMessage&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ControlMessage' having the value of the + // specified 'original' object. After performing this action, the + // 'original' object will be left in a valid, but unspecified state. + // Use the optionally specified 'basicAllocator' to supply memory. If + // 'basicAllocator' is 0, the currently installed default allocator is + // used. #endif - /// Destroy this object. ~ControlMessage(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ControlMessage& operator=(const ControlMessage& rhs); + // Assign to this object the value of the specified 'rhs' object. #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Assign to this object the value of the specified `rhs` object. - /// After performing this action, the `rhs` object will be left in a - /// valid, but unspecified state. ControlMessage& operator=(ControlMessage&& rhs); + // Assign to this object the value of the specified 'rhs' object. + // After performing this action, the 'rhs' object will be left in a + // valid, but unspecified state. #endif - /// Reset this object to the default value (i.e., its value upon - /// default construction). void reset(); + // Reset this object to the default value (i.e., its value upon + // default construction). + + template + int manipulateAttributes(t_MANIPULATOR& manipulator); + // Invoke the specified 'manipulator' sequentially on the address of + // each (modifiable) attribute of this object, supplying 'manipulator' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'manipulator' (i.e., the invocation that + // terminated the sequence). + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, int id); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'id', + // supplying 'manipulator' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'manipulator' if 'id' identifies an attribute of this + // class, and -1 otherwise. + + template + int manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength); + // Invoke the specified 'manipulator' on the address of + // the (modifiable) attribute indicated by the specified 'name' of the + // specified 'nameLength', supplying 'manipulator' with the + // corresponding attribute information structure. Return the value + // returned from the invocation of 'manipulator' if 'name' identifies + // an attribute of this class, and -1 otherwise. - /// Invoke the specified `manipulator` sequentially on the address of - /// each (modifiable) attribute of this object, supplying `manipulator` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `manipulator` (i.e., the invocation that - /// terminated the sequence). - template - int manipulateAttributes(MANIPULATOR& manipulator); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `id`, - /// supplying `manipulator` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `manipulator` if `id` identifies an attribute of this - /// class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, int id); - - /// Invoke the specified `manipulator` on the address of - /// the (modifiable) attribute indicated by the specified `name` of the - /// specified `nameLength`, supplying `manipulator` with the - /// corresponding attribute information structure. Return the value - /// returned from the invocation of `manipulator` if `name` identifies - /// an attribute of this class, and -1 otherwise. - template - int manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength); - - /// Return a reference to the modifiable "RId" attribute of this object. bdlb::NullableValue& rId(); + // Return a reference to the modifiable "RId" attribute of this object. - /// Return a reference to the modifiable "Choice" attribute of this - /// object. ControlMessageChoice& choice(); + // Return a reference to the modifiable "Choice" attribute of this + // object. // ACCESSORS - - /// Format this object to the specified output `stream` at the - /// optionally specified indentation `level` and return a reference to - /// the modifiable `stream`. If `level` is specified, optionally - /// specify `spacesPerLevel`, the number of spaces per indentation level - /// for this and all of its nested objects. Each line is indented by - /// the absolute value of `level * spacesPerLevel`. If `level` is - /// negative, suppress indentation of the first line. If - /// `spacesPerLevel` is negative, suppress line breaks and format the - /// entire output on one line. If `stream` is initially invalid, this - /// operation has no effect. Note that a trailing newline is provided - /// in multiline mode only. bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; - - /// Invoke the specified `accessor` sequentially on each - /// (non-modifiable) attribute of this object, supplying `accessor` - /// with the corresponding attribute information structure until such - /// invocation returns a non-zero value. Return the value from the - /// last invocation of `accessor` (i.e., the invocation that terminated - /// the sequence). - template - int accessAttributes(ACCESSOR& accessor) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `id`, supplying `accessor` - /// with the corresponding attribute information structure. Return the - /// value returned from the invocation of `accessor` if `id` identifies - /// an attribute of this class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, int id) const; - - /// Invoke the specified `accessor` on the (non-modifiable) attribute - /// of this object indicated by the specified `name` of the specified - /// `nameLength`, supplying `accessor` with the corresponding attribute - /// information structure. Return the value returned from the - /// invocation of `accessor` if `name` identifies an attribute of this - /// class, and -1 otherwise. - template - int accessAttribute(ACCESSOR& accessor, + // Format this object to the specified output 'stream' at the + // optionally specified indentation 'level' and return a reference to + // the modifiable 'stream'. If 'level' is specified, optionally + // specify 'spacesPerLevel', the number of spaces per indentation level + // for this and all of its nested objects. Each line is indented by + // the absolute value of 'level * spacesPerLevel'. If 'level' is + // negative, suppress indentation of the first line. If + // 'spacesPerLevel' is negative, suppress line breaks and format the + // entire output on one line. If 'stream' is initially invalid, this + // operation has no effect. Note that a trailing newline is provided + // in multiline mode only. + + template + int accessAttributes(t_ACCESSOR& accessor) const; + // Invoke the specified 'accessor' sequentially on each + // (non-modifiable) attribute of this object, supplying 'accessor' + // with the corresponding attribute information structure until such + // invocation returns a non-zero value. Return the value from the + // last invocation of 'accessor' (i.e., the invocation that terminated + // the sequence). + + template + int accessAttribute(t_ACCESSOR& accessor, int id) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'id', supplying 'accessor' + // with the corresponding attribute information structure. Return the + // value returned from the invocation of 'accessor' if 'id' identifies + // an attribute of this class, and -1 otherwise. + + template + int accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const; + // Invoke the specified 'accessor' on the (non-modifiable) attribute + // of this object indicated by the specified 'name' of the specified + // 'nameLength', supplying 'accessor' with the corresponding attribute + // information structure. Return the value returned from the + // invocation of 'accessor' if 'name' identifies an attribute of this + // class, and -1 otherwise. - /// Return a reference to the non-modifiable "RId" attribute of this - /// object. const bdlb::NullableValue& rId() const; + // Return a reference offering non-modifiable access to the "RId" + // attribute of this object. - /// Return a reference to the non-modifiable "Choice" attribute of this - /// object. const ControlMessageChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ControlMessage& lhs, + const ControlMessage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.rId() == rhs.rId() && lhs.choice() == rhs.choice(); + } + + friend bool operator!=(const ControlMessage& lhs, + const ControlMessage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ControlMessage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const ControlMessage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'ControlMessage'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.rId()); + hashAppend(hashAlg, object.choice()); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` attribute objects have -/// the same value, and `false` otherwise. Two attribute objects have the -/// same value if each respective attribute has the same value. -inline bool operator==(const ControlMessage& lhs, const ControlMessage& rhs); - -/// Return `true` if the specified `lhs` and `rhs` attribute objects do not -/// have the same value, and `false` otherwise. Two attribute objects do -/// not have the same value if one or more respective attributes differ in -/// values. -inline bool operator!=(const ControlMessage& lhs, const ControlMessage& rhs); - -/// Format the specified `rhs` to the specified output `stream` and -/// return a reference to the modifiable `stream`. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const ControlMessage& rhs); - -/// Pass the specified `object` to the specified `hashAlg`. This function -/// integrates with the `bslh` modular hashing system and effectively -/// provides a `bsl::hash` specialization for `ControlMessage`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ControlMessage& object); - } // close package namespace // TRAITS @@ -23128,9 +23295,9 @@ void hashAppend(HASH_ALGORITHM& hashAlg, BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS( bmqp_ctrlmsg::ControlMessage) -// ============================================================================ -// INLINE FUNCTION DEFINITIONS -// ============================================================================ +//============================================================================= +// INLINE DEFINITIONS +//============================================================================= namespace bmqp_ctrlmsg { @@ -23140,8 +23307,8 @@ namespace bmqp_ctrlmsg { // CLASS METHODS // MANIPULATORS -template -int AdminCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int AdminCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -23151,11 +23318,11 @@ int AdminCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int AdminCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int AdminCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -23168,10 +23335,10 @@ int AdminCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int AdminCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int AdminCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23190,8 +23357,8 @@ inline bsl::string& AdminCommand::command() } // ACCESSORS -template -int AdminCommand::accessAttributes(ACCESSOR& accessor) const +template +int AdminCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -23200,11 +23367,11 @@ int AdminCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int AdminCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int AdminCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -23217,8 +23384,8 @@ int AdminCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int AdminCommand::accessAttribute(ACCESSOR& accessor, +template +int AdminCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -23238,24 +23405,14 @@ inline const bsl::string& AdminCommand::command() const return d_command; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::AdminCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.command()); -} - // -------------------------- // class AdminCommandResponse // -------------------------- // CLASS METHODS // MANIPULATORS -template -int AdminCommandResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int AdminCommandResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -23264,11 +23421,12 @@ int AdminCommandResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int AdminCommandResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int AdminCommandResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -23281,10 +23439,10 @@ int AdminCommandResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int AdminCommandResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int AdminCommandResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23303,8 +23461,8 @@ inline bsl::string& AdminCommandResponse::text() } // ACCESSORS -template -int AdminCommandResponse::accessAttributes(ACCESSOR& accessor) const +template +int AdminCommandResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -23313,11 +23471,11 @@ int AdminCommandResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int AdminCommandResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int AdminCommandResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -23329,8 +23487,8 @@ int AdminCommandResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int AdminCommandResponse::accessAttribute(ACCESSOR& accessor, +template +int AdminCommandResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -23350,24 +23508,14 @@ inline const bsl::string& AdminCommandResponse::text() const return d_text; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::AdminCommandResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.text()); -} - // --------------- // class AppIdInfo // --------------- // CLASS METHODS // MANIPULATORS -template -int AppIdInfo::manipulateAttributes(MANIPULATOR& manipulator) +template +int AppIdInfo::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -23382,11 +23530,11 @@ int AppIdInfo::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int AppIdInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int AppIdInfo::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -23403,10 +23551,10 @@ int AppIdInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int AppIdInfo::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int AppIdInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23430,8 +23578,8 @@ inline bsl::vector& AppIdInfo::appKey() } // ACCESSORS -template -int AppIdInfo::accessAttributes(ACCESSOR& accessor) const +template +int AppIdInfo::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -23445,11 +23593,11 @@ int AppIdInfo::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int AppIdInfo::accessAttribute(ACCESSOR& accessor, int id) const +template +int AppIdInfo::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -23465,8 +23613,8 @@ int AppIdInfo::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int AppIdInfo::accessAttribute(ACCESSOR& accessor, +template +int AppIdInfo::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -23491,14 +23639,138 @@ inline const bsl::vector& AppIdInfo::appKey() const return d_appKey; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::AppIdInfo& object) +// ------------------------- +// class AuthenticateRequest +// ------------------------- + +// CLASS METHODS +// MANIPULATORS +template +int AuthenticateRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.appId()); - hashAppend(hashAlg, object.appKey()); + int ret; + + ret = manipulator(&d_mechanism, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MECHANISM]); + if (ret) { + return ret; + } + + ret = manipulator(&d_data, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATA]); + if (ret) { + return ret; + } + + return 0; +} + +template +int AuthenticateRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) +{ + enum { NOT_FOUND = -1 }; + + switch (id) { + case ATTRIBUTE_ID_MECHANISM: { + return manipulator(&d_mechanism, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MECHANISM]); + } + case ATTRIBUTE_ID_DATA: { + return manipulator(&d_data, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATA]); + } + default: return NOT_FOUND; + } +} + +template +int AuthenticateRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) +{ + enum { NOT_FOUND = -1 }; + + const bdlat_AttributeInfo* attributeInfo = lookupAttributeInfo(name, + nameLength); + if (0 == attributeInfo) { + return NOT_FOUND; + } + + return manipulateAttribute(manipulator, attributeInfo->d_id); +} + +inline bsl::string& AuthenticateRequest::mechanism() +{ + return d_mechanism; +} + +inline bdlb::NullableValue >& AuthenticateRequest::data() +{ + return d_data; +} + +// ACCESSORS +template +int AuthenticateRequest::accessAttributes(t_ACCESSOR& accessor) const +{ + int ret; + + ret = accessor(d_mechanism, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MECHANISM]); + if (ret) { + return ret; + } + + ret = accessor(d_data, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATA]); + if (ret) { + return ret; + } + + return 0; +} + +template +int AuthenticateRequest::accessAttribute(t_ACCESSOR& accessor, int id) const +{ + enum { NOT_FOUND = -1 }; + + switch (id) { + case ATTRIBUTE_ID_MECHANISM: { + return accessor(d_mechanism, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MECHANISM]); + } + case ATTRIBUTE_ID_DATA: { + return accessor(d_data, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATA]); + } + default: return NOT_FOUND; + } +} + +template +int AuthenticateRequest::accessAttribute(t_ACCESSOR& accessor, + const char* name, + int nameLength) const +{ + enum { NOT_FOUND = -1 }; + + const bdlat_AttributeInfo* attributeInfo = lookupAttributeInfo(name, + nameLength); + if (0 == attributeInfo) { + return NOT_FOUND; + } + + return accessAttribute(accessor, attributeInfo->d_id); +} + +inline const bsl::string& AuthenticateRequest::mechanism() const +{ + return d_mechanism; +} + +inline const bdlb::NullableValue >& +AuthenticateRequest::data() const +{ + return d_data; } // -------------------- @@ -23543,17 +23815,15 @@ inline bsl::ostream& ClientType::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int CloseQueueResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int CloseQueueResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int CloseQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int CloseQueueResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -23563,10 +23833,10 @@ int CloseQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int CloseQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int CloseQueueResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23580,17 +23850,15 @@ int CloseQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int CloseQueueResponse::accessAttributes(ACCESSOR& accessor) const +template +int CloseQueueResponse::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int CloseQueueResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int CloseQueueResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -23600,8 +23868,8 @@ int CloseQueueResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int CloseQueueResponse::accessAttribute(ACCESSOR& accessor, +template +int CloseQueueResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -23616,32 +23884,21 @@ int CloseQueueResponse::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::CloseQueueResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------ // class ClusterSyncRequest // ------------------------ // CLASS METHODS // MANIPULATORS -template -int ClusterSyncRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int ClusterSyncRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int ClusterSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ClusterSyncRequest::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -23651,10 +23908,10 @@ int ClusterSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ClusterSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ClusterSyncRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23668,17 +23925,15 @@ int ClusterSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int ClusterSyncRequest::accessAttributes(ACCESSOR& accessor) const +template +int ClusterSyncRequest::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int ClusterSyncRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int ClusterSyncRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -23688,8 +23943,8 @@ int ClusterSyncRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ClusterSyncRequest::accessAttribute(ACCESSOR& accessor, +template +int ClusterSyncRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -23704,32 +23959,22 @@ int ClusterSyncRequest::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterSyncRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------- // class ClusterSyncResponse // ------------------------- // CLASS METHODS // MANIPULATORS -template -int ClusterSyncResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int ClusterSyncResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int ClusterSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ClusterSyncResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -23739,10 +23984,10 @@ int ClusterSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ClusterSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ClusterSyncResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23756,17 +24001,15 @@ int ClusterSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int ClusterSyncResponse::accessAttributes(ACCESSOR& accessor) const +template +int ClusterSyncResponse::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int ClusterSyncResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int ClusterSyncResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -23776,8 +24019,8 @@ int ClusterSyncResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ClusterSyncResponse::accessAttribute(ACCESSOR& accessor, +template +int ClusterSyncResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -23792,23 +24035,33 @@ int ClusterSyncResponse::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterSyncResponse& object) +// ------------------ +// class ConsumerInfo +// ------------------ + +// PRIVATE ACCESSORS +template +void ConsumerInfo::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; + hashAppend(hashAlgorithm, this->maxUnconfirmedMessages()); + hashAppend(hashAlgorithm, this->maxUnconfirmedBytes()); + hashAppend(hashAlgorithm, this->consumerPriority()); + hashAppend(hashAlgorithm, this->consumerPriorityCount()); } -// ------------------ -// class ConsumerInfo -// ------------------ +inline bool ConsumerInfo::isEqualTo(const ConsumerInfo& rhs) const +{ + return this->maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && + this->maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && + this->consumerPriority() == rhs.consumerPriority() && + this->consumerPriorityCount() == rhs.consumerPriorityCount(); +} // CLASS METHODS // MANIPULATORS -template -int ConsumerInfo::manipulateAttributes(MANIPULATOR& manipulator) +template +int ConsumerInfo::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -23839,11 +24092,11 @@ int ConsumerInfo::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ConsumerInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ConsumerInfo::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -23872,10 +24125,10 @@ int ConsumerInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ConsumerInfo::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConsumerInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -23909,8 +24162,8 @@ inline int& ConsumerInfo::consumerPriorityCount() } // ACCESSORS -template -int ConsumerInfo::accessAttributes(ACCESSOR& accessor) const +template +int ConsumerInfo::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -23941,11 +24194,11 @@ int ConsumerInfo::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConsumerInfo::accessAttribute(ACCESSOR& accessor, int id) const +template +int ConsumerInfo::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -23974,8 +24227,8 @@ int ConsumerInfo::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ConsumerInfo::accessAttribute(ACCESSOR& accessor, +template +int ConsumerInfo::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24010,36 +24263,21 @@ inline int ConsumerInfo::consumerPriorityCount() const return d_consumerPriorityCount; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConsumerInfo& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.maxUnconfirmedMessages()); - hashAppend(hashAlg, object.maxUnconfirmedBytes()); - hashAppend(hashAlg, object.consumerPriority()); - hashAppend(hashAlg, object.consumerPriorityCount()); -} - // ---------------- // class Disconnect // ---------------- // CLASS METHODS // MANIPULATORS -template -int Disconnect::manipulateAttributes(MANIPULATOR& manipulator) +template +int Disconnect::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int Disconnect::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int Disconnect::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24049,10 +24287,10 @@ int Disconnect::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int Disconnect::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int Disconnect::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24066,17 +24304,15 @@ int Disconnect::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int Disconnect::accessAttributes(ACCESSOR& accessor) const +template +int Disconnect::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int Disconnect::accessAttribute(ACCESSOR& accessor, int id) const +template +int Disconnect::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24086,8 +24322,8 @@ int Disconnect::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int Disconnect::accessAttribute(ACCESSOR& accessor, +template +int Disconnect::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24102,32 +24338,21 @@ int Disconnect::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::Disconnect& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------ // class DisconnectResponse // ------------------------ // CLASS METHODS // MANIPULATORS -template -int DisconnectResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int DisconnectResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int DisconnectResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int DisconnectResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24137,10 +24362,10 @@ int DisconnectResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int DisconnectResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int DisconnectResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24154,17 +24379,15 @@ int DisconnectResponse::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int DisconnectResponse::accessAttributes(ACCESSOR& accessor) const +template +int DisconnectResponse::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int DisconnectResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int DisconnectResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24174,8 +24397,8 @@ int DisconnectResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int DisconnectResponse::accessAttribute(ACCESSOR& accessor, +template +int DisconnectResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24190,15 +24413,6 @@ int DisconnectResponse::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::DisconnectResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // -------------------- // class DumpActionType // -------------------- @@ -24241,17 +24455,15 @@ inline bsl::ostream& DumpMsgType::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int ElectionProposal::manipulateAttributes(MANIPULATOR& manipulator) +template +int ElectionProposal::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int ElectionProposal::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ElectionProposal::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24261,10 +24473,10 @@ int ElectionProposal::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ElectionProposal::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ElectionProposal::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24278,17 +24490,15 @@ int ElectionProposal::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int ElectionProposal::accessAttributes(ACCESSOR& accessor) const +template +int ElectionProposal::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int ElectionProposal::accessAttribute(ACCESSOR& accessor, int id) const +template +int ElectionProposal::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24298,8 +24508,8 @@ int ElectionProposal::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ElectionProposal::accessAttribute(ACCESSOR& accessor, +template +int ElectionProposal::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24314,32 +24524,21 @@ int ElectionProposal::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectionProposal& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ---------------------- // class ElectionResponse // ---------------------- // CLASS METHODS // MANIPULATORS -template -int ElectionResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int ElectionResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int ElectionResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ElectionResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24349,10 +24548,10 @@ int ElectionResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ElectionResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ElectionResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24366,17 +24565,15 @@ int ElectionResponse::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int ElectionResponse::accessAttributes(ACCESSOR& accessor) const +template +int ElectionResponse::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int ElectionResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int ElectionResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24386,8 +24583,8 @@ int ElectionResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ElectionResponse::accessAttribute(ACCESSOR& accessor, +template +int ElectionResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24402,23 +24599,14 @@ int ElectionResponse::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectionResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ----------------------- // class ElectorNodeStatus // ----------------------- // CLASS METHODS // MANIPULATORS -template -int ElectorNodeStatus::manipulateAttributes(MANIPULATOR& manipulator) +template +int ElectorNodeStatus::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -24428,11 +24616,11 @@ int ElectorNodeStatus::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ElectorNodeStatus::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ElectorNodeStatus::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -24445,10 +24633,10 @@ int ElectorNodeStatus::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ElectorNodeStatus::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ElectorNodeStatus::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24467,8 +24655,8 @@ inline bool& ElectorNodeStatus::isAvailable() } // ACCESSORS -template -int ElectorNodeStatus::accessAttributes(ACCESSOR& accessor) const +template +int ElectorNodeStatus::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -24478,11 +24666,11 @@ int ElectorNodeStatus::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ElectorNodeStatus::accessAttribute(ACCESSOR& accessor, int id) const +template +int ElectorNodeStatus::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -24495,8 +24683,8 @@ int ElectorNodeStatus::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ElectorNodeStatus::accessAttribute(ACCESSOR& accessor, +template +int ElectorNodeStatus::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24516,16 +24704,6 @@ inline bool ElectorNodeStatus::isAvailable() const return d_isAvailable; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectorNodeStatus& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.isAvailable()); -} - // ----------------------- // class ExpressionVersion // ----------------------- @@ -24551,18 +24729,18 @@ inline bsl::ostream& ExpressionVersion::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int FollowerClusterStateRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int FollowerClusterStateRequest::manipulateAttributes( + t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int FollowerClusterStateRequest::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int FollowerClusterStateRequest::manipulateAttribute( + t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24572,10 +24750,11 @@ int FollowerClusterStateRequest::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int FollowerClusterStateRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int FollowerClusterStateRequest::manipulateAttribute( + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24589,18 +24768,16 @@ int FollowerClusterStateRequest::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int FollowerClusterStateRequest::accessAttributes(ACCESSOR& accessor) const +template +int FollowerClusterStateRequest::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int FollowerClusterStateRequest::accessAttribute(ACCESSOR& accessor, - int id) const +template +int FollowerClusterStateRequest::accessAttribute(t_ACCESSOR& accessor, + int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24610,8 +24787,8 @@ int FollowerClusterStateRequest::accessAttribute(ACCESSOR& accessor, } } -template -int FollowerClusterStateRequest::accessAttribute(ACCESSOR& accessor, +template +int FollowerClusterStateRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24626,32 +24803,21 @@ int FollowerClusterStateRequest::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerClusterStateRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------ // class FollowerLSNRequest // ------------------------ // CLASS METHODS // MANIPULATORS -template -int FollowerLSNRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int FollowerLSNRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int FollowerLSNRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int FollowerLSNRequest::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24661,10 +24827,10 @@ int FollowerLSNRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int FollowerLSNRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int FollowerLSNRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24678,17 +24844,15 @@ int FollowerLSNRequest::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int FollowerLSNRequest::accessAttributes(ACCESSOR& accessor) const +template +int FollowerLSNRequest::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int FollowerLSNRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int FollowerLSNRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24698,8 +24862,8 @@ int FollowerLSNRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int FollowerLSNRequest::accessAttribute(ACCESSOR& accessor, +template +int FollowerLSNRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24714,23 +24878,14 @@ int FollowerLSNRequest::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerLSNRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // -------------- // class GuidInfo // -------------- // CLASS METHODS // MANIPULATORS -template -int GuidInfo::manipulateAttributes(MANIPULATOR& manipulator) +template +int GuidInfo::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -24747,11 +24902,11 @@ int GuidInfo::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int GuidInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int GuidInfo::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -24769,10 +24924,10 @@ int GuidInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int GuidInfo::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int GuidInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24796,8 +24951,8 @@ inline bsls::Types::Int64& GuidInfo::nanoSecondsFromEpoch() } // ACCESSORS -template -int GuidInfo::accessAttributes(ACCESSOR& accessor) const +template +int GuidInfo::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -24814,11 +24969,11 @@ int GuidInfo::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int GuidInfo::accessAttribute(ACCESSOR& accessor, int id) const +template +int GuidInfo::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -24836,8 +24991,8 @@ int GuidInfo::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int GuidInfo::accessAttribute(ACCESSOR& accessor, +template +int GuidInfo::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24862,33 +25017,21 @@ inline bsls::Types::Int64 GuidInfo::nanoSecondsFromEpoch() const return d_nanoSecondsFromEpoch; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::GuidInfo& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.clientId()); - hashAppend(hashAlg, object.nanoSecondsFromEpoch()); -} - // ----------------------- // class HeartbeatResponse // ----------------------- // CLASS METHODS // MANIPULATORS -template -int HeartbeatResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int HeartbeatResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int HeartbeatResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int HeartbeatResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24898,10 +25041,10 @@ int HeartbeatResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int HeartbeatResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int HeartbeatResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -24915,17 +25058,15 @@ int HeartbeatResponse::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int HeartbeatResponse::accessAttributes(ACCESSOR& accessor) const +template +int HeartbeatResponse::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int HeartbeatResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int HeartbeatResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -24935,8 +25076,8 @@ int HeartbeatResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int HeartbeatResponse::accessAttribute(ACCESSOR& accessor, +template +int HeartbeatResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -24951,32 +25092,21 @@ int HeartbeatResponse::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::HeartbeatResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // --------------------- // class LeaderHeartbeat // --------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderHeartbeat::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderHeartbeat::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int LeaderHeartbeat::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderHeartbeat::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -24986,10 +25116,10 @@ int LeaderHeartbeat::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderHeartbeat::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderHeartbeat::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25003,17 +25133,15 @@ int LeaderHeartbeat::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int LeaderHeartbeat::accessAttributes(ACCESSOR& accessor) const +template +int LeaderHeartbeat::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int LeaderHeartbeat::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderHeartbeat::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -25023,8 +25151,8 @@ int LeaderHeartbeat::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderHeartbeat::accessAttribute(ACCESSOR& accessor, +template +int LeaderHeartbeat::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25039,23 +25167,14 @@ int LeaderHeartbeat::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderHeartbeat& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // --------------------------- // class LeaderMessageSequence // --------------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderMessageSequence::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderMessageSequence::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -25071,12 +25190,12 @@ int LeaderMessageSequence::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int LeaderMessageSequence::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int LeaderMessageSequence::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -25094,10 +25213,10 @@ int LeaderMessageSequence::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int LeaderMessageSequence::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderMessageSequence::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25121,8 +25240,8 @@ inline bsls::Types::Uint64& LeaderMessageSequence::sequenceNumber() } // ACCESSORS -template -int LeaderMessageSequence::accessAttributes(ACCESSOR& accessor) const +template +int LeaderMessageSequence::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -25138,11 +25257,11 @@ int LeaderMessageSequence::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int LeaderMessageSequence::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderMessageSequence::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -25159,8 +25278,8 @@ int LeaderMessageSequence::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderMessageSequence::accessAttribute(ACCESSOR& accessor, +template +int LeaderMessageSequence::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25185,34 +25304,21 @@ inline bsls::Types::Uint64 LeaderMessageSequence::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderMessageSequence& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.electorTerm()); - hashAppend(hashAlg, object.sequenceNumber()); -} - // ------------------- // class LeaderPassive // ------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderPassive::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderPassive::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int LeaderPassive::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderPassive::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -25222,10 +25328,10 @@ int LeaderPassive::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderPassive::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderPassive::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25239,17 +25345,15 @@ int LeaderPassive::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int LeaderPassive::accessAttributes(ACCESSOR& accessor) const +template +int LeaderPassive::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int LeaderPassive::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderPassive::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -25259,8 +25363,8 @@ int LeaderPassive::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderPassive::accessAttribute(ACCESSOR& accessor, +template +int LeaderPassive::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25275,32 +25379,22 @@ int LeaderPassive::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderPassive& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------- // class LeaderSyncDataQuery // ------------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderSyncDataQuery::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderSyncDataQuery::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int LeaderSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderSyncDataQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -25310,10 +25404,10 @@ int LeaderSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderSyncDataQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25327,17 +25421,15 @@ int LeaderSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int LeaderSyncDataQuery::accessAttributes(ACCESSOR& accessor) const +template +int LeaderSyncDataQuery::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int LeaderSyncDataQuery::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderSyncDataQuery::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -25347,8 +25439,8 @@ int LeaderSyncDataQuery::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderSyncDataQuery::accessAttribute(ACCESSOR& accessor, +template +int LeaderSyncDataQuery::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25363,32 +25455,22 @@ int LeaderSyncDataQuery::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncDataQuery& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // -------------------------- // class LeaderSyncStateQuery // -------------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderSyncStateQuery::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderSyncStateQuery::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int LeaderSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderSyncStateQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -25398,10 +25480,10 @@ int LeaderSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderSyncStateQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25415,17 +25497,15 @@ int LeaderSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int LeaderSyncStateQuery::accessAttributes(ACCESSOR& accessor) const +template +int LeaderSyncStateQuery::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int LeaderSyncStateQuery::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderSyncStateQuery::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -25435,8 +25515,8 @@ int LeaderSyncStateQuery::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderSyncStateQuery::accessAttribute(ACCESSOR& accessor, +template +int LeaderSyncStateQuery::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25451,35 +25531,24 @@ int LeaderSyncStateQuery::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncStateQuery& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ----------------------------------- // class LeadershipCessionNotification // ----------------------------------- // CLASS METHODS // MANIPULATORS -template +template int LeadershipCessionNotification::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template +template int LeadershipCessionNotification::manipulateAttribute( - MANIPULATOR& manipulator, - int id) + t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -25489,11 +25558,11 @@ int LeadershipCessionNotification::manipulateAttribute( } } -template +template int LeadershipCessionNotification::manipulateAttribute( - MANIPULATOR& manipulator, - const char* name, - int nameLength) + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25507,18 +25576,16 @@ int LeadershipCessionNotification::manipulateAttribute( } // ACCESSORS -template -int LeadershipCessionNotification::accessAttributes(ACCESSOR& accessor) const +template +int LeadershipCessionNotification::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int LeadershipCessionNotification::accessAttribute(ACCESSOR& accessor, - int id) const +template +int LeadershipCessionNotification::accessAttribute(t_ACCESSOR& accessor, + int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -25528,8 +25595,8 @@ int LeadershipCessionNotification::accessAttribute(ACCESSOR& accessor, } } -template -int LeadershipCessionNotification::accessAttribute(ACCESSOR& accessor, +template +int LeadershipCessionNotification::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25544,15 +25611,6 @@ int LeadershipCessionNotification::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeadershipCessionNotification& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ---------------- // class NodeStatus // ---------------- @@ -25575,10 +25633,21 @@ inline bsl::ostream& NodeStatus::print(bsl::ostream& stream, // class PartitionPrimaryInfo // -------------------------- +// PRIVATE ACCESSORS +template +void PartitionPrimaryInfo::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->primaryNodeId()); + hashAppend(hashAlgorithm, this->primaryLeaseId()); +} + // CLASS METHODS // MANIPULATORS -template -int PartitionPrimaryInfo::manipulateAttributes(MANIPULATOR& manipulator) +template +int PartitionPrimaryInfo::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -25600,11 +25669,12 @@ int PartitionPrimaryInfo::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PartitionPrimaryInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int PartitionPrimaryInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -25627,10 +25697,10 @@ int PartitionPrimaryInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int PartitionPrimaryInfo::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionPrimaryInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25659,8 +25729,8 @@ inline unsigned int& PartitionPrimaryInfo::primaryLeaseId() } // ACCESSORS -template -int PartitionPrimaryInfo::accessAttributes(ACCESSOR& accessor) const +template +int PartitionPrimaryInfo::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -25682,11 +25752,11 @@ int PartitionPrimaryInfo::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionPrimaryInfo::accessAttribute(ACCESSOR& accessor, int id) const +template +int PartitionPrimaryInfo::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -25708,8 +25778,8 @@ int PartitionPrimaryInfo::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PartitionPrimaryInfo::accessAttribute(ACCESSOR& accessor, +template +int PartitionPrimaryInfo::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25739,26 +25809,14 @@ inline unsigned int PartitionPrimaryInfo::primaryLeaseId() const return d_primaryLeaseId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionPrimaryInfo& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.primaryNodeId()); - hashAppend(hashAlg, object.primaryLeaseId()); -} - // ----------------------------- // class PartitionSequenceNumber // ----------------------------- // CLASS METHODS // MANIPULATORS -template -int PartitionSequenceNumber::manipulateAttributes(MANIPULATOR& manipulator) +template +int PartitionSequenceNumber::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -25774,12 +25832,12 @@ int PartitionSequenceNumber::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PartitionSequenceNumber::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int PartitionSequenceNumber::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -25798,10 +25856,10 @@ int PartitionSequenceNumber::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int PartitionSequenceNumber::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionSequenceNumber::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25825,8 +25883,8 @@ inline bsls::Types::Uint64& PartitionSequenceNumber::sequenceNumber() } // ACCESSORS -template -int PartitionSequenceNumber::accessAttributes(ACCESSOR& accessor) const +template +int PartitionSequenceNumber::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -25842,11 +25900,12 @@ int PartitionSequenceNumber::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionSequenceNumber::accessAttribute(ACCESSOR& accessor, int id) const +template +int PartitionSequenceNumber::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -25864,8 +25923,8 @@ int PartitionSequenceNumber::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PartitionSequenceNumber::accessAttribute(ACCESSOR& accessor, +template +int PartitionSequenceNumber::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -25890,26 +25949,26 @@ inline bsls::Types::Uint64 PartitionSequenceNumber::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSequenceNumber& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.primaryLeaseId()); - hashAppend(hashAlg, object.sequenceNumber()); -} - // ------------------------------------ // class PartitionSyncDataQueryResponse // ------------------------------------ +// PRIVATE ACCESSORS +template +void PartitionSyncDataQueryResponse::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->endPrimaryLeaseId()); + hashAppend(hashAlgorithm, this->endSequenceNum()); +} + // CLASS METHODS // MANIPULATORS -template +template int PartitionSyncDataQueryResponse::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { int ret; @@ -25932,13 +25991,13 @@ int PartitionSyncDataQueryResponse::manipulateAttributes( return ret; } - return ret; + return 0; } -template +template int PartitionSyncDataQueryResponse::manipulateAttribute( - MANIPULATOR& manipulator, - int id) + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -25961,11 +26020,11 @@ int PartitionSyncDataQueryResponse::manipulateAttribute( } } -template +template int PartitionSyncDataQueryResponse::manipulateAttribute( - MANIPULATOR& manipulator, - const char* name, - int nameLength) + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -25994,8 +26053,9 @@ inline bsls::Types::Uint64& PartitionSyncDataQueryResponse::endSequenceNum() } // ACCESSORS -template -int PartitionSyncDataQueryResponse::accessAttributes(ACCESSOR& accessor) const +template +int PartitionSyncDataQueryResponse::accessAttributes( + t_ACCESSOR& accessor) const { int ret; @@ -26017,12 +26077,12 @@ int PartitionSyncDataQueryResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionSyncDataQueryResponse::accessAttribute(ACCESSOR& accessor, - int id) const +template +int PartitionSyncDataQueryResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -26045,8 +26105,8 @@ int PartitionSyncDataQueryResponse::accessAttribute(ACCESSOR& accessor, } } -template -int PartitionSyncDataQueryResponse::accessAttribute(ACCESSOR& accessor, +template +int PartitionSyncDataQueryResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26077,26 +26137,14 @@ PartitionSyncDataQueryResponse::endSequenceNum() const return d_endSequenceNum; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.endPrimaryLeaseId()); - hashAppend(hashAlg, object.endSequenceNum()); -} - // ----------------------------- // class PartitionSyncStateQuery // ----------------------------- // CLASS METHODS // MANIPULATORS -template -int PartitionSyncStateQuery::manipulateAttributes(MANIPULATOR& manipulator) +template +int PartitionSyncStateQuery::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -26106,12 +26154,12 @@ int PartitionSyncStateQuery::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PartitionSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int PartitionSyncStateQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -26124,10 +26172,10 @@ int PartitionSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int PartitionSyncStateQuery::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionSyncStateQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26146,8 +26194,8 @@ inline int& PartitionSyncStateQuery::partitionId() } // ACCESSORS -template -int PartitionSyncStateQuery::accessAttributes(ACCESSOR& accessor) const +template +int PartitionSyncStateQuery::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -26157,11 +26205,12 @@ int PartitionSyncStateQuery::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionSyncStateQuery::accessAttribute(ACCESSOR& accessor, int id) const +template +int PartitionSyncStateQuery::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -26174,8 +26223,8 @@ int PartitionSyncStateQuery::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PartitionSyncStateQuery::accessAttribute(ACCESSOR& accessor, +template +int PartitionSyncStateQuery::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26195,16 +26244,6 @@ inline int PartitionSyncStateQuery::partitionId() const return d_partitionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncStateQuery& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); -} - // ------------------- // class PrimaryStatus // ------------------- @@ -26229,8 +26268,8 @@ inline bsl::ostream& PrimaryStatus::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int QueueAssignmentRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueAssignmentRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -26240,12 +26279,12 @@ int QueueAssignmentRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueAssignmentRequest::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueAssignmentRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -26258,10 +26297,10 @@ int QueueAssignmentRequest::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueAssignmentRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueAssignmentRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26280,8 +26319,8 @@ inline bsl::string& QueueAssignmentRequest::queueUri() } // ACCESSORS -template -int QueueAssignmentRequest::accessAttributes(ACCESSOR& accessor) const +template +int QueueAssignmentRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -26291,11 +26330,11 @@ int QueueAssignmentRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueAssignmentRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueAssignmentRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -26308,8 +26347,8 @@ int QueueAssignmentRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueAssignmentRequest::accessAttribute(ACCESSOR& accessor, +template +int QueueAssignmentRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26329,24 +26368,25 @@ inline const bsl::string& QueueAssignmentRequest::queueUri() const return d_queueUri; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueAssignmentRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.queueUri()); -} - // ------------------------------ // class QueueUnassignmentRequest // ------------------------------ +// PRIVATE ACCESSORS +template +void QueueUnassignmentRequest::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->queueUri()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->queueKey()); +} + // CLASS METHODS // MANIPULATORS -template -int QueueUnassignmentRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueUnassignmentRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -26368,12 +26408,12 @@ int QueueUnassignmentRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueUnassignmentRequest::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueUnassignmentRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -26394,10 +26434,10 @@ int QueueUnassignmentRequest::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueUnassignmentRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueUnassignmentRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26426,8 +26466,8 @@ inline bsl::vector& QueueUnassignmentRequest::queueKey() } // ACCESSORS -template -int QueueUnassignmentRequest::accessAttributes(ACCESSOR& accessor) const +template +int QueueUnassignmentRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -26449,11 +26489,12 @@ int QueueUnassignmentRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueUnassignmentRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueUnassignmentRequest::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -26474,8 +26515,8 @@ int QueueUnassignmentRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueUnassignmentRequest::accessAttribute(ACCESSOR& accessor, +template +int QueueUnassignmentRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26505,35 +26546,22 @@ inline const bsl::vector& QueueUnassignmentRequest::queueKey() const return d_queueKey; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUnassignmentRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.queueUri()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.queueKey()); -} - // -------------------------- // class RegistrationResponse // -------------------------- // CLASS METHODS // MANIPULATORS -template -int RegistrationResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int RegistrationResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int RegistrationResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int RegistrationResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -26543,10 +26571,10 @@ int RegistrationResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int RegistrationResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int RegistrationResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26560,17 +26588,15 @@ int RegistrationResponse::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int RegistrationResponse::accessAttributes(ACCESSOR& accessor) const +template +int RegistrationResponse::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int RegistrationResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int RegistrationResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -26580,8 +26606,8 @@ int RegistrationResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int RegistrationResponse::accessAttribute(ACCESSOR& accessor, +template +int RegistrationResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26596,15 +26622,6 @@ int RegistrationResponse::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::RegistrationResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // --------------------- // class ReplicaDataType // --------------------- @@ -26628,10 +26645,21 @@ inline bsl::ostream& ReplicaDataType::print(bsl::ostream& stream, // class ReverseConnectionRequest // ------------------------------ +// PRIVATE ACCESSORS +template +void ReverseConnectionRequest::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->protocolVersion()); + hashAppend(hashAlgorithm, this->clusterName()); + hashAppend(hashAlgorithm, this->clusterNodeId()); +} + // CLASS METHODS // MANIPULATORS -template -int ReverseConnectionRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int ReverseConnectionRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -26653,12 +26681,12 @@ int ReverseConnectionRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ReverseConnectionRequest::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int ReverseConnectionRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -26681,10 +26709,10 @@ int ReverseConnectionRequest::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int ReverseConnectionRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ReverseConnectionRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26713,8 +26741,8 @@ inline int& ReverseConnectionRequest::clusterNodeId() } // ACCESSORS -template -int ReverseConnectionRequest::accessAttributes(ACCESSOR& accessor) const +template +int ReverseConnectionRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -26736,11 +26764,12 @@ int ReverseConnectionRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ReverseConnectionRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int ReverseConnectionRequest::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -26762,8 +26791,8 @@ int ReverseConnectionRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ReverseConnectionRequest::accessAttribute(ACCESSOR& accessor, +template +int ReverseConnectionRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26793,26 +26822,14 @@ inline int ReverseConnectionRequest::clusterNodeId() const return d_clusterNodeId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReverseConnectionRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.protocolVersion()); - hashAppend(hashAlg, object.clusterName()); - hashAppend(hashAlg, object.clusterNodeId()); -} - // -------------------------- // class RoutingConfiguration // -------------------------- // CLASS METHODS // MANIPULATORS -template -int RoutingConfiguration::manipulateAttributes(MANIPULATOR& manipulator) +template +int RoutingConfiguration::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -26821,11 +26838,12 @@ int RoutingConfiguration::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int RoutingConfiguration::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int RoutingConfiguration::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -26838,10 +26856,10 @@ int RoutingConfiguration::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int RoutingConfiguration::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int RoutingConfiguration::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26860,8 +26878,8 @@ inline bsls::Types::Uint64& RoutingConfiguration::flags() } // ACCESSORS -template -int RoutingConfiguration::accessAttributes(ACCESSOR& accessor) const +template +int RoutingConfiguration::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -26870,11 +26888,11 @@ int RoutingConfiguration::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int RoutingConfiguration::accessAttribute(ACCESSOR& accessor, int id) const +template +int RoutingConfiguration::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -26886,8 +26904,8 @@ int RoutingConfiguration::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int RoutingConfiguration::accessAttribute(ACCESSOR& accessor, +template +int RoutingConfiguration::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -26907,16 +26925,6 @@ inline bsls::Types::Uint64 RoutingConfiguration::flags() const return d_flags; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::RoutingConfiguration& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.flags()); -} - // ------------------------------- // class RoutingConfigurationFlags // ------------------------------- @@ -26943,17 +26951,15 @@ RoutingConfigurationFlags::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int ScoutingRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int ScoutingRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int ScoutingRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ScoutingRequest::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -26963,10 +26969,10 @@ int ScoutingRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ScoutingRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ScoutingRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -26980,17 +26986,15 @@ int ScoutingRequest::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int ScoutingRequest::accessAttributes(ACCESSOR& accessor) const +template +int ScoutingRequest::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int ScoutingRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int ScoutingRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -27000,8 +27004,8 @@ int ScoutingRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ScoutingRequest::accessAttribute(ACCESSOR& accessor, +template +int ScoutingRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -27016,23 +27020,14 @@ int ScoutingRequest::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ScoutingRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ---------------------- // class ScoutingResponse // ---------------------- // CLASS METHODS // MANIPULATORS -template -int ScoutingResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int ScoutingResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -27042,11 +27037,11 @@ int ScoutingResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ScoutingResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ScoutingResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -27059,10 +27054,10 @@ int ScoutingResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ScoutingResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ScoutingResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -27081,8 +27076,8 @@ inline bool& ScoutingResponse::willVote() } // ACCESSORS -template -int ScoutingResponse::accessAttributes(ACCESSOR& accessor) const +template +int ScoutingResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -27092,11 +27087,11 @@ int ScoutingResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ScoutingResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int ScoutingResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -27109,8 +27104,8 @@ int ScoutingResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ScoutingResponse::accessAttribute(ACCESSOR& accessor, +template +int ScoutingResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -27130,16 +27125,6 @@ inline bool ScoutingResponse::willVote() const return d_willVote; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ScoutingResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.willVote()); -} - // -------------------- // class StatusCategory // -------------------- @@ -27164,8 +27149,8 @@ inline bsl::ostream& StatusCategory::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int StopRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int StopRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -27181,11 +27166,11 @@ int StopRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StopRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StopRequest::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -27202,10 +27187,10 @@ int StopRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StopRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StopRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -27229,8 +27214,8 @@ inline int& StopRequest::version() } // ACCESSORS -template -int StopRequest::accessAttributes(ACCESSOR& accessor) const +template +int StopRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -27244,11 +27229,12 @@ int StopRequest::accessAttributes(ACCESSOR& accessor) const if (ret) { return ret; } - return ret; + + return 0; } -template -int StopRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int StopRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -27265,8 +27251,8 @@ int StopRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StopRequest::accessAttribute(ACCESSOR& accessor, +template +int StopRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -27291,24 +27277,14 @@ inline int StopRequest::version() const return d_version; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StopRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.clusterName()); -} - // ------------------ // class StopResponse // ------------------ // CLASS METHODS // MANIPULATORS -template -int StopResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int StopResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -27318,11 +27294,11 @@ int StopResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StopResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StopResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -27335,10 +27311,10 @@ int StopResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StopResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StopResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -27357,8 +27333,8 @@ inline bsl::string& StopResponse::clusterName() } // ACCESSORS -template -int StopResponse::accessAttributes(ACCESSOR& accessor) const +template +int StopResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -27368,11 +27344,11 @@ int StopResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StopResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int StopResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -27385,8 +27361,8 @@ int StopResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StopResponse::accessAttribute(ACCESSOR& accessor, +template +int StopResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -27406,16 +27382,6 @@ inline const bsl::string& StopResponse::clusterName() const return d_clusterName; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StopResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.clusterName()); -} - // ----------------------------- // class StorageSyncResponseType // ----------------------------- @@ -27442,8 +27408,8 @@ StorageSyncResponseType::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int SubQueueIdInfo::manipulateAttributes(MANIPULATOR& manipulator) +template +int SubQueueIdInfo::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -27457,11 +27423,11 @@ int SubQueueIdInfo::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int SubQueueIdInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int SubQueueIdInfo::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -27478,10 +27444,10 @@ int SubQueueIdInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int SubQueueIdInfo::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int SubQueueIdInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -27505,8 +27471,8 @@ inline bsl::string& SubQueueIdInfo::appId() } // ACCESSORS -template -int SubQueueIdInfo::accessAttributes(ACCESSOR& accessor) const +template +int SubQueueIdInfo::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -27520,11 +27486,11 @@ int SubQueueIdInfo::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int SubQueueIdInfo::accessAttribute(ACCESSOR& accessor, int id) const +template +int SubQueueIdInfo::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -27539,8 +27505,8 @@ int SubQueueIdInfo::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int SubQueueIdInfo::accessAttribute(ACCESSOR& accessor, +template +int SubQueueIdInfo::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -27565,25 +27531,33 @@ inline const bsl::string& SubQueueIdInfo::appId() const return d_appId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::SubQueueIdInfo& object) +// --------------- +// class SyncPoint +// --------------- + +// PRIVATE ACCESSORS +template +void SyncPoint::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.subId()); - hashAppend(hashAlg, object.appId()); + hashAppend(hashAlgorithm, this->primaryLeaseId()); + hashAppend(hashAlgorithm, this->sequenceNum()); + hashAppend(hashAlgorithm, this->dataFileOffsetDwords()); + hashAppend(hashAlgorithm, this->qlistFileOffsetWords()); } -// --------------- -// class SyncPoint -// --------------- +inline bool SyncPoint::isEqualTo(const SyncPoint& rhs) const +{ + return this->primaryLeaseId() == rhs.primaryLeaseId() && + this->sequenceNum() == rhs.sequenceNum() && + this->dataFileOffsetDwords() == rhs.dataFileOffsetDwords() && + this->qlistFileOffsetWords() == rhs.qlistFileOffsetWords(); +} // CLASS METHODS // MANIPULATORS -template -int SyncPoint::manipulateAttributes(MANIPULATOR& manipulator) +template +int SyncPoint::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -27613,11 +27587,11 @@ int SyncPoint::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int SyncPoint::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int SyncPoint::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -27645,10 +27619,10 @@ int SyncPoint::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int SyncPoint::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int SyncPoint::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -27682,8 +27656,8 @@ inline unsigned int& SyncPoint::qlistFileOffsetWords() } // ACCESSORS -template -int SyncPoint::accessAttributes(ACCESSOR& accessor) const +template +int SyncPoint::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -27713,11 +27687,11 @@ int SyncPoint::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int SyncPoint::accessAttribute(ACCESSOR& accessor, int id) const +template +int SyncPoint::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -27745,8 +27719,8 @@ int SyncPoint::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int SyncPoint::accessAttribute(ACCESSOR& accessor, +template +int SyncPoint::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -27781,26 +27755,48 @@ inline unsigned int SyncPoint::qlistFileOffsetWords() const return d_qlistFileOffsetWords; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::SyncPoint& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.primaryLeaseId()); - hashAppend(hashAlg, object.sequenceNum()); - hashAppend(hashAlg, object.dataFileOffsetDwords()); - hashAppend(hashAlg, object.qlistFileOffsetWords()); -} - // -------------------- // class ClientIdentity // -------------------- +// PRIVATE ACCESSORS +template +void ClientIdentity::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->protocolVersion()); + hashAppend(hashAlgorithm, this->sdkVersion()); + hashAppend(hashAlgorithm, this->clientType()); + hashAppend(hashAlgorithm, this->processName()); + hashAppend(hashAlgorithm, this->pid()); + hashAppend(hashAlgorithm, this->sessionId()); + hashAppend(hashAlgorithm, this->hostName()); + hashAppend(hashAlgorithm, this->features()); + hashAppend(hashAlgorithm, this->clusterName()); + hashAppend(hashAlgorithm, this->clusterNodeId()); + hashAppend(hashAlgorithm, this->sdkLanguage()); + hashAppend(hashAlgorithm, this->guidInfo()); +} + +inline bool ClientIdentity::isEqualTo(const ClientIdentity& rhs) const +{ + return this->protocolVersion() == rhs.protocolVersion() && + this->sdkVersion() == rhs.sdkVersion() && + this->clientType() == rhs.clientType() && + this->processName() == rhs.processName() && + this->pid() == rhs.pid() && this->sessionId() == rhs.sessionId() && + this->hostName() == rhs.hostName() && + this->features() == rhs.features() && + this->clusterName() == rhs.clusterName() && + this->clusterNodeId() == rhs.clusterNodeId() && + this->sdkLanguage() == rhs.sdkLanguage() && + this->guidInfo() == rhs.guidInfo(); +} + // CLASS METHODS // MANIPULATORS -template -int ClientIdentity::manipulateAttributes(MANIPULATOR& manipulator) +template +int ClientIdentity::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -27875,11 +27871,11 @@ int ClientIdentity::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ClientIdentity::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ClientIdentity::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -27937,10 +27933,10 @@ int ClientIdentity::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ClientIdentity::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ClientIdentity::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -28014,8 +28010,8 @@ inline GuidInfo& ClientIdentity::guidInfo() } // ACCESSORS -template -int ClientIdentity::accessAttributes(ACCESSOR& accessor) const +template +int ClientIdentity::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -28089,11 +28085,11 @@ int ClientIdentity::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ClientIdentity::accessAttribute(ACCESSOR& accessor, int id) const +template +int ClientIdentity::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -28150,8 +28146,8 @@ int ClientIdentity::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ClientIdentity::accessAttribute(ACCESSOR& accessor, +template +int ClientIdentity::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -28226,35 +28222,24 @@ inline const GuidInfo& ClientIdentity::guidInfo() const return d_guidInfo; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClientIdentity& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.protocolVersion()); - hashAppend(hashAlg, object.sdkVersion()); - hashAppend(hashAlg, object.clientType()); - hashAppend(hashAlg, object.processName()); - hashAppend(hashAlg, object.pid()); - hashAppend(hashAlg, object.sessionId()); - hashAppend(hashAlg, object.hostName()); - hashAppend(hashAlg, object.features()); - hashAppend(hashAlg, object.clusterName()); - hashAppend(hashAlg, object.clusterNodeId()); - hashAppend(hashAlg, object.sdkLanguage()); - hashAppend(hashAlg, object.guidInfo()); -} - // ------------------ // class DumpMessages // ------------------ +// PRIVATE ACCESSORS +template +void DumpMessages::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->msgTypeToDump()); + hashAppend(hashAlgorithm, this->dumpActionType()); + hashAppend(hashAlgorithm, this->dumpActionValue()); +} + // CLASS METHODS // MANIPULATORS -template -int DumpMessages::manipulateAttributes(MANIPULATOR& manipulator) +template +int DumpMessages::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -28276,11 +28261,11 @@ int DumpMessages::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int DumpMessages::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int DumpMessages::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -28304,10 +28289,10 @@ int DumpMessages::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int DumpMessages::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int DumpMessages::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -28336,8 +28321,8 @@ inline int& DumpMessages::dumpActionValue() } // ACCESSORS -template -int DumpMessages::accessAttributes(ACCESSOR& accessor) const +template +int DumpMessages::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -28359,11 +28344,11 @@ int DumpMessages::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int DumpMessages::accessAttribute(ACCESSOR& accessor, int id) const +template +int DumpMessages::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -28387,8 +28372,8 @@ int DumpMessages::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int DumpMessages::accessAttribute(ACCESSOR& accessor, +template +int DumpMessages::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -28418,23 +28403,81 @@ inline int DumpMessages::dumpActionValue() const return d_dumpActionValue; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::DumpMessages& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.msgTypeToDump()); - hashAppend(hashAlg, object.dumpActionType()); - hashAppend(hashAlg, object.dumpActionValue()); -} - // -------------------------- // class ElectorMessageChoice // -------------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void ElectorMessageChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef ElectorMessageChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_ELECTION_PROPOSAL: + hashAppend(hashAlgorithm, this->electionProposal()); + break; + case Class::SELECTION_ID_ELECTION_RESPONSE: + hashAppend(hashAlgorithm, this->electionResponse()); + break; + case Class::SELECTION_ID_LEADER_HEARTBEAT: + hashAppend(hashAlgorithm, this->leaderHeartbeat()); + break; + case Class::SELECTION_ID_ELECTOR_NODE_STATUS: + hashAppend(hashAlgorithm, this->electorNodeStatus()); + break; + case Class::SELECTION_ID_HEARTBEAT_RESPONSE: + hashAppend(hashAlgorithm, this->heartbeatResponse()); + break; + case Class::SELECTION_ID_SCOUTING_REQUEST: + hashAppend(hashAlgorithm, this->scoutingRequest()); + break; + case Class::SELECTION_ID_SCOUTING_RESPONSE: + hashAppend(hashAlgorithm, this->scoutingResponse()); + break; + case Class::SELECTION_ID_LEADERSHIP_CESSION_NOTIFICATION: + hashAppend(hashAlgorithm, this->leadershipCessionNotification()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool +ElectorMessageChoice::isEqualTo(const ElectorMessageChoice& rhs) const +{ + typedef ElectorMessageChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_ELECTION_PROPOSAL: + return this->electionProposal() == rhs.electionProposal(); + case Class::SELECTION_ID_ELECTION_RESPONSE: + return this->electionResponse() == rhs.electionResponse(); + case Class::SELECTION_ID_LEADER_HEARTBEAT: + return this->leaderHeartbeat() == rhs.leaderHeartbeat(); + case Class::SELECTION_ID_ELECTOR_NODE_STATUS: + return this->electorNodeStatus() == rhs.electorNodeStatus(); + case Class::SELECTION_ID_HEARTBEAT_RESPONSE: + return this->heartbeatResponse() == rhs.heartbeatResponse(); + case Class::SELECTION_ID_SCOUTING_REQUEST: + return this->scoutingRequest() == rhs.scoutingRequest(); + case Class::SELECTION_ID_SCOUTING_RESPONSE: + return this->scoutingResponse() == rhs.scoutingResponse(); + case Class::SELECTION_ID_LEADERSHIP_CESSION_NOTIFICATION: + return this->leadershipCessionNotification() == + rhs.leadershipCessionNotification(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline ElectorMessageChoice::ElectorMessageChoice() : d_selectionId(SELECTION_ID_UNDEFINED) @@ -28447,8 +28490,8 @@ inline ElectorMessageChoice::~ElectorMessageChoice() } // MANIPULATORS -template -int ElectorMessageChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int ElectorMessageChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case ElectorMessageChoice::SELECTION_ID_ELECTION_PROPOSAL: @@ -28546,8 +28589,8 @@ inline int ElectorMessageChoice::selectionId() const return d_selectionId; } -template -int ElectorMessageChoice::accessSelection(ACCESSOR& accessor) const +template +int ElectorMessageChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_ELECTION_PROPOSAL: @@ -28680,51 +28723,14 @@ inline bool ElectorMessageChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectorMessageChoice& object) -{ - typedef bmqp_ctrlmsg::ElectorMessageChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_ELECTION_PROPOSAL: - hashAppend(hashAlg, object.electionProposal()); - break; - case Class::SELECTION_ID_ELECTION_RESPONSE: - hashAppend(hashAlg, object.electionResponse()); - break; - case Class::SELECTION_ID_LEADER_HEARTBEAT: - hashAppend(hashAlg, object.leaderHeartbeat()); - break; - case Class::SELECTION_ID_ELECTOR_NODE_STATUS: - hashAppend(hashAlg, object.electorNodeStatus()); - break; - case Class::SELECTION_ID_HEARTBEAT_RESPONSE: - hashAppend(hashAlg, object.heartbeatResponse()); - break; - case Class::SELECTION_ID_SCOUTING_REQUEST: - hashAppend(hashAlg, object.scoutingRequest()); - break; - case Class::SELECTION_ID_SCOUTING_RESPONSE: - hashAppend(hashAlg, object.scoutingResponse()); - break; - case Class::SELECTION_ID_LEADERSHIP_CESSION_NOTIFICATION: - hashAppend(hashAlg, object.leadershipCessionNotification()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // ---------------- // class Expression // ---------------- // CLASS METHODS // MANIPULATORS -template -int Expression::manipulateAttributes(MANIPULATOR& manipulator) +template +int Expression::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -28739,11 +28745,11 @@ int Expression::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int Expression::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int Expression::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -28760,10 +28766,10 @@ int Expression::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int Expression::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int Expression::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -28787,8 +28793,8 @@ inline bsl::string& Expression::text() } // ACCESSORS -template -int Expression::accessAttributes(ACCESSOR& accessor) const +template +int Expression::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -28802,11 +28808,11 @@ int Expression::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int Expression::accessAttribute(ACCESSOR& accessor, int id) const +template +int Expression::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -28822,8 +28828,8 @@ int Expression::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int Expression::accessAttribute(ACCESSOR& accessor, +template +int Expression::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -28848,25 +28854,14 @@ inline const bsl::string& Expression::text() const return d_text; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::Expression& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.version()); - hashAppend(hashAlg, object.text()); -} - // ------------------------- // class FollowerLSNResponse // ------------------------- // CLASS METHODS // MANIPULATORS -template -int FollowerLSNResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int FollowerLSNResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -28876,11 +28871,12 @@ int FollowerLSNResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int FollowerLSNResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int FollowerLSNResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -28894,10 +28890,10 @@ int FollowerLSNResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int FollowerLSNResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int FollowerLSNResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -28916,8 +28912,8 @@ inline LeaderMessageSequence& FollowerLSNResponse::sequenceNumber() } // ACCESSORS -template -int FollowerLSNResponse::accessAttributes(ACCESSOR& accessor) const +template +int FollowerLSNResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -28927,11 +28923,11 @@ int FollowerLSNResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int FollowerLSNResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int FollowerLSNResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -28944,8 +28940,8 @@ int FollowerLSNResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int FollowerLSNResponse::accessAttribute(ACCESSOR& accessor, +template +int FollowerLSNResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -28965,24 +28961,14 @@ inline const LeaderMessageSequence& FollowerLSNResponse::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerLSNResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); -} - // ----------------------- // class LeaderAdvisoryAck // ----------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderAdvisoryAck::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderAdvisoryAck::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -28993,11 +28979,11 @@ int LeaderAdvisoryAck::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int LeaderAdvisoryAck::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderAdvisoryAck::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -29011,10 +28997,10 @@ int LeaderAdvisoryAck::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderAdvisoryAck::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderAdvisoryAck::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29033,8 +29019,8 @@ inline LeaderMessageSequence& LeaderAdvisoryAck::sequenceNumberAcked() } // ACCESSORS -template -int LeaderAdvisoryAck::accessAttributes(ACCESSOR& accessor) const +template +int LeaderAdvisoryAck::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29045,11 +29031,11 @@ int LeaderAdvisoryAck::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int LeaderAdvisoryAck::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderAdvisoryAck::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -29063,8 +29049,8 @@ int LeaderAdvisoryAck::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderAdvisoryAck::accessAttribute(ACCESSOR& accessor, +template +int LeaderAdvisoryAck::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29085,24 +29071,14 @@ LeaderAdvisoryAck::sequenceNumberAcked() const return d_sequenceNumberAcked; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderAdvisoryAck& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumberAcked()); -} - // -------------------------- // class LeaderAdvisoryCommit // -------------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderAdvisoryCommit::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderAdvisoryCommit::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -29119,11 +29095,12 @@ int LeaderAdvisoryCommit::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int LeaderAdvisoryCommit::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderAdvisoryCommit::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -29142,10 +29119,10 @@ int LeaderAdvisoryCommit::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderAdvisoryCommit::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderAdvisoryCommit::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29169,8 +29146,8 @@ inline LeaderMessageSequence& LeaderAdvisoryCommit::sequenceNumberCommitted() } // ACCESSORS -template -int LeaderAdvisoryCommit::accessAttributes(ACCESSOR& accessor) const +template +int LeaderAdvisoryCommit::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29187,11 +29164,11 @@ int LeaderAdvisoryCommit::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int LeaderAdvisoryCommit::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderAdvisoryCommit::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -29209,8 +29186,8 @@ int LeaderAdvisoryCommit::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderAdvisoryCommit::accessAttribute(ACCESSOR& accessor, +template +int LeaderAdvisoryCommit::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29237,26 +29214,15 @@ LeaderAdvisoryCommit::sequenceNumberCommitted() const return d_sequenceNumberCommitted; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderAdvisoryCommit& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); - hashAppend(hashAlg, object.sequenceNumberCommitted()); -} - // ---------------------------------- // class LeaderSyncStateQueryResponse // ---------------------------------- // CLASS METHODS // MANIPULATORS -template +template int LeaderSyncStateQueryResponse::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { int ret; @@ -29267,12 +29233,13 @@ int LeaderSyncStateQueryResponse::manipulateAttributes( return ret; } - return ret; + return 0; } -template -int LeaderSyncStateQueryResponse::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int LeaderSyncStateQueryResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -29286,10 +29253,11 @@ int LeaderSyncStateQueryResponse::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int LeaderSyncStateQueryResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderSyncStateQueryResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29309,8 +29277,8 @@ LeaderSyncStateQueryResponse::leaderMessageSequence() } // ACCESSORS -template -int LeaderSyncStateQueryResponse::accessAttributes(ACCESSOR& accessor) const +template +int LeaderSyncStateQueryResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29321,12 +29289,12 @@ int LeaderSyncStateQueryResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int LeaderSyncStateQueryResponse::accessAttribute(ACCESSOR& accessor, - int id) const +template +int LeaderSyncStateQueryResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -29340,8 +29308,8 @@ int LeaderSyncStateQueryResponse::accessAttribute(ACCESSOR& accessor, } } -template -int LeaderSyncStateQueryResponse::accessAttribute(ACCESSOR& accessor, +template +int LeaderSyncStateQueryResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29362,24 +29330,14 @@ LeaderSyncStateQueryResponse::leaderMessageSequence() const return d_leaderMessageSequence; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.leaderMessageSequence()); -} - // ------------------------ // class NodeStatusAdvisory // ------------------------ // CLASS METHODS // MANIPULATORS -template -int NodeStatusAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int NodeStatusAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -29388,11 +29346,11 @@ int NodeStatusAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int NodeStatusAdvisory::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int NodeStatusAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -29405,10 +29363,10 @@ int NodeStatusAdvisory::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int NodeStatusAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int NodeStatusAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29427,8 +29385,8 @@ inline NodeStatus::Value& NodeStatusAdvisory::status() } // ACCESSORS -template -int NodeStatusAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int NodeStatusAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29437,11 +29395,11 @@ int NodeStatusAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int NodeStatusAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int NodeStatusAdvisory::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -29454,8 +29412,8 @@ int NodeStatusAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int NodeStatusAdvisory::accessAttribute(ACCESSOR& accessor, +template +int NodeStatusAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29475,24 +29433,14 @@ inline NodeStatus::Value NodeStatusAdvisory::status() const return d_status; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::NodeStatusAdvisory& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.status()); -} - // ------------------------------ // class PartitionPrimaryAdvisory // ------------------------------ // CLASS METHODS // MANIPULATORS -template -int PartitionPrimaryAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int PartitionPrimaryAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -29508,12 +29456,12 @@ int PartitionPrimaryAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PartitionPrimaryAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int PartitionPrimaryAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -29531,10 +29479,10 @@ int PartitionPrimaryAdvisory::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int PartitionPrimaryAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionPrimaryAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29559,8 +29507,8 @@ PartitionPrimaryAdvisory::partitions() } // ACCESSORS -template -int PartitionPrimaryAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int PartitionPrimaryAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29576,11 +29524,12 @@ int PartitionPrimaryAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionPrimaryAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int PartitionPrimaryAdvisory::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -29597,8 +29546,8 @@ int PartitionPrimaryAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PartitionPrimaryAdvisory::accessAttribute(ACCESSOR& accessor, +template +int PartitionPrimaryAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29625,25 +29574,14 @@ PartitionPrimaryAdvisory::partitions() const return d_partitions; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionPrimaryAdvisory& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); - hashAppend(hashAlg, object.partitions()); -} - // ------------------------- // class PrimaryStateRequest // ------------------------- // CLASS METHODS // MANIPULATORS -template -int PrimaryStateRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int PrimaryStateRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -29659,11 +29597,12 @@ int PrimaryStateRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PrimaryStateRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int PrimaryStateRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -29681,10 +29620,10 @@ int PrimaryStateRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int PrimaryStateRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PrimaryStateRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29708,8 +29647,8 @@ inline PartitionSequenceNumber& PrimaryStateRequest::sequenceNumber() } // ACCESSORS -template -int PrimaryStateRequest::accessAttributes(ACCESSOR& accessor) const +template +int PrimaryStateRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29725,11 +29664,11 @@ int PrimaryStateRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PrimaryStateRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int PrimaryStateRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -29746,8 +29685,8 @@ int PrimaryStateRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PrimaryStateRequest::accessAttribute(ACCESSOR& accessor, +template +int PrimaryStateRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29773,25 +29712,14 @@ PrimaryStateRequest::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PrimaryStateRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.sequenceNumber()); -} - // -------------------------- // class PrimaryStateResponse // -------------------------- // CLASS METHODS // MANIPULATORS -template -int PrimaryStateResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int PrimaryStateResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -29807,11 +29735,12 @@ int PrimaryStateResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PrimaryStateResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int PrimaryStateResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -29829,10 +29758,10 @@ int PrimaryStateResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int PrimaryStateResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PrimaryStateResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -29856,8 +29785,8 @@ inline PartitionSequenceNumber& PrimaryStateResponse::sequenceNumber() } // ACCESSORS -template -int PrimaryStateResponse::accessAttributes(ACCESSOR& accessor) const +template +int PrimaryStateResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -29873,11 +29802,11 @@ int PrimaryStateResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PrimaryStateResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int PrimaryStateResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -29894,8 +29823,8 @@ int PrimaryStateResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PrimaryStateResponse::accessAttribute(ACCESSOR& accessor, +template +int PrimaryStateResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -29921,25 +29850,25 @@ PrimaryStateResponse::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PrimaryStateResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.sequenceNumber()); -} - // --------------------------- // class PrimaryStatusAdvisory // --------------------------- +// PRIVATE ACCESSORS +template +void PrimaryStatusAdvisory::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->primaryLeaseId()); + hashAppend(hashAlgorithm, this->status()); +} + // CLASS METHODS // MANIPULATORS -template -int PrimaryStatusAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int PrimaryStatusAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -29960,12 +29889,12 @@ int PrimaryStatusAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PrimaryStatusAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int PrimaryStatusAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -29987,10 +29916,10 @@ int PrimaryStatusAdvisory::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int PrimaryStatusAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PrimaryStatusAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -30019,8 +29948,8 @@ inline PrimaryStatus::Value& PrimaryStatusAdvisory::status() } // ACCESSORS -template -int PrimaryStatusAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int PrimaryStatusAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -30041,11 +29970,11 @@ int PrimaryStatusAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PrimaryStatusAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int PrimaryStatusAdvisory::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -30067,8 +29996,8 @@ int PrimaryStatusAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PrimaryStatusAdvisory::accessAttribute(ACCESSOR& accessor, +template +int PrimaryStatusAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -30098,26 +30027,40 @@ inline PrimaryStatus::Value PrimaryStatusAdvisory::status() const return d_status; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PrimaryStatusAdvisory& object) +// --------------------------- +// class QueueHandleParameters +// --------------------------- + +// PRIVATE ACCESSORS +template +void QueueHandleParameters::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.primaryLeaseId()); - hashAppend(hashAlg, object.status()); + hashAppend(hashAlgorithm, this->uri()); + hashAppend(hashAlgorithm, this->qId()); + hashAppend(hashAlgorithm, this->subIdInfo()); + hashAppend(hashAlgorithm, this->flags()); + hashAppend(hashAlgorithm, this->readCount()); + hashAppend(hashAlgorithm, this->writeCount()); + hashAppend(hashAlgorithm, this->adminCount()); } -// --------------------------- -// class QueueHandleParameters -// --------------------------- +inline bool +QueueHandleParameters::isEqualTo(const QueueHandleParameters& rhs) const +{ + return this->uri() == rhs.uri() && this->qId() == rhs.qId() && + this->subIdInfo() == rhs.subIdInfo() && + this->flags() == rhs.flags() && + this->readCount() == rhs.readCount() && + this->writeCount() == rhs.writeCount() && + this->adminCount() == rhs.adminCount(); +} // CLASS METHODS // MANIPULATORS -template -int QueueHandleParameters::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueHandleParameters::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -30160,12 +30103,12 @@ int QueueHandleParameters::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueHandleParameters::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueHandleParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -30200,10 +30143,10 @@ int QueueHandleParameters::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueHandleParameters::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueHandleParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -30252,8 +30195,8 @@ inline int& QueueHandleParameters::adminCount() } // ACCESSORS -template -int QueueHandleParameters::accessAttributes(ACCESSOR& accessor) const +template +int QueueHandleParameters::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -30296,11 +30239,11 @@ int QueueHandleParameters::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueHandleParameters::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueHandleParameters::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -30334,8 +30277,8 @@ int QueueHandleParameters::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueHandleParameters::accessAttribute(ACCESSOR& accessor, +template +int QueueHandleParameters::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -30386,30 +30329,32 @@ inline int QueueHandleParameters::adminCount() const return d_adminCount; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueHandleParameters& object) +// --------------- +// class QueueInfo +// --------------- + +// PRIVATE ACCESSORS +template +void QueueInfo::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.qId()); - hashAppend(hashAlg, object.subIdInfo()); - hashAppend(hashAlg, object.flags()); - hashAppend(hashAlg, object.readCount()); - hashAppend(hashAlg, object.writeCount()); - hashAppend(hashAlg, object.adminCount()); + hashAppend(hashAlgorithm, this->uri()); + hashAppend(hashAlgorithm, this->key()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->appIds()); } -// --------------- -// class QueueInfo -// --------------- +inline bool QueueInfo::isEqualTo(const QueueInfo& rhs) const +{ + return this->uri() == rhs.uri() && this->key() == rhs.key() && + this->partitionId() == rhs.partitionId() && + this->appIds() == rhs.appIds(); +} // CLASS METHODS // MANIPULATORS -template -int QueueInfo::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueInfo::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -30435,11 +30380,11 @@ int QueueInfo::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int QueueInfo::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -30462,10 +30407,10 @@ int QueueInfo::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int QueueInfo::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueInfo::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -30499,8 +30444,8 @@ inline bsl::vector& QueueInfo::appIds() } // ACCESSORS -template -int QueueInfo::accessAttributes(ACCESSOR& accessor) const +template +int QueueInfo::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -30525,11 +30470,11 @@ int QueueInfo::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueInfo::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueInfo::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -30552,8 +30497,8 @@ int QueueInfo::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueInfo::accessAttribute(ACCESSOR& accessor, +template +int QueueInfo::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -30588,26 +30533,36 @@ inline const bsl::vector& QueueInfo::appIds() const return d_appIds; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::QueueInfo& object) +// --------------------- +// class QueueInfoUpdate +// --------------------- + +// PRIVATE ACCESSORS +template +void QueueInfoUpdate::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.key()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.appIds()); + hashAppend(hashAlgorithm, this->uri()); + hashAppend(hashAlgorithm, this->key()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->addedAppIds()); + hashAppend(hashAlgorithm, this->removedAppIds()); + hashAppend(hashAlgorithm, this->domain()); } -// --------------------- -// class QueueInfoUpdate -// --------------------- +inline bool QueueInfoUpdate::isEqualTo(const QueueInfoUpdate& rhs) const +{ + return this->uri() == rhs.uri() && this->key() == rhs.key() && + this->partitionId() == rhs.partitionId() && + this->addedAppIds() == rhs.addedAppIds() && + this->removedAppIds() == rhs.removedAppIds() && + this->domain() == rhs.domain(); +} // CLASS METHODS // MANIPULATORS -template -int QueueInfoUpdate::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueInfoUpdate::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -30644,11 +30599,11 @@ int QueueInfoUpdate::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueInfoUpdate::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int QueueInfoUpdate::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -30681,10 +30636,10 @@ int QueueInfoUpdate::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int QueueInfoUpdate::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueInfoUpdate::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -30728,8 +30683,8 @@ inline bsl::string& QueueInfoUpdate::domain() } // ACCESSORS -template -int QueueInfoUpdate::accessAttributes(ACCESSOR& accessor) const +template +int QueueInfoUpdate::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -30766,11 +30721,11 @@ int QueueInfoUpdate::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueInfoUpdate::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueInfoUpdate::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -30801,8 +30756,8 @@ int QueueInfoUpdate::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueInfoUpdate::accessAttribute(ACCESSOR& accessor, +template +int QueueInfoUpdate::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -30847,29 +30802,37 @@ inline const bsl::string& QueueInfoUpdate::domain() const return d_domain; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueInfoUpdate& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.key()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.addedAppIds()); - hashAppend(hashAlg, object.removedAppIds()); - hashAppend(hashAlg, object.domain()); -} - // --------------------------- // class QueueStreamParameters // --------------------------- -// CLASS METHODS +// PRIVATE ACCESSORS +template +void QueueStreamParameters::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->subIdInfo()); + hashAppend(hashAlgorithm, this->maxUnconfirmedMessages()); + hashAppend(hashAlgorithm, this->maxUnconfirmedBytes()); + hashAppend(hashAlgorithm, this->consumerPriority()); + hashAppend(hashAlgorithm, this->consumerPriorityCount()); +} + +inline bool +QueueStreamParameters::isEqualTo(const QueueStreamParameters& rhs) const +{ + return this->subIdInfo() == rhs.subIdInfo() && + this->maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && + this->maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && + this->consumerPriority() == rhs.consumerPriority() && + this->consumerPriorityCount() == rhs.consumerPriorityCount(); +} + +// CLASS METHODS // MANIPULATORS -template -int QueueStreamParameters::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueStreamParameters::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -30906,12 +30869,12 @@ int QueueStreamParameters::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueStreamParameters::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueStreamParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -30944,10 +30907,10 @@ int QueueStreamParameters::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueStreamParameters::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueStreamParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -30986,8 +30949,8 @@ inline int& QueueStreamParameters::consumerPriorityCount() } // ACCESSORS -template -int QueueStreamParameters::accessAttributes(ACCESSOR& accessor) const +template +int QueueStreamParameters::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -31024,11 +30987,11 @@ int QueueStreamParameters::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueStreamParameters::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueStreamParameters::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -31061,8 +31024,8 @@ int QueueStreamParameters::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueStreamParameters::accessAttribute(ACCESSOR& accessor, +template +int QueueStreamParameters::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -31103,28 +31066,14 @@ inline int QueueStreamParameters::consumerPriorityCount() const return d_consumerPriorityCount; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueStreamParameters& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.subIdInfo()); - hashAppend(hashAlg, object.maxUnconfirmedMessages()); - hashAppend(hashAlg, object.maxUnconfirmedBytes()); - hashAppend(hashAlg, object.consumerPriority()); - hashAppend(hashAlg, object.consumerPriorityCount()); -} - // ------------------------- // class RegistrationRequest // ------------------------- // CLASS METHODS // MANIPULATORS -template -int RegistrationRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int RegistrationRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -31134,11 +31083,12 @@ int RegistrationRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int RegistrationRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int RegistrationRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -31152,10 +31102,10 @@ int RegistrationRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int RegistrationRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int RegistrationRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -31174,8 +31124,8 @@ inline LeaderMessageSequence& RegistrationRequest::sequenceNumber() } // ACCESSORS -template -int RegistrationRequest::accessAttributes(ACCESSOR& accessor) const +template +int RegistrationRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -31185,11 +31135,11 @@ int RegistrationRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int RegistrationRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int RegistrationRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -31202,8 +31152,8 @@ int RegistrationRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int RegistrationRequest::accessAttribute(ACCESSOR& accessor, +template +int RegistrationRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -31223,24 +31173,33 @@ inline const LeaderMessageSequence& RegistrationRequest::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::RegistrationRequest& object) +// ------------------------ +// class ReplicaDataRequest +// ------------------------ + +// PRIVATE ACCESSORS +template +void ReplicaDataRequest::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); + hashAppend(hashAlgorithm, this->replicaDataType()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->beginSequenceNumber()); + hashAppend(hashAlgorithm, this->endSequenceNumber()); } -// ------------------------ -// class ReplicaDataRequest -// ------------------------ +inline bool ReplicaDataRequest::isEqualTo(const ReplicaDataRequest& rhs) const +{ + return this->replicaDataType() == rhs.replicaDataType() && + this->partitionId() == rhs.partitionId() && + this->beginSequenceNumber() == rhs.beginSequenceNumber() && + this->endSequenceNumber() == rhs.endSequenceNumber(); +} // CLASS METHODS // MANIPULATORS -template -int ReplicaDataRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int ReplicaDataRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -31270,11 +31229,11 @@ int ReplicaDataRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ReplicaDataRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ReplicaDataRequest::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -31302,10 +31261,10 @@ int ReplicaDataRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ReplicaDataRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ReplicaDataRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -31339,8 +31298,8 @@ inline PartitionSequenceNumber& ReplicaDataRequest::endSequenceNumber() } // ACCESSORS -template -int ReplicaDataRequest::accessAttributes(ACCESSOR& accessor) const +template +int ReplicaDataRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -31369,11 +31328,11 @@ int ReplicaDataRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ReplicaDataRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int ReplicaDataRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -31401,8 +31360,8 @@ int ReplicaDataRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ReplicaDataRequest::accessAttribute(ACCESSOR& accessor, +template +int ReplicaDataRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -31439,27 +31398,34 @@ ReplicaDataRequest::endSequenceNumber() const return d_endSequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaDataRequest& object) +// ------------------------- +// class ReplicaDataResponse +// ------------------------- + +// PRIVATE ACCESSORS +template +void ReplicaDataResponse::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.replicaDataType()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.beginSequenceNumber()); - hashAppend(hashAlg, object.endSequenceNumber()); + hashAppend(hashAlgorithm, this->replicaDataType()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->beginSequenceNumber()); + hashAppend(hashAlgorithm, this->endSequenceNumber()); } -// ------------------------- -// class ReplicaDataResponse -// ------------------------- +inline bool +ReplicaDataResponse::isEqualTo(const ReplicaDataResponse& rhs) const +{ + return this->replicaDataType() == rhs.replicaDataType() && + this->partitionId() == rhs.partitionId() && + this->beginSequenceNumber() == rhs.beginSequenceNumber() && + this->endSequenceNumber() == rhs.endSequenceNumber(); +} // CLASS METHODS // MANIPULATORS -template -int ReplicaDataResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int ReplicaDataResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -31489,11 +31455,12 @@ int ReplicaDataResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ReplicaDataResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ReplicaDataResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -31521,10 +31488,10 @@ int ReplicaDataResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ReplicaDataResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ReplicaDataResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -31558,8 +31525,8 @@ inline PartitionSequenceNumber& ReplicaDataResponse::endSequenceNumber() } // ACCESSORS -template -int ReplicaDataResponse::accessAttributes(ACCESSOR& accessor) const +template +int ReplicaDataResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -31588,11 +31555,11 @@ int ReplicaDataResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ReplicaDataResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int ReplicaDataResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -31620,8 +31587,8 @@ int ReplicaDataResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ReplicaDataResponse::accessAttribute(ACCESSOR& accessor, +template +int ReplicaDataResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -31658,27 +31625,14 @@ ReplicaDataResponse::endSequenceNumber() const return d_endSequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaDataResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.replicaDataType()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.beginSequenceNumber()); - hashAppend(hashAlg, object.endSequenceNumber()); -} - // ------------------------- // class ReplicaStateRequest // ------------------------- // CLASS METHODS // MANIPULATORS -template -int ReplicaStateRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int ReplicaStateRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -31694,11 +31648,12 @@ int ReplicaStateRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ReplicaStateRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ReplicaStateRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -31716,10 +31671,10 @@ int ReplicaStateRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ReplicaStateRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ReplicaStateRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -31743,8 +31698,8 @@ inline PartitionSequenceNumber& ReplicaStateRequest::sequenceNumber() } // ACCESSORS -template -int ReplicaStateRequest::accessAttributes(ACCESSOR& accessor) const +template +int ReplicaStateRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -31760,11 +31715,11 @@ int ReplicaStateRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ReplicaStateRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int ReplicaStateRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -31781,8 +31736,8 @@ int ReplicaStateRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ReplicaStateRequest::accessAttribute(ACCESSOR& accessor, +template +int ReplicaStateRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -31808,25 +31763,14 @@ ReplicaStateRequest::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaStateRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.sequenceNumber()); -} - // -------------------------- // class ReplicaStateResponse // -------------------------- // CLASS METHODS // MANIPULATORS -template -int ReplicaStateResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int ReplicaStateResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -31842,11 +31786,12 @@ int ReplicaStateResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ReplicaStateResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ReplicaStateResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -31864,10 +31809,10 @@ int ReplicaStateResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ReplicaStateResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ReplicaStateResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -31891,8 +31836,8 @@ inline PartitionSequenceNumber& ReplicaStateResponse::sequenceNumber() } // ACCESSORS -template -int ReplicaStateResponse::accessAttributes(ACCESSOR& accessor) const +template +int ReplicaStateResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -31908,11 +31853,11 @@ int ReplicaStateResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ReplicaStateResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int ReplicaStateResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -31929,8 +31874,8 @@ int ReplicaStateResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ReplicaStateResponse::accessAttribute(ACCESSOR& accessor, +template +int ReplicaStateResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -31956,22 +31901,45 @@ ReplicaStateResponse::sequenceNumber() const return d_sequenceNumber; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ReplicaStateResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.sequenceNumber()); -} - // ----------------------------- // class StateNotificationChoice // ----------------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void StateNotificationChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef StateNotificationChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_LEADER_PASSIVE: + hashAppend(hashAlgorithm, this->leaderPassive()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool +StateNotificationChoice::isEqualTo(const StateNotificationChoice& rhs) const +{ + typedef StateNotificationChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_LEADER_PASSIVE: + return this->leaderPassive() == rhs.leaderPassive(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline StateNotificationChoice::StateNotificationChoice() : d_selectionId(SELECTION_ID_UNDEFINED) @@ -31984,8 +31952,8 @@ inline StateNotificationChoice::~StateNotificationChoice() } // MANIPULATORS -template -int StateNotificationChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int StateNotificationChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case StateNotificationChoice::SELECTION_ID_LEADER_PASSIVE: @@ -32011,8 +31979,8 @@ inline int StateNotificationChoice::selectionId() const return d_selectionId; } -template -int StateNotificationChoice::accessSelection(ACCESSOR& accessor) const +template +int StateNotificationChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_LEADER_PASSIVE: @@ -32038,30 +32006,24 @@ inline bool StateNotificationChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StateNotificationChoice& object) -{ - typedef bmqp_ctrlmsg::StateNotificationChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_LEADER_PASSIVE: - hashAppend(hashAlg, object.leaderPassive()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // ------------ // class Status // ------------ +// PRIVATE ACCESSORS +template +void Status::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->category()); + hashAppend(hashAlgorithm, this->code()); + hashAppend(hashAlgorithm, this->message()); +} + // CLASS METHODS // MANIPULATORS -template -int Status::manipulateAttributes(MANIPULATOR& manipulator) +template +int Status::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -32082,11 +32044,11 @@ int Status::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int Status::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int Status::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -32107,10 +32069,10 @@ int Status::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int Status::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int Status::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -32139,8 +32101,8 @@ inline bsl::string& Status::message() } // ACCESSORS -template -int Status::accessAttributes(ACCESSOR& accessor) const +template +int Status::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -32159,11 +32121,11 @@ int Status::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int Status::accessAttribute(ACCESSOR& accessor, int id) const +template +int Status::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -32183,8 +32145,8 @@ int Status::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int Status::accessAttribute(ACCESSOR& accessor, +template +int Status::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -32214,25 +32176,34 @@ inline const bsl::string& Status::message() const return d_message; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::Status& object) +// ------------------------- +// class StorageSyncResponse +// ------------------------- + +// PRIVATE ACCESSORS +template +void StorageSyncResponse::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.category()); - hashAppend(hashAlg, object.code()); - hashAppend(hashAlg, object.message()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->storageSyncResponseType()); + hashAppend(hashAlgorithm, this->beginSyncPoint()); + hashAppend(hashAlgorithm, this->endSyncPoint()); } -// ------------------------- -// class StorageSyncResponse -// ------------------------- +inline bool +StorageSyncResponse::isEqualTo(const StorageSyncResponse& rhs) const +{ + return this->partitionId() == rhs.partitionId() && + this->storageSyncResponseType() == rhs.storageSyncResponseType() && + this->beginSyncPoint() == rhs.beginSyncPoint() && + this->endSyncPoint() == rhs.endSyncPoint(); +} // CLASS METHODS // MANIPULATORS -template -int StorageSyncResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int StorageSyncResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -32261,11 +32232,12 @@ int StorageSyncResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StorageSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StorageSyncResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -32293,10 +32265,10 @@ int StorageSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StorageSyncResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StorageSyncResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -32331,8 +32303,8 @@ inline SyncPoint& StorageSyncResponse::endSyncPoint() } // ACCESSORS -template -int StorageSyncResponse::accessAttributes(ACCESSOR& accessor) const +template +int StorageSyncResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -32361,11 +32333,11 @@ int StorageSyncResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StorageSyncResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int StorageSyncResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -32392,8 +32364,8 @@ int StorageSyncResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StorageSyncResponse::accessAttribute(ACCESSOR& accessor, +template +int StorageSyncResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -32429,27 +32401,14 @@ inline const SyncPoint& StorageSyncResponse::endSyncPoint() const return d_endSyncPoint; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StorageSyncResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.storageSyncResponseType()); - hashAppend(hashAlg, object.beginSyncPoint()); - hashAppend(hashAlg, object.endSyncPoint()); -} - // ------------------------- // class SyncPointOffsetPair // ------------------------- // CLASS METHODS // MANIPULATORS -template -int SyncPointOffsetPair::manipulateAttributes(MANIPULATOR& manipulator) +template +int SyncPointOffsetPair::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -32464,11 +32423,12 @@ int SyncPointOffsetPair::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int SyncPointOffsetPair::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int SyncPointOffsetPair::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -32485,10 +32445,10 @@ int SyncPointOffsetPair::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int SyncPointOffsetPair::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int SyncPointOffsetPair::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -32512,8 +32472,8 @@ inline bsls::Types::Uint64& SyncPointOffsetPair::offset() } // ACCESSORS -template -int SyncPointOffsetPair::accessAttributes(ACCESSOR& accessor) const +template +int SyncPointOffsetPair::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -32528,11 +32488,11 @@ int SyncPointOffsetPair::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int SyncPointOffsetPair::accessAttribute(ACCESSOR& accessor, int id) const +template +int SyncPointOffsetPair::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -32549,8 +32509,8 @@ int SyncPointOffsetPair::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int SyncPointOffsetPair::accessAttribute(ACCESSOR& accessor, +template +int SyncPointOffsetPair::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -32575,25 +32535,175 @@ inline bsls::Types::Uint64 SyncPointOffsetPair::offset() const return d_offset; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::SyncPointOffsetPair& object) +// -------------------------- +// class AuthenticateResponse +// -------------------------- + +// CLASS METHODS +// MANIPULATORS +template +int AuthenticateResponse::manipulateAttributes(t_MANIPULATOR& manipulator) +{ + int ret; + + ret = manipulator(&d_status, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_STATUS]); + if (ret) { + return ret; + } + + ret = manipulator(&d_lifetimeMs, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_LIFETIME_MS]); + if (ret) { + return ret; + } + + return 0; +} + +template +int AuthenticateResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.syncPoint()); - hashAppend(hashAlg, object.offset()); + enum { NOT_FOUND = -1 }; + + switch (id) { + case ATTRIBUTE_ID_STATUS: { + return manipulator(&d_status, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_STATUS]); + } + case ATTRIBUTE_ID_LIFETIME_MS: { + return manipulator(&d_lifetimeMs, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_LIFETIME_MS]); + } + default: return NOT_FOUND; + } +} + +template +int AuthenticateResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) +{ + enum { NOT_FOUND = -1 }; + + const bdlat_AttributeInfo* attributeInfo = lookupAttributeInfo(name, + nameLength); + if (0 == attributeInfo) { + return NOT_FOUND; + } + + return manipulateAttribute(manipulator, attributeInfo->d_id); +} + +inline Status& AuthenticateResponse::status() +{ + return d_status; +} + +inline bdlb::NullableValue& +AuthenticateResponse::lifetimeMs() +{ + return d_lifetimeMs; +} + +// ACCESSORS +template +int AuthenticateResponse::accessAttributes(t_ACCESSOR& accessor) const +{ + int ret; + + ret = accessor(d_status, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_STATUS]); + if (ret) { + return ret; + } + + ret = accessor(d_lifetimeMs, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_LIFETIME_MS]); + if (ret) { + return ret; + } + + return 0; +} + +template +int AuthenticateResponse::accessAttribute(t_ACCESSOR& accessor, int id) const +{ + enum { NOT_FOUND = -1 }; + + switch (id) { + case ATTRIBUTE_ID_STATUS: { + return accessor(d_status, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_STATUS]); + } + case ATTRIBUTE_ID_LIFETIME_MS: { + return accessor(d_lifetimeMs, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_LIFETIME_MS]); + } + default: return NOT_FOUND; + } +} + +template +int AuthenticateResponse::accessAttribute(t_ACCESSOR& accessor, + const char* name, + int nameLength) const +{ + enum { NOT_FOUND = -1 }; + + const bdlat_AttributeInfo* attributeInfo = lookupAttributeInfo(name, + nameLength); + if (0 == attributeInfo) { + return NOT_FOUND; + } + + return accessAttribute(accessor, attributeInfo->d_id); +} + +inline const Status& AuthenticateResponse::status() const +{ + return d_status; +} + +inline const bdlb::NullableValue& +AuthenticateResponse::lifetimeMs() const +{ + return d_lifetimeMs; } // -------------------- // class BrokerResponse // -------------------- +// PRIVATE ACCESSORS +template +void BrokerResponse::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->result()); + hashAppend(hashAlgorithm, this->protocolVersion()); + hashAppend(hashAlgorithm, this->brokerVersion()); + hashAppend(hashAlgorithm, this->isDeprecatedSdk()); + hashAppend(hashAlgorithm, this->brokerIdentity()); + hashAppend(hashAlgorithm, this->heartbeatIntervalMs()); + hashAppend(hashAlgorithm, this->maxMissedHeartbeats()); +} + +inline bool BrokerResponse::isEqualTo(const BrokerResponse& rhs) const +{ + return this->result() == rhs.result() && + this->protocolVersion() == rhs.protocolVersion() && + this->brokerVersion() == rhs.brokerVersion() && + this->isDeprecatedSdk() == rhs.isDeprecatedSdk() && + this->brokerIdentity() == rhs.brokerIdentity() && + this->heartbeatIntervalMs() == rhs.heartbeatIntervalMs() && + this->maxMissedHeartbeats() == rhs.maxMissedHeartbeats(); +} + // CLASS METHODS // MANIPULATORS -template -int BrokerResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int BrokerResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -32640,11 +32750,11 @@ int BrokerResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int BrokerResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int BrokerResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -32687,10 +32797,10 @@ int BrokerResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int BrokerResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int BrokerResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -32739,8 +32849,8 @@ inline int& BrokerResponse::maxMissedHeartbeats() } // ACCESSORS -template -int BrokerResponse::accessAttributes(ACCESSOR& accessor) const +template +int BrokerResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -32787,11 +32897,11 @@ int BrokerResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int BrokerResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int BrokerResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -32832,8 +32942,8 @@ int BrokerResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int BrokerResponse::accessAttribute(ACCESSOR& accessor, +template +int BrokerResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -32883,30 +32993,14 @@ inline int BrokerResponse::maxMissedHeartbeats() const return d_maxMissedHeartbeats; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::BrokerResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.result()); - hashAppend(hashAlg, object.protocolVersion()); - hashAppend(hashAlg, object.brokerVersion()); - hashAppend(hashAlg, object.isDeprecatedSdk()); - hashAppend(hashAlg, object.brokerIdentity()); - hashAppend(hashAlg, object.heartbeatIntervalMs()); - hashAppend(hashAlg, object.maxMissedHeartbeats()); -} - // ---------------- // class CloseQueue // ---------------- // CLASS METHODS // MANIPULATORS -template -int CloseQueue::manipulateAttributes(MANIPULATOR& manipulator) +template +int CloseQueue::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -32922,11 +33016,11 @@ int CloseQueue::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int CloseQueue::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int CloseQueue::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -32944,10 +33038,10 @@ int CloseQueue::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int CloseQueue::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int CloseQueue::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -32971,8 +33065,8 @@ inline bool& CloseQueue::isFinal() } // ACCESSORS -template -int CloseQueue::accessAttributes(ACCESSOR& accessor) const +template +int CloseQueue::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -32987,11 +33081,11 @@ int CloseQueue::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int CloseQueue::accessAttribute(ACCESSOR& accessor, int id) const +template +int CloseQueue::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -33009,8 +33103,8 @@ int CloseQueue::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int CloseQueue::accessAttribute(ACCESSOR& accessor, +template +int CloseQueue::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -33035,25 +33129,14 @@ inline bool CloseQueue::isFinal() const return d_isFinal; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::CloseQueue& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.handleParameters()); - hashAppend(hashAlg, object.isFinal()); -} - // -------------------------- // class ConfigureQueueStream // -------------------------- // CLASS METHODS // MANIPULATORS -template -int ConfigureQueueStream::manipulateAttributes(MANIPULATOR& manipulator) +template +int ConfigureQueueStream::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -33068,11 +33151,12 @@ int ConfigureQueueStream::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ConfigureQueueStream::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ConfigureQueueStream::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -33089,10 +33173,10 @@ int ConfigureQueueStream::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ConfigureQueueStream::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConfigureQueueStream::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -33116,8 +33200,8 @@ inline QueueStreamParameters& ConfigureQueueStream::streamParameters() } // ACCESSORS -template -int ConfigureQueueStream::accessAttributes(ACCESSOR& accessor) const +template +int ConfigureQueueStream::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -33132,11 +33216,11 @@ int ConfigureQueueStream::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConfigureQueueStream::accessAttribute(ACCESSOR& accessor, int id) const +template +int ConfigureQueueStream::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -33153,8 +33237,8 @@ int ConfigureQueueStream::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ConfigureQueueStream::accessAttribute(ACCESSOR& accessor, +template +int ConfigureQueueStream::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -33180,25 +33264,14 @@ ConfigureQueueStream::streamParameters() const return d_streamParameters; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureQueueStream& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.qId()); - hashAppend(hashAlg, object.streamParameters()); -} - // -------------------- // class ElectorMessage // -------------------- // CLASS METHODS // MANIPULATORS -template -int ElectorMessage::manipulateAttributes(MANIPULATOR& manipulator) +template +int ElectorMessage::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -33212,11 +33285,11 @@ int ElectorMessage::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ElectorMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ElectorMessage::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -33233,10 +33306,10 @@ int ElectorMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ElectorMessage::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ElectorMessage::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -33260,8 +33333,8 @@ inline ElectorMessageChoice& ElectorMessage::choice() } // ACCESSORS -template -int ElectorMessage::accessAttributes(ACCESSOR& accessor) const +template +int ElectorMessage::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -33275,11 +33348,11 @@ int ElectorMessage::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ElectorMessage::accessAttribute(ACCESSOR& accessor, int id) const +template +int ElectorMessage::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -33295,8 +33368,8 @@ int ElectorMessage::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ElectorMessage::accessAttribute(ACCESSOR& accessor, +template +int ElectorMessage::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -33321,25 +33394,24 @@ inline const ElectorMessageChoice& ElectorMessage::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ElectorMessage& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.term()); - hashAppend(hashAlg, object.choice()); -} - // -------------------- // class LeaderAdvisory // -------------------- +// PRIVATE ACCESSORS +template +void LeaderAdvisory::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->sequenceNumber()); + hashAppend(hashAlgorithm, this->partitions()); + hashAppend(hashAlgorithm, this->queues()); +} + // CLASS METHODS // MANIPULATORS -template -int LeaderAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -33360,11 +33432,11 @@ int LeaderAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int LeaderAdvisory::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int LeaderAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -33386,10 +33458,10 @@ int LeaderAdvisory::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int LeaderAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -33418,8 +33490,8 @@ inline bsl::vector& LeaderAdvisory::queues() } // ACCESSORS -template -int LeaderAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int LeaderAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -33440,11 +33512,11 @@ int LeaderAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int LeaderAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int LeaderAdvisory::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -33465,8 +33537,8 @@ int LeaderAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int LeaderAdvisory::accessAttribute(ACCESSOR& accessor, +template +int LeaderAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -33497,26 +33569,14 @@ inline const bsl::vector& LeaderAdvisory::queues() const return d_queues; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderAdvisory& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); - hashAppend(hashAlg, object.partitions()); - hashAppend(hashAlg, object.queues()); -} - // --------------- // class OpenQueue // --------------- // CLASS METHODS // MANIPULATORS -template -int OpenQueue::manipulateAttributes(MANIPULATOR& manipulator) +template +int OpenQueue::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -33526,11 +33586,11 @@ int OpenQueue::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int OpenQueue::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int OpenQueue::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -33544,10 +33604,10 @@ int OpenQueue::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int OpenQueue::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int OpenQueue::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -33566,8 +33626,8 @@ inline QueueHandleParameters& OpenQueue::handleParameters() } // ACCESSORS -template -int OpenQueue::accessAttributes(ACCESSOR& accessor) const +template +int OpenQueue::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -33577,11 +33637,11 @@ int OpenQueue::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int OpenQueue::accessAttribute(ACCESSOR& accessor, int id) const +template +int OpenQueue::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -33595,8 +33655,8 @@ int OpenQueue::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int OpenQueue::accessAttribute(ACCESSOR& accessor, +template +int OpenQueue::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -33616,43 +33676,93 @@ inline const QueueHandleParameters& OpenQueue::handleParameters() const return d_handleParameters; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const bmqp_ctrlmsg::OpenQueue& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.handleParameters()); -} - // ---------------------------- // class PartitionMessageChoice // ---------------------------- // CLASS METHODS -// CREATORS -inline PartitionMessageChoice::PartitionMessageChoice() -: d_selectionId(SELECTION_ID_UNDEFINED) -{ -} - -inline PartitionMessageChoice::~PartitionMessageChoice() +// PRIVATE ACCESSORS +template +void PartitionMessageChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - reset(); + typedef PartitionMessageChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_REPLICA_STATE_REQUEST: + hashAppend(hashAlgorithm, this->replicaStateRequest()); + break; + case Class::SELECTION_ID_REPLICA_STATE_RESPONSE: + hashAppend(hashAlgorithm, this->replicaStateResponse()); + break; + case Class::SELECTION_ID_PRIMARY_STATE_REQUEST: + hashAppend(hashAlgorithm, this->primaryStateRequest()); + break; + case Class::SELECTION_ID_PRIMARY_STATE_RESPONSE: + hashAppend(hashAlgorithm, this->primaryStateResponse()); + break; + case Class::SELECTION_ID_REPLICA_DATA_REQUEST: + hashAppend(hashAlgorithm, this->replicaDataRequest()); + break; + case Class::SELECTION_ID_REPLICA_DATA_RESPONSE: + hashAppend(hashAlgorithm, this->replicaDataResponse()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } } -// MANIPULATORS -template -int PartitionMessageChoice::manipulateSelection(MANIPULATOR& manipulator) +inline bool +PartitionMessageChoice::isEqualTo(const PartitionMessageChoice& rhs) const { - switch (d_selectionId) { - case PartitionMessageChoice::SELECTION_ID_REPLICA_STATE_REQUEST: - return manipulator( - &d_replicaStateRequest.object(), - SELECTION_INFO_ARRAY[SELECTION_INDEX_REPLICA_STATE_REQUEST]); - case PartitionMessageChoice::SELECTION_ID_REPLICA_STATE_RESPONSE: - return manipulator( - &d_replicaStateResponse.object(), + typedef PartitionMessageChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_REPLICA_STATE_REQUEST: + return this->replicaStateRequest() == rhs.replicaStateRequest(); + case Class::SELECTION_ID_REPLICA_STATE_RESPONSE: + return this->replicaStateResponse() == rhs.replicaStateResponse(); + case Class::SELECTION_ID_PRIMARY_STATE_REQUEST: + return this->primaryStateRequest() == rhs.primaryStateRequest(); + case Class::SELECTION_ID_PRIMARY_STATE_RESPONSE: + return this->primaryStateResponse() == rhs.primaryStateResponse(); + case Class::SELECTION_ID_REPLICA_DATA_REQUEST: + return this->replicaDataRequest() == rhs.replicaDataRequest(); + case Class::SELECTION_ID_REPLICA_DATA_RESPONSE: + return this->replicaDataResponse() == rhs.replicaDataResponse(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + +// CREATORS +inline PartitionMessageChoice::PartitionMessageChoice() +: d_selectionId(SELECTION_ID_UNDEFINED) +{ +} + +inline PartitionMessageChoice::~PartitionMessageChoice() +{ + reset(); +} + +// MANIPULATORS +template +int PartitionMessageChoice::manipulateSelection(t_MANIPULATOR& manipulator) +{ + switch (d_selectionId) { + case PartitionMessageChoice::SELECTION_ID_REPLICA_STATE_REQUEST: + return manipulator( + &d_replicaStateRequest.object(), + SELECTION_INFO_ARRAY[SELECTION_INDEX_REPLICA_STATE_REQUEST]); + case PartitionMessageChoice::SELECTION_ID_REPLICA_STATE_RESPONSE: + return manipulator( + &d_replicaStateResponse.object(), SELECTION_INFO_ARRAY[SELECTION_INDEX_REPLICA_STATE_RESPONSE]); case PartitionMessageChoice::SELECTION_ID_PRIMARY_STATE_REQUEST: return manipulator( @@ -33719,8 +33829,8 @@ inline int PartitionMessageChoice::selectionId() const return d_selectionId; } -template -int PartitionMessageChoice::accessSelection(ACCESSOR& accessor) const +template +int PartitionMessageChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_REPLICA_STATE_REQUEST: @@ -33828,45 +33938,39 @@ inline bool PartitionMessageChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionMessageChoice& object) +// ---------------------------- +// class PartitionSyncDataQuery +// ---------------------------- + +// PRIVATE ACCESSORS +template +void PartitionSyncDataQuery::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - typedef bmqp_ctrlmsg::PartitionMessageChoice Class; using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_REPLICA_STATE_REQUEST: - hashAppend(hashAlg, object.replicaStateRequest()); - break; - case Class::SELECTION_ID_REPLICA_STATE_RESPONSE: - hashAppend(hashAlg, object.replicaStateResponse()); - break; - case Class::SELECTION_ID_PRIMARY_STATE_REQUEST: - hashAppend(hashAlg, object.primaryStateRequest()); - break; - case Class::SELECTION_ID_PRIMARY_STATE_RESPONSE: - hashAppend(hashAlg, object.primaryStateResponse()); - break; - case Class::SELECTION_ID_REPLICA_DATA_REQUEST: - hashAppend(hashAlg, object.replicaDataRequest()); - break; - case Class::SELECTION_ID_REPLICA_DATA_RESPONSE: - hashAppend(hashAlg, object.replicaDataResponse()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->lastPrimaryLeaseId()); + hashAppend(hashAlgorithm, this->lastSequenceNum()); + hashAppend(hashAlgorithm, this->uptoPrimaryLeaseId()); + hashAppend(hashAlgorithm, this->uptoSequenceNum()); + hashAppend(hashAlgorithm, this->lastSyncPointOffsetPair()); } -// ---------------------------- -// class PartitionSyncDataQuery -// ---------------------------- +inline bool +PartitionSyncDataQuery::isEqualTo(const PartitionSyncDataQuery& rhs) const +{ + return this->partitionId() == rhs.partitionId() && + this->lastPrimaryLeaseId() == rhs.lastPrimaryLeaseId() && + this->lastSequenceNum() == rhs.lastSequenceNum() && + this->uptoPrimaryLeaseId() == rhs.uptoPrimaryLeaseId() && + this->uptoSequenceNum() == rhs.uptoSequenceNum() && + this->lastSyncPointOffsetPair() == rhs.lastSyncPointOffsetPair(); +} // CLASS METHODS // MANIPULATORS -template -int PartitionSyncDataQuery::manipulateAttributes(MANIPULATOR& manipulator) +template +int PartitionSyncDataQuery::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -33909,12 +34013,12 @@ int PartitionSyncDataQuery::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PartitionSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int PartitionSyncDataQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -33952,10 +34056,10 @@ int PartitionSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int PartitionSyncDataQuery::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionSyncDataQuery::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -33999,8 +34103,8 @@ inline SyncPointOffsetPair& PartitionSyncDataQuery::lastSyncPointOffsetPair() } // ACCESSORS -template -int PartitionSyncDataQuery::accessAttributes(ACCESSOR& accessor) const +template +int PartitionSyncDataQuery::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -34043,11 +34147,11 @@ int PartitionSyncDataQuery::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionSyncDataQuery::accessAttribute(ACCESSOR& accessor, int id) const +template +int PartitionSyncDataQuery::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -34085,8 +34189,8 @@ int PartitionSyncDataQuery::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PartitionSyncDataQuery::accessAttribute(ACCESSOR& accessor, +template +int PartitionSyncDataQuery::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -34132,30 +34236,15 @@ PartitionSyncDataQuery::lastSyncPointOffsetPair() const return d_lastSyncPointOffsetPair; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncDataQuery& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.lastPrimaryLeaseId()); - hashAppend(hashAlg, object.lastSequenceNum()); - hashAppend(hashAlg, object.uptoPrimaryLeaseId()); - hashAppend(hashAlg, object.uptoSequenceNum()); - hashAppend(hashAlg, object.lastSyncPointOffsetPair()); -} - // ---------------------------------- // class PartitionSyncDataQueryStatus // ---------------------------------- // CLASS METHODS // MANIPULATORS -template +template int PartitionSyncDataQueryStatus::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { int ret; @@ -34170,12 +34259,13 @@ int PartitionSyncDataQueryStatus::manipulateAttributes( return ret; } - return ret; + return 0; } -template -int PartitionSyncDataQueryStatus::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int PartitionSyncDataQueryStatus::manipulateAttribute( + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -34192,10 +34282,11 @@ int PartitionSyncDataQueryStatus::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int PartitionSyncDataQueryStatus::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionSyncDataQueryStatus::manipulateAttribute( + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -34219,8 +34310,8 @@ inline Status& PartitionSyncDataQueryStatus::status() } // ACCESSORS -template -int PartitionSyncDataQueryStatus::accessAttributes(ACCESSOR& accessor) const +template +int PartitionSyncDataQueryStatus::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -34235,12 +34326,12 @@ int PartitionSyncDataQueryStatus::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionSyncDataQueryStatus::accessAttribute(ACCESSOR& accessor, - int id) const +template +int PartitionSyncDataQueryStatus::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -34257,8 +34348,8 @@ int PartitionSyncDataQueryStatus::accessAttribute(ACCESSOR& accessor, } } -template -int PartitionSyncDataQueryStatus::accessAttribute(ACCESSOR& accessor, +template +int PartitionSyncDataQueryStatus::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -34283,26 +34374,36 @@ inline const Status& PartitionSyncDataQueryStatus::status() const return d_status; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& object) +// ------------------------------------- +// class PartitionSyncStateQueryResponse +// ------------------------------------- + +// PRIVATE ACCESSORS +template +void PartitionSyncStateQueryResponse::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.status()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->primaryLeaseId()); + hashAppend(hashAlgorithm, this->sequenceNum()); + hashAppend(hashAlgorithm, this->lastSyncPointOffsetPair()); } -// ------------------------------------- -// class PartitionSyncStateQueryResponse -// ------------------------------------- +inline bool PartitionSyncStateQueryResponse::isEqualTo( + const PartitionSyncStateQueryResponse& rhs) const +{ + return this->partitionId() == rhs.partitionId() && + this->primaryLeaseId() == rhs.primaryLeaseId() && + this->sequenceNum() == rhs.sequenceNum() && + this->lastSyncPointOffsetPair() == rhs.lastSyncPointOffsetPair(); +} // CLASS METHODS // MANIPULATORS -template +template int PartitionSyncStateQueryResponse::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { int ret; @@ -34331,13 +34432,13 @@ int PartitionSyncStateQueryResponse::manipulateAttributes( return ret; } - return ret; + return 0; } -template +template int PartitionSyncStateQueryResponse::manipulateAttribute( - MANIPULATOR& manipulator, - int id) + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -34364,11 +34465,11 @@ int PartitionSyncStateQueryResponse::manipulateAttribute( } } -template +template int PartitionSyncStateQueryResponse::manipulateAttribute( - MANIPULATOR& manipulator, - const char* name, - int nameLength) + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -34403,8 +34504,9 @@ PartitionSyncStateQueryResponse::lastSyncPointOffsetPair() } // ACCESSORS -template -int PartitionSyncStateQueryResponse::accessAttributes(ACCESSOR& accessor) const +template +int PartitionSyncStateQueryResponse::accessAttributes( + t_ACCESSOR& accessor) const { int ret; @@ -34433,12 +34535,12 @@ int PartitionSyncStateQueryResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionSyncStateQueryResponse::accessAttribute(ACCESSOR& accessor, - int id) const +template +int PartitionSyncStateQueryResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -34465,8 +34567,8 @@ int PartitionSyncStateQueryResponse::accessAttribute(ACCESSOR& accessor, } } -template -int PartitionSyncStateQueryResponse::accessAttribute(ACCESSOR& accessor, +template +int PartitionSyncStateQueryResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -34502,27 +34604,14 @@ PartitionSyncStateQueryResponse::lastSyncPointOffsetPair() const return d_lastSyncPointOffsetPair; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.primaryLeaseId()); - hashAppend(hashAlg, object.sequenceNum()); - hashAppend(hashAlg, object.lastSyncPointOffsetPair()); -} - // ----------------------------- // class QueueAssignmentAdvisory // ----------------------------- // CLASS METHODS // MANIPULATORS -template -int QueueAssignmentAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueAssignmentAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -34537,12 +34626,12 @@ int QueueAssignmentAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueAssignmentAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueAssignmentAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -34560,10 +34649,10 @@ int QueueAssignmentAdvisory::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueAssignmentAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueAssignmentAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -34587,8 +34676,8 @@ inline bsl::vector& QueueAssignmentAdvisory::queues() } // ACCESSORS -template -int QueueAssignmentAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int QueueAssignmentAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -34603,11 +34692,12 @@ int QueueAssignmentAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueAssignmentAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueAssignmentAdvisory::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -34624,8 +34714,8 @@ int QueueAssignmentAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueAssignmentAdvisory::accessAttribute(ACCESSOR& accessor, +template +int QueueAssignmentAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -34651,25 +34741,35 @@ inline const bsl::vector& QueueAssignmentAdvisory::queues() const return d_queues; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueAssignmentAdvisory& object) +// ------------------------------- +// class QueueUnAssignmentAdvisory +// ------------------------------- + +// PRIVATE ACCESSORS +template +void QueueUnAssignmentAdvisory::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); - hashAppend(hashAlg, object.queues()); + hashAppend(hashAlgorithm, this->primaryNodeId()); + hashAppend(hashAlgorithm, this->primaryLeaseId()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->queues()); } -// ------------------------------- -// class QueueUnAssignmentAdvisory -// ------------------------------- +inline bool QueueUnAssignmentAdvisory::isEqualTo( + const QueueUnAssignmentAdvisory& rhs) const +{ + return this->primaryNodeId() == rhs.primaryNodeId() && + this->primaryLeaseId() == rhs.primaryLeaseId() && + this->partitionId() == rhs.partitionId() && + this->queues() == rhs.queues(); +} // CLASS METHODS // MANIPULATORS -template -int QueueUnAssignmentAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueUnAssignmentAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -34696,12 +34796,12 @@ int QueueUnAssignmentAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueUnAssignmentAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueUnAssignmentAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -34728,10 +34828,10 @@ int QueueUnAssignmentAdvisory::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueUnAssignmentAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueUnAssignmentAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -34765,8 +34865,8 @@ inline bsl::vector& QueueUnAssignmentAdvisory::queues() } // ACCESSORS -template -int QueueUnAssignmentAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int QueueUnAssignmentAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -34793,12 +34893,12 @@ int QueueUnAssignmentAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueUnAssignmentAdvisory::accessAttribute(ACCESSOR& accessor, - int id) const +template +int QueueUnAssignmentAdvisory::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -34824,8 +34924,8 @@ int QueueUnAssignmentAdvisory::accessAttribute(ACCESSOR& accessor, } } -template -int QueueUnAssignmentAdvisory::accessAttribute(ACCESSOR& accessor, +template +int QueueUnAssignmentAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -34860,27 +34960,37 @@ inline const bsl::vector& QueueUnAssignmentAdvisory::queues() const return d_queues; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& object) +// ----------------------------- +// class QueueUnassignedAdvisory +// ----------------------------- + +// PRIVATE ACCESSORS +template +void QueueUnassignedAdvisory::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.primaryNodeId()); - hashAppend(hashAlg, object.primaryLeaseId()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.queues()); + hashAppend(hashAlgorithm, this->sequenceNumber()); + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->primaryLeaseId()); + hashAppend(hashAlgorithm, this->primaryNodeId()); + hashAppend(hashAlgorithm, this->queues()); } -// ----------------------------- -// class QueueUnassignedAdvisory -// ----------------------------- +inline bool +QueueUnassignedAdvisory::isEqualTo(const QueueUnassignedAdvisory& rhs) const +{ + return this->sequenceNumber() == rhs.sequenceNumber() && + this->partitionId() == rhs.partitionId() && + this->primaryLeaseId() == rhs.primaryLeaseId() && + this->primaryNodeId() == rhs.primaryNodeId() && + this->queues() == rhs.queues(); +} // CLASS METHODS // MANIPULATORS -template -int QueueUnassignedAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueUnassignedAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -34913,12 +35023,12 @@ int QueueUnassignedAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueUnassignedAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int QueueUnassignedAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -34950,10 +35060,10 @@ int QueueUnassignedAdvisory::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int QueueUnassignedAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueUnassignedAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -34992,8 +35102,8 @@ inline bsl::vector& QueueUnassignedAdvisory::queues() } // ACCESSORS -template -int QueueUnassignedAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int QueueUnassignedAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35026,11 +35136,12 @@ int QueueUnassignedAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueUnassignedAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueUnassignedAdvisory::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -35060,8 +35171,8 @@ int QueueUnassignedAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueUnassignedAdvisory::accessAttribute(ACCESSOR& accessor, +template +int QueueUnassignedAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35102,28 +35213,14 @@ inline const bsl::vector& QueueUnassignedAdvisory::queues() const return d_queues; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUnassignedAdvisory& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.primaryLeaseId()); - hashAppend(hashAlg, object.primaryNodeId()); - hashAppend(hashAlg, object.queues()); -} - // ------------------------- // class QueueUpdateAdvisory // ------------------------- // CLASS METHODS // MANIPULATORS -template -int QueueUpdateAdvisory::manipulateAttributes(MANIPULATOR& manipulator) +template +int QueueUpdateAdvisory::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -35139,11 +35236,12 @@ int QueueUpdateAdvisory::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QueueUpdateAdvisory::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int QueueUpdateAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -35162,10 +35260,10 @@ int QueueUpdateAdvisory::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int QueueUpdateAdvisory::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QueueUpdateAdvisory::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -35189,8 +35287,8 @@ inline bsl::vector& QueueUpdateAdvisory::queueUpdates() } // ACCESSORS -template -int QueueUpdateAdvisory::accessAttributes(ACCESSOR& accessor) const +template +int QueueUpdateAdvisory::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35206,11 +35304,11 @@ int QueueUpdateAdvisory::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QueueUpdateAdvisory::accessAttribute(ACCESSOR& accessor, int id) const +template +int QueueUpdateAdvisory::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -35227,8 +35325,8 @@ int QueueUpdateAdvisory::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QueueUpdateAdvisory::accessAttribute(ACCESSOR& accessor, +template +int QueueUpdateAdvisory::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35254,25 +35352,14 @@ QueueUpdateAdvisory::queueUpdates() const return d_queueUpdates; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::QueueUpdateAdvisory& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.sequenceNumber()); - hashAppend(hashAlg, object.queueUpdates()); -} - // ----------------------- // class StateNotification // ----------------------- // CLASS METHODS // MANIPULATORS -template -int StateNotification::manipulateAttributes(MANIPULATOR& manipulator) +template +int StateNotification::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -35281,11 +35368,11 @@ int StateNotification::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StateNotification::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StateNotification::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -35298,10 +35385,10 @@ int StateNotification::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StateNotification::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StateNotification::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -35320,8 +35407,8 @@ inline StateNotificationChoice& StateNotification::choice() } // ACCESSORS -template -int StateNotification::accessAttributes(ACCESSOR& accessor) const +template +int StateNotification::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35330,11 +35417,11 @@ int StateNotification::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StateNotification::accessAttribute(ACCESSOR& accessor, int id) const +template +int StateNotification::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -35347,8 +35434,8 @@ int StateNotification::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StateNotification::accessAttribute(ACCESSOR& accessor, +template +int StateNotification::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35368,24 +35455,24 @@ inline const StateNotificationChoice& StateNotification::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StateNotification& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); -} - // ------------------------ // class StorageSyncRequest // ------------------------ +// PRIVATE ACCESSORS +template +void StorageSyncRequest::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->partitionId()); + hashAppend(hashAlgorithm, this->beginSyncPointOffsetPair()); + hashAppend(hashAlgorithm, this->endSyncPointOffsetPair()); +} + // CLASS METHODS // MANIPULATORS -template -int StorageSyncRequest::manipulateAttributes(MANIPULATOR& manipulator) +template +int StorageSyncRequest::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -35409,11 +35496,11 @@ int StorageSyncRequest::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StorageSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StorageSyncRequest::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -35436,10 +35523,10 @@ int StorageSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StorageSyncRequest::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StorageSyncRequest::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -35470,8 +35557,8 @@ StorageSyncRequest::endSyncPointOffsetPair() } // ACCESSORS -template -int StorageSyncRequest::accessAttributes(ACCESSOR& accessor) const +template +int StorageSyncRequest::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35495,11 +35582,11 @@ int StorageSyncRequest::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StorageSyncRequest::accessAttribute(ACCESSOR& accessor, int id) const +template +int StorageSyncRequest::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -35522,8 +35609,8 @@ int StorageSyncRequest::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StorageSyncRequest::accessAttribute(ACCESSOR& accessor, +template +int StorageSyncRequest::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35555,26 +35642,24 @@ StorageSyncRequest::endSyncPointOffsetPair() const return d_endSyncPointOffsetPair; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StorageSyncRequest& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.partitionId()); - hashAppend(hashAlg, object.beginSyncPointOffsetPair()); - hashAppend(hashAlg, object.endSyncPointOffsetPair()); -} - // ------------------ // class Subscription // ------------------ +// PRIVATE ACCESSORS +template +void Subscription::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->sId()); + hashAppend(hashAlgorithm, this->expression()); + hashAppend(hashAlgorithm, this->consumers()); +} + // CLASS METHODS // MANIPULATORS -template -int Subscription::manipulateAttributes(MANIPULATOR& manipulator) +template +int Subscription::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -35595,11 +35680,11 @@ int Subscription::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int Subscription::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int Subscription::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -35619,10 +35704,10 @@ int Subscription::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int Subscription::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int Subscription::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -35651,8 +35736,8 @@ inline bsl::vector& Subscription::consumers() } // ACCESSORS -template -int Subscription::accessAttributes(ACCESSOR& accessor) const +template +int Subscription::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35673,11 +35758,11 @@ int Subscription::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int Subscription::accessAttribute(ACCESSOR& accessor, int id) const +template +int Subscription::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -35697,8 +35782,8 @@ int Subscription::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int Subscription::accessAttribute(ACCESSOR& accessor, +template +int Subscription::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35728,16 +35813,144 @@ inline const bsl::vector& Subscription::consumers() const return d_consumers; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::Subscription& object) +// --------------------------- +// class AuthenticationMessage +// --------------------------- + +// CLASS METHODS +// PRIVATE ACCESSORS +template +void AuthenticationMessage::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; + typedef AuthenticationMessage Class; using bslh::hashAppend; - hashAppend(hashAlg, object.sId()); - hashAppend(hashAlg, object.expression()); - hashAppend(hashAlg, object.consumers()); + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_AUTHENTICATE_REQUEST: + hashAppend(hashAlgorithm, this->authenticateRequest()); + break; + case Class::SELECTION_ID_AUTHENTICATE_RESPONSE: + hashAppend(hashAlgorithm, this->authenticateResponse()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool +AuthenticationMessage::isEqualTo(const AuthenticationMessage& rhs) const +{ + typedef AuthenticationMessage Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_AUTHENTICATE_REQUEST: + return this->authenticateRequest() == rhs.authenticateRequest(); + case Class::SELECTION_ID_AUTHENTICATE_RESPONSE: + return this->authenticateResponse() == rhs.authenticateResponse(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + +// CREATORS +inline AuthenticationMessage::AuthenticationMessage( + bslma::Allocator* basicAllocator) +: d_selectionId(SELECTION_ID_UNDEFINED) +, d_allocator_p(bslma::Default::allocator(basicAllocator)) +{ +} + +inline AuthenticationMessage::~AuthenticationMessage() +{ + reset(); +} + +// MANIPULATORS +template +int AuthenticationMessage::manipulateSelection(t_MANIPULATOR& manipulator) +{ + switch (d_selectionId) { + case AuthenticationMessage::SELECTION_ID_AUTHENTICATE_REQUEST: + return manipulator( + &d_authenticateRequest.object(), + SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_REQUEST]); + case AuthenticationMessage::SELECTION_ID_AUTHENTICATE_RESPONSE: + return manipulator( + &d_authenticateResponse.object(), + SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_RESPONSE]); + default: + BSLS_ASSERT(AuthenticationMessage::SELECTION_ID_UNDEFINED == + d_selectionId); + return -1; + } +} + +inline AuthenticateRequest& AuthenticationMessage::authenticateRequest() +{ + BSLS_ASSERT(SELECTION_ID_AUTHENTICATE_REQUEST == d_selectionId); + return d_authenticateRequest.object(); +} + +inline AuthenticateResponse& AuthenticationMessage::authenticateResponse() +{ + BSLS_ASSERT(SELECTION_ID_AUTHENTICATE_RESPONSE == d_selectionId); + return d_authenticateResponse.object(); +} + +// ACCESSORS +inline int AuthenticationMessage::selectionId() const +{ + return d_selectionId; +} + +template +int AuthenticationMessage::accessSelection(t_ACCESSOR& accessor) const +{ + switch (d_selectionId) { + case SELECTION_ID_AUTHENTICATE_REQUEST: + return accessor( + d_authenticateRequest.object(), + SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_REQUEST]); + case SELECTION_ID_AUTHENTICATE_RESPONSE: + return accessor( + d_authenticateResponse.object(), + SELECTION_INFO_ARRAY[SELECTION_INDEX_AUTHENTICATE_RESPONSE]); + default: BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId); return -1; + } +} + +inline const AuthenticateRequest& +AuthenticationMessage::authenticateRequest() const +{ + BSLS_ASSERT(SELECTION_ID_AUTHENTICATE_REQUEST == d_selectionId); + return d_authenticateRequest.object(); +} + +inline const AuthenticateResponse& +AuthenticationMessage::authenticateResponse() const +{ + BSLS_ASSERT(SELECTION_ID_AUTHENTICATE_RESPONSE == d_selectionId); + return d_authenticateResponse.object(); +} + +inline bool AuthenticationMessage::isAuthenticateRequestValue() const +{ + return SELECTION_ID_AUTHENTICATE_REQUEST == d_selectionId; +} + +inline bool AuthenticationMessage::isAuthenticateResponseValue() const +{ + return SELECTION_ID_AUTHENTICATE_RESPONSE == d_selectionId; +} + +inline bool AuthenticationMessage::isUndefinedValue() const +{ + return SELECTION_ID_UNDEFINED == d_selectionId; } // ---------------------------------- @@ -35746,9 +35959,9 @@ void hashAppend(HASH_ALGORITHM& hashAlg, // CLASS METHODS // MANIPULATORS -template +template int ConfigureQueueStreamResponse::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { int ret; @@ -35758,12 +35971,13 @@ int ConfigureQueueStreamResponse::manipulateAttributes( return ret; } - return ret; + return 0; } -template -int ConfigureQueueStreamResponse::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int ConfigureQueueStreamResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -35776,10 +35990,11 @@ int ConfigureQueueStreamResponse::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int ConfigureQueueStreamResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConfigureQueueStreamResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -35798,8 +36013,8 @@ inline ConfigureQueueStream& ConfigureQueueStreamResponse::request() } // ACCESSORS -template -int ConfigureQueueStreamResponse::accessAttributes(ACCESSOR& accessor) const +template +int ConfigureQueueStreamResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35808,12 +36023,12 @@ int ConfigureQueueStreamResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConfigureQueueStreamResponse::accessAttribute(ACCESSOR& accessor, - int id) const +template +int ConfigureQueueStreamResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -35826,8 +36041,8 @@ int ConfigureQueueStreamResponse::accessAttribute(ACCESSOR& accessor, } } -template -int ConfigureQueueStreamResponse::accessAttribute(ACCESSOR& accessor, +template +int ConfigureQueueStreamResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35848,25 +36063,15 @@ ConfigureQueueStreamResponse::request() const return d_request; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureQueueStreamResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.request()); -} - // ---------------------------------- // class FollowerClusterStateResponse // ---------------------------------- // CLASS METHODS // MANIPULATORS -template +template int FollowerClusterStateResponse::manipulateAttributes( - MANIPULATOR& manipulator) + t_MANIPULATOR& manipulator) { int ret; @@ -35877,12 +36082,13 @@ int FollowerClusterStateResponse::manipulateAttributes( return ret; } - return ret; + return 0; } -template -int FollowerClusterStateResponse::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int FollowerClusterStateResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -35896,10 +36102,11 @@ int FollowerClusterStateResponse::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int FollowerClusterStateResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int FollowerClusterStateResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -35918,8 +36125,8 @@ inline LeaderAdvisory& FollowerClusterStateResponse::clusterStateSnapshot() } // ACCESSORS -template -int FollowerClusterStateResponse::accessAttributes(ACCESSOR& accessor) const +template +int FollowerClusterStateResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -35930,12 +36137,12 @@ int FollowerClusterStateResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int FollowerClusterStateResponse::accessAttribute(ACCESSOR& accessor, - int id) const +template +int FollowerClusterStateResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -35949,8 +36156,8 @@ int FollowerClusterStateResponse::accessAttribute(ACCESSOR& accessor, } } -template -int FollowerClusterStateResponse::accessAttribute(ACCESSOR& accessor, +template +int FollowerClusterStateResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -35971,24 +36178,15 @@ FollowerClusterStateResponse::clusterStateSnapshot() const return d_clusterStateSnapshot; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::FollowerClusterStateResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.clusterStateSnapshot()); -} - // --------------------------------- // class LeaderSyncDataQueryResponse // --------------------------------- // CLASS METHODS // MANIPULATORS -template -int LeaderSyncDataQueryResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int LeaderSyncDataQueryResponse::manipulateAttributes( + t_MANIPULATOR& manipulator) { int ret; @@ -35998,12 +36196,13 @@ int LeaderSyncDataQueryResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int LeaderSyncDataQueryResponse::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int LeaderSyncDataQueryResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -36017,10 +36216,11 @@ int LeaderSyncDataQueryResponse::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int LeaderSyncDataQueryResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int LeaderSyncDataQueryResponse::manipulateAttribute( + t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -36039,8 +36239,8 @@ inline LeaderAdvisory& LeaderSyncDataQueryResponse::leaderSyncData() } // ACCESSORS -template -int LeaderSyncDataQueryResponse::accessAttributes(ACCESSOR& accessor) const +template +int LeaderSyncDataQueryResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -36050,12 +36250,12 @@ int LeaderSyncDataQueryResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int LeaderSyncDataQueryResponse::accessAttribute(ACCESSOR& accessor, - int id) const +template +int LeaderSyncDataQueryResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -36069,8 +36269,8 @@ int LeaderSyncDataQueryResponse::accessAttribute(ACCESSOR& accessor, } } -template -int LeaderSyncDataQueryResponse::accessAttribute(ACCESSOR& accessor, +template +int LeaderSyncDataQueryResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -36091,21 +36291,54 @@ LeaderSyncDataQueryResponse::leaderSyncData() const return d_leaderSyncData; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.leaderSyncData()); -} - // ------------------------ // class NegotiationMessage // ------------------------ // CLASS METHODS +// PRIVATE ACCESSORS +template +void NegotiationMessage::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef NegotiationMessage Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_CLIENT_IDENTITY: + hashAppend(hashAlgorithm, this->clientIdentity()); + break; + case Class::SELECTION_ID_BROKER_RESPONSE: + hashAppend(hashAlgorithm, this->brokerResponse()); + break; + case Class::SELECTION_ID_REVERSE_CONNECTION_REQUEST: + hashAppend(hashAlgorithm, this->reverseConnectionRequest()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool NegotiationMessage::isEqualTo(const NegotiationMessage& rhs) const +{ + typedef NegotiationMessage Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_CLIENT_IDENTITY: + return this->clientIdentity() == rhs.clientIdentity(); + case Class::SELECTION_ID_BROKER_RESPONSE: + return this->brokerResponse() == rhs.brokerResponse(); + case Class::SELECTION_ID_REVERSE_CONNECTION_REQUEST: + return this->reverseConnectionRequest() == + rhs.reverseConnectionRequest(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline NegotiationMessage::NegotiationMessage(bslma::Allocator* basicAllocator) : d_selectionId(SELECTION_ID_UNDEFINED) @@ -36119,8 +36352,8 @@ inline NegotiationMessage::~NegotiationMessage() } // MANIPULATORS -template -int NegotiationMessage::manipulateSelection(MANIPULATOR& manipulator) +template +int NegotiationMessage::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case NegotiationMessage::SELECTION_ID_CLIENT_IDENTITY: @@ -36166,8 +36399,8 @@ inline int NegotiationMessage::selectionId() const return d_selectionId; } -template -int NegotiationMessage::accessSelection(ACCESSOR& accessor) const +template +int NegotiationMessage::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_CLIENT_IDENTITY: @@ -36223,36 +36456,24 @@ inline bool NegotiationMessage::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::NegotiationMessage& object) -{ - typedef bmqp_ctrlmsg::NegotiationMessage Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_CLIENT_IDENTITY: - hashAppend(hashAlg, object.clientIdentity()); - break; - case Class::SELECTION_ID_BROKER_RESPONSE: - hashAppend(hashAlg, object.brokerResponse()); - break; - case Class::SELECTION_ID_REVERSE_CONNECTION_REQUEST: - hashAppend(hashAlg, object.reverseConnectionRequest()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // ----------------------- // class OpenQueueResponse // ----------------------- +// PRIVATE ACCESSORS +template +void OpenQueueResponse::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->originalRequest()); + hashAppend(hashAlgorithm, this->routingConfiguration()); + hashAppend(hashAlgorithm, this->deduplicationTimeMs()); +} + // CLASS METHODS // MANIPULATORS -template -int OpenQueueResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int OpenQueueResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -36276,11 +36497,11 @@ int OpenQueueResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int OpenQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int OpenQueueResponse::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -36304,10 +36525,10 @@ int OpenQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int OpenQueueResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int OpenQueueResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -36336,8 +36557,8 @@ inline int& OpenQueueResponse::deduplicationTimeMs() } // ACCESSORS -template -int OpenQueueResponse::accessAttributes(ACCESSOR& accessor) const +template +int OpenQueueResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -36361,11 +36582,11 @@ int OpenQueueResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int OpenQueueResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int OpenQueueResponse::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -36389,8 +36610,8 @@ int OpenQueueResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int OpenQueueResponse::accessAttribute(ACCESSOR& accessor, +template +int OpenQueueResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -36421,26 +36642,14 @@ inline int OpenQueueResponse::deduplicationTimeMs() const return d_deduplicationTimeMs; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::OpenQueueResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.originalRequest()); - hashAppend(hashAlg, object.routingConfiguration()); - hashAppend(hashAlg, object.deduplicationTimeMs()); -} - // ---------------------- // class PartitionMessage // ---------------------- // CLASS METHODS // MANIPULATORS -template -int PartitionMessage::manipulateAttributes(MANIPULATOR& manipulator) +template +int PartitionMessage::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -36449,11 +36658,11 @@ int PartitionMessage::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PartitionMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int PartitionMessage::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -36466,10 +36675,10 @@ int PartitionMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int PartitionMessage::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PartitionMessage::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -36488,8 +36697,8 @@ inline PartitionMessageChoice& PartitionMessage::choice() } // ACCESSORS -template -int PartitionMessage::accessAttributes(ACCESSOR& accessor) const +template +int PartitionMessage::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -36498,11 +36707,11 @@ int PartitionMessage::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PartitionMessage::accessAttribute(ACCESSOR& accessor, int id) const +template +int PartitionMessage::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -36515,8 +36724,8 @@ int PartitionMessage::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PartitionMessage::accessAttribute(ACCESSOR& accessor, +template +int PartitionMessage::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -36536,24 +36745,14 @@ inline const PartitionMessageChoice& PartitionMessage::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::PartitionMessage& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); -} - // ---------------------- // class StreamParameters // ---------------------- // CLASS METHODS // MANIPULATORS -template -int StreamParameters::manipulateAttributes(MANIPULATOR& manipulator) +template +int StreamParameters::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -36568,11 +36767,11 @@ int StreamParameters::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StreamParameters::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StreamParameters::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -36590,10 +36789,10 @@ int StreamParameters::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StreamParameters::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StreamParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -36617,8 +36816,8 @@ inline bsl::vector& StreamParameters::subscriptions() } // ACCESSORS -template -int StreamParameters::accessAttributes(ACCESSOR& accessor) const +template +int StreamParameters::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -36633,11 +36832,11 @@ int StreamParameters::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StreamParameters::accessAttribute(ACCESSOR& accessor, int id) const +template +int StreamParameters::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -36653,8 +36852,8 @@ int StreamParameters::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StreamParameters::accessAttribute(ACCESSOR& accessor, +template +int StreamParameters::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -36679,22 +36878,72 @@ inline const bsl::vector& StreamParameters::subscriptions() const return d_subscriptions; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::StreamParameters& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.appId()); - hashAppend(hashAlg, object.subscriptions()); -} - // ---------------------------------- // class ClusterStateFSMMessageChoice // ---------------------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void ClusterStateFSMMessageChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef ClusterStateFSMMessageChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_FOLLOWER_L_S_N_REQUEST: + hashAppend(hashAlgorithm, this->followerLSNRequest()); + break; + case Class::SELECTION_ID_FOLLOWER_L_S_N_RESPONSE: + hashAppend(hashAlgorithm, this->followerLSNResponse()); + break; + case Class::SELECTION_ID_REGISTRATION_REQUEST: + hashAppend(hashAlgorithm, this->registrationRequest()); + break; + case Class::SELECTION_ID_REGISTRATION_RESPONSE: + hashAppend(hashAlgorithm, this->registrationResponse()); + break; + case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_REQUEST: + hashAppend(hashAlgorithm, this->followerClusterStateRequest()); + break; + case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_RESPONSE: + hashAppend(hashAlgorithm, this->followerClusterStateResponse()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool ClusterStateFSMMessageChoice::isEqualTo( + const ClusterStateFSMMessageChoice& rhs) const +{ + typedef ClusterStateFSMMessageChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_FOLLOWER_L_S_N_REQUEST: + return this->followerLSNRequest() == rhs.followerLSNRequest(); + case Class::SELECTION_ID_FOLLOWER_L_S_N_RESPONSE: + return this->followerLSNResponse() == rhs.followerLSNResponse(); + case Class::SELECTION_ID_REGISTRATION_REQUEST: + return this->registrationRequest() == rhs.registrationRequest(); + case Class::SELECTION_ID_REGISTRATION_RESPONSE: + return this->registrationResponse() == rhs.registrationResponse(); + case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_REQUEST: + return this->followerClusterStateRequest() == + rhs.followerClusterStateRequest(); + case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_RESPONSE: + return this->followerClusterStateResponse() == + rhs.followerClusterStateResponse(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline ClusterStateFSMMessageChoice::ClusterStateFSMMessageChoice( bslma::Allocator* basicAllocator) @@ -36709,8 +36958,9 @@ inline ClusterStateFSMMessageChoice::~ClusterStateFSMMessageChoice() } // MANIPULATORS -template -int ClusterStateFSMMessageChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int ClusterStateFSMMessageChoice::manipulateSelection( + t_MANIPULATOR& manipulator) { switch (d_selectionId) { case ClusterStateFSMMessageChoice::SELECTION_ID_FOLLOWER_L_S_N_REQUEST: @@ -36793,8 +37043,8 @@ inline int ClusterStateFSMMessageChoice::selectionId() const return d_selectionId; } -template -int ClusterStateFSMMessageChoice::accessSelection(ACCESSOR& accessor) const +template +int ClusterStateFSMMessageChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_FOLLOWER_L_S_N_REQUEST: @@ -36904,45 +37154,14 @@ inline bool ClusterStateFSMMessageChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& object) -{ - typedef bmqp_ctrlmsg::ClusterStateFSMMessageChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_FOLLOWER_L_S_N_REQUEST: - hashAppend(hashAlg, object.followerLSNRequest()); - break; - case Class::SELECTION_ID_FOLLOWER_L_S_N_RESPONSE: - hashAppend(hashAlg, object.followerLSNResponse()); - break; - case Class::SELECTION_ID_REGISTRATION_REQUEST: - hashAppend(hashAlg, object.registrationRequest()); - break; - case Class::SELECTION_ID_REGISTRATION_RESPONSE: - hashAppend(hashAlg, object.registrationResponse()); - break; - case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_REQUEST: - hashAppend(hashAlg, object.followerClusterStateRequest()); - break; - case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_RESPONSE: - hashAppend(hashAlg, object.followerClusterStateResponse()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // --------------------- // class ConfigureStream // --------------------- // CLASS METHODS // MANIPULATORS -template -int ConfigureStream::manipulateAttributes(MANIPULATOR& manipulator) +template +int ConfigureStream::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -36957,11 +37176,11 @@ int ConfigureStream::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ConfigureStream::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ConfigureStream::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -36978,10 +37197,10 @@ int ConfigureStream::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ConfigureStream::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConfigureStream::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -37005,8 +37224,8 @@ inline StreamParameters& ConfigureStream::streamParameters() } // ACCESSORS -template -int ConfigureStream::accessAttributes(ACCESSOR& accessor) const +template +int ConfigureStream::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -37021,11 +37240,11 @@ int ConfigureStream::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConfigureStream::accessAttribute(ACCESSOR& accessor, int id) const +template +int ConfigureStream::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -37042,8 +37261,8 @@ int ConfigureStream::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ConfigureStream::accessAttribute(ACCESSOR& accessor, +template +int ConfigureStream::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -37068,25 +37287,14 @@ inline const StreamParameters& ConfigureStream::streamParameters() const return d_streamParameters; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureStream& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.qId()); - hashAppend(hashAlg, object.streamParameters()); -} - // ---------------------------- // class ClusterStateFSMMessage // ---------------------------- // CLASS METHODS // MANIPULATORS -template -int ClusterStateFSMMessage::manipulateAttributes(MANIPULATOR& manipulator) +template +int ClusterStateFSMMessage::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -37095,12 +37303,12 @@ int ClusterStateFSMMessage::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ClusterStateFSMMessage::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int ClusterStateFSMMessage::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -37113,10 +37321,10 @@ int ClusterStateFSMMessage::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int ClusterStateFSMMessage::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ClusterStateFSMMessage::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -37135,8 +37343,8 @@ inline ClusterStateFSMMessageChoice& ClusterStateFSMMessage::choice() } // ACCESSORS -template -int ClusterStateFSMMessage::accessAttributes(ACCESSOR& accessor) const +template +int ClusterStateFSMMessage::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -37145,11 +37353,11 @@ int ClusterStateFSMMessage::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ClusterStateFSMMessage::accessAttribute(ACCESSOR& accessor, int id) const +template +int ClusterStateFSMMessage::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -37162,8 +37370,8 @@ int ClusterStateFSMMessage::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ClusterStateFSMMessage::accessAttribute(ACCESSOR& accessor, +template +int ClusterStateFSMMessage::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -37184,24 +37392,14 @@ ClusterStateFSMMessage::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterStateFSMMessage& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); -} - // ----------------------------- // class ConfigureStreamResponse // ----------------------------- // CLASS METHODS // MANIPULATORS -template -int ConfigureStreamResponse::manipulateAttributes(MANIPULATOR& manipulator) +template +int ConfigureStreamResponse::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -37211,12 +37409,12 @@ int ConfigureStreamResponse::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ConfigureStreamResponse::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int ConfigureStreamResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -37229,10 +37427,10 @@ int ConfigureStreamResponse::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int ConfigureStreamResponse::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConfigureStreamResponse::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -37251,8 +37449,8 @@ inline ConfigureStream& ConfigureStreamResponse::request() } // ACCESSORS -template -int ConfigureStreamResponse::accessAttributes(ACCESSOR& accessor) const +template +int ConfigureStreamResponse::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -37261,11 +37459,12 @@ int ConfigureStreamResponse::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConfigureStreamResponse::accessAttribute(ACCESSOR& accessor, int id) const +template +int ConfigureStreamResponse::accessAttribute(t_ACCESSOR& accessor, + int id) const { enum { NOT_FOUND = -1 }; @@ -37278,8 +37477,8 @@ int ConfigureStreamResponse::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ConfigureStreamResponse::accessAttribute(ACCESSOR& accessor, +template +int ConfigureStreamResponse::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -37299,21 +37498,205 @@ inline const ConfigureStream& ConfigureStreamResponse::request() const return d_request; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ConfigureStreamResponse& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.request()); -} - // -------------------------- // class ClusterMessageChoice // -------------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void ClusterMessageChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef ClusterMessageChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_PARTITION_PRIMARY_ADVISORY: + hashAppend(hashAlgorithm, this->partitionPrimaryAdvisory()); + break; + case Class::SELECTION_ID_LEADER_ADVISORY: + hashAppend(hashAlgorithm, this->leaderAdvisory()); + break; + case Class::SELECTION_ID_QUEUE_ASSIGNMENT_ADVISORY: + hashAppend(hashAlgorithm, this->queueAssignmentAdvisory()); + break; + case Class::SELECTION_ID_NODE_STATUS_ADVISORY: + hashAppend(hashAlgorithm, this->nodeStatusAdvisory()); + break; + case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY: + hashAppend(hashAlgorithm, this->leaderSyncStateQuery()); + break; + case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY_RESPONSE: + hashAppend(hashAlgorithm, this->leaderSyncStateQueryResponse()); + break; + case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY: + hashAppend(hashAlgorithm, this->leaderSyncDataQuery()); + break; + case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY_RESPONSE: + hashAppend(hashAlgorithm, this->leaderSyncDataQueryResponse()); + break; + case Class::SELECTION_ID_QUEUE_ASSIGNMENT_REQUEST: + hashAppend(hashAlgorithm, this->queueAssignmentRequest()); + break; + case Class::SELECTION_ID_STORAGE_SYNC_REQUEST: + hashAppend(hashAlgorithm, this->storageSyncRequest()); + break; + case Class::SELECTION_ID_STORAGE_SYNC_RESPONSE: + hashAppend(hashAlgorithm, this->storageSyncResponse()); + break; + case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY: + hashAppend(hashAlgorithm, this->partitionSyncStateQuery()); + break; + case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY_RESPONSE: + hashAppend(hashAlgorithm, this->partitionSyncStateQueryResponse()); + break; + case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY: + hashAppend(hashAlgorithm, this->partitionSyncDataQuery()); + break; + case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_RESPONSE: + hashAppend(hashAlgorithm, this->partitionSyncDataQueryResponse()); + break; + case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_STATUS: + hashAppend(hashAlgorithm, this->partitionSyncDataQueryStatus()); + break; + case Class::SELECTION_ID_PRIMARY_STATUS_ADVISORY: + hashAppend(hashAlgorithm, this->primaryStatusAdvisory()); + break; + case Class::SELECTION_ID_CLUSTER_SYNC_REQUEST: + hashAppend(hashAlgorithm, this->clusterSyncRequest()); + break; + case Class::SELECTION_ID_CLUSTER_SYNC_RESPONSE: + hashAppend(hashAlgorithm, this->clusterSyncResponse()); + break; + case Class::SELECTION_ID_QUEUE_UN_ASSIGNMENT_ADVISORY: + hashAppend(hashAlgorithm, this->queueUnAssignmentAdvisory()); + break; + case Class::SELECTION_ID_QUEUE_UNASSIGNED_ADVISORY: + hashAppend(hashAlgorithm, this->queueUnassignedAdvisory()); + break; + case Class::SELECTION_ID_LEADER_ADVISORY_ACK: + hashAppend(hashAlgorithm, this->leaderAdvisoryAck()); + break; + case Class::SELECTION_ID_LEADER_ADVISORY_COMMIT: + hashAppend(hashAlgorithm, this->leaderAdvisoryCommit()); + break; + case Class::SELECTION_ID_STATE_NOTIFICATION: + hashAppend(hashAlgorithm, this->stateNotification()); + break; + case Class::SELECTION_ID_STOP_REQUEST: + hashAppend(hashAlgorithm, this->stopRequest()); + break; + case Class::SELECTION_ID_STOP_RESPONSE: + hashAppend(hashAlgorithm, this->stopResponse()); + break; + case Class::SELECTION_ID_QUEUE_UNASSIGNMENT_REQUEST: + hashAppend(hashAlgorithm, this->queueUnassignmentRequest()); + break; + case Class::SELECTION_ID_QUEUE_UPDATE_ADVISORY: + hashAppend(hashAlgorithm, this->queueUpdateAdvisory()); + break; + case Class::SELECTION_ID_CLUSTER_STATE_F_S_M_MESSAGE: + hashAppend(hashAlgorithm, this->clusterStateFSMMessage()); + break; + case Class::SELECTION_ID_PARTITION_MESSAGE: + hashAppend(hashAlgorithm, this->partitionMessage()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool +ClusterMessageChoice::isEqualTo(const ClusterMessageChoice& rhs) const +{ + typedef ClusterMessageChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_PARTITION_PRIMARY_ADVISORY: + return this->partitionPrimaryAdvisory() == + rhs.partitionPrimaryAdvisory(); + case Class::SELECTION_ID_LEADER_ADVISORY: + return this->leaderAdvisory() == rhs.leaderAdvisory(); + case Class::SELECTION_ID_QUEUE_ASSIGNMENT_ADVISORY: + return this->queueAssignmentAdvisory() == + rhs.queueAssignmentAdvisory(); + case Class::SELECTION_ID_NODE_STATUS_ADVISORY: + return this->nodeStatusAdvisory() == rhs.nodeStatusAdvisory(); + case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY: + return this->leaderSyncStateQuery() == rhs.leaderSyncStateQuery(); + case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY_RESPONSE: + return this->leaderSyncStateQueryResponse() == + rhs.leaderSyncStateQueryResponse(); + case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY: + return this->leaderSyncDataQuery() == rhs.leaderSyncDataQuery(); + case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY_RESPONSE: + return this->leaderSyncDataQueryResponse() == + rhs.leaderSyncDataQueryResponse(); + case Class::SELECTION_ID_QUEUE_ASSIGNMENT_REQUEST: + return this->queueAssignmentRequest() == + rhs.queueAssignmentRequest(); + case Class::SELECTION_ID_STORAGE_SYNC_REQUEST: + return this->storageSyncRequest() == rhs.storageSyncRequest(); + case Class::SELECTION_ID_STORAGE_SYNC_RESPONSE: + return this->storageSyncResponse() == rhs.storageSyncResponse(); + case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY: + return this->partitionSyncStateQuery() == + rhs.partitionSyncStateQuery(); + case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY_RESPONSE: + return this->partitionSyncStateQueryResponse() == + rhs.partitionSyncStateQueryResponse(); + case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY: + return this->partitionSyncDataQuery() == + rhs.partitionSyncDataQuery(); + case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_RESPONSE: + return this->partitionSyncDataQueryResponse() == + rhs.partitionSyncDataQueryResponse(); + case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_STATUS: + return this->partitionSyncDataQueryStatus() == + rhs.partitionSyncDataQueryStatus(); + case Class::SELECTION_ID_PRIMARY_STATUS_ADVISORY: + return this->primaryStatusAdvisory() == + rhs.primaryStatusAdvisory(); + case Class::SELECTION_ID_CLUSTER_SYNC_REQUEST: + return this->clusterSyncRequest() == rhs.clusterSyncRequest(); + case Class::SELECTION_ID_CLUSTER_SYNC_RESPONSE: + return this->clusterSyncResponse() == rhs.clusterSyncResponse(); + case Class::SELECTION_ID_QUEUE_UN_ASSIGNMENT_ADVISORY: + return this->queueUnAssignmentAdvisory() == + rhs.queueUnAssignmentAdvisory(); + case Class::SELECTION_ID_QUEUE_UNASSIGNED_ADVISORY: + return this->queueUnassignedAdvisory() == + rhs.queueUnassignedAdvisory(); + case Class::SELECTION_ID_LEADER_ADVISORY_ACK: + return this->leaderAdvisoryAck() == rhs.leaderAdvisoryAck(); + case Class::SELECTION_ID_LEADER_ADVISORY_COMMIT: + return this->leaderAdvisoryCommit() == rhs.leaderAdvisoryCommit(); + case Class::SELECTION_ID_STATE_NOTIFICATION: + return this->stateNotification() == rhs.stateNotification(); + case Class::SELECTION_ID_STOP_REQUEST: + return this->stopRequest() == rhs.stopRequest(); + case Class::SELECTION_ID_STOP_RESPONSE: + return this->stopResponse() == rhs.stopResponse(); + case Class::SELECTION_ID_QUEUE_UNASSIGNMENT_REQUEST: + return this->queueUnassignmentRequest() == + rhs.queueUnassignmentRequest(); + case Class::SELECTION_ID_QUEUE_UPDATE_ADVISORY: + return this->queueUpdateAdvisory() == rhs.queueUpdateAdvisory(); + case Class::SELECTION_ID_CLUSTER_STATE_F_S_M_MESSAGE: + return this->clusterStateFSMMessage() == + rhs.clusterStateFSMMessage(); + case Class::SELECTION_ID_PARTITION_MESSAGE: + return this->partitionMessage() == rhs.partitionMessage(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline ClusterMessageChoice::ClusterMessageChoice( bslma::Allocator* basicAllocator) @@ -37328,8 +37711,8 @@ inline ClusterMessageChoice::~ClusterMessageChoice() } // MANIPULATORS -template -int ClusterMessageChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int ClusterMessageChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case ClusterMessageChoice::SELECTION_ID_PARTITION_PRIMARY_ADVISORY: @@ -37662,8 +38045,8 @@ inline int ClusterMessageChoice::selectionId() const return d_selectionId; } -template -int ClusterMessageChoice::accessSelection(ACCESSOR& accessor) const +template +int ClusterMessageChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_PARTITION_PRIMARY_ADVISORY: @@ -38155,117 +38538,14 @@ inline bool ClusterMessageChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterMessageChoice& object) -{ - typedef bmqp_ctrlmsg::ClusterMessageChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_PARTITION_PRIMARY_ADVISORY: - hashAppend(hashAlg, object.partitionPrimaryAdvisory()); - break; - case Class::SELECTION_ID_LEADER_ADVISORY: - hashAppend(hashAlg, object.leaderAdvisory()); - break; - case Class::SELECTION_ID_QUEUE_ASSIGNMENT_ADVISORY: - hashAppend(hashAlg, object.queueAssignmentAdvisory()); - break; - case Class::SELECTION_ID_NODE_STATUS_ADVISORY: - hashAppend(hashAlg, object.nodeStatusAdvisory()); - break; - case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY: - hashAppend(hashAlg, object.leaderSyncStateQuery()); - break; - case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY_RESPONSE: - hashAppend(hashAlg, object.leaderSyncStateQueryResponse()); - break; - case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY: - hashAppend(hashAlg, object.leaderSyncDataQuery()); - break; - case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY_RESPONSE: - hashAppend(hashAlg, object.leaderSyncDataQueryResponse()); - break; - case Class::SELECTION_ID_QUEUE_ASSIGNMENT_REQUEST: - hashAppend(hashAlg, object.queueAssignmentRequest()); - break; - case Class::SELECTION_ID_STORAGE_SYNC_REQUEST: - hashAppend(hashAlg, object.storageSyncRequest()); - break; - case Class::SELECTION_ID_STORAGE_SYNC_RESPONSE: - hashAppend(hashAlg, object.storageSyncResponse()); - break; - case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY: - hashAppend(hashAlg, object.partitionSyncStateQuery()); - break; - case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY_RESPONSE: - hashAppend(hashAlg, object.partitionSyncStateQueryResponse()); - break; - case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY: - hashAppend(hashAlg, object.partitionSyncDataQuery()); - break; - case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_RESPONSE: - hashAppend(hashAlg, object.partitionSyncDataQueryResponse()); - break; - case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_STATUS: - hashAppend(hashAlg, object.partitionSyncDataQueryStatus()); - break; - case Class::SELECTION_ID_PRIMARY_STATUS_ADVISORY: - hashAppend(hashAlg, object.primaryStatusAdvisory()); - break; - case Class::SELECTION_ID_CLUSTER_SYNC_REQUEST: - hashAppend(hashAlg, object.clusterSyncRequest()); - break; - case Class::SELECTION_ID_CLUSTER_SYNC_RESPONSE: - hashAppend(hashAlg, object.clusterSyncResponse()); - break; - case Class::SELECTION_ID_QUEUE_UN_ASSIGNMENT_ADVISORY: - hashAppend(hashAlg, object.queueUnAssignmentAdvisory()); - break; - case Class::SELECTION_ID_QUEUE_UNASSIGNED_ADVISORY: - hashAppend(hashAlg, object.queueUnassignedAdvisory()); - break; - case Class::SELECTION_ID_LEADER_ADVISORY_ACK: - hashAppend(hashAlg, object.leaderAdvisoryAck()); - break; - case Class::SELECTION_ID_LEADER_ADVISORY_COMMIT: - hashAppend(hashAlg, object.leaderAdvisoryCommit()); - break; - case Class::SELECTION_ID_STATE_NOTIFICATION: - hashAppend(hashAlg, object.stateNotification()); - break; - case Class::SELECTION_ID_STOP_REQUEST: - hashAppend(hashAlg, object.stopRequest()); - break; - case Class::SELECTION_ID_STOP_RESPONSE: - hashAppend(hashAlg, object.stopResponse()); - break; - case Class::SELECTION_ID_QUEUE_UNASSIGNMENT_REQUEST: - hashAppend(hashAlg, object.queueUnassignmentRequest()); - break; - case Class::SELECTION_ID_QUEUE_UPDATE_ADVISORY: - hashAppend(hashAlg, object.queueUpdateAdvisory()); - break; - case Class::SELECTION_ID_CLUSTER_STATE_F_S_M_MESSAGE: - hashAppend(hashAlg, object.clusterStateFSMMessage()); - break; - case Class::SELECTION_ID_PARTITION_MESSAGE: - hashAppend(hashAlg, object.partitionMessage()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - -// -------------------- -// class ClusterMessage -// -------------------- - -// CLASS METHODS -// MANIPULATORS -template -int ClusterMessage::manipulateAttributes(MANIPULATOR& manipulator) +// -------------------- +// class ClusterMessage +// -------------------- + +// CLASS METHODS +// MANIPULATORS +template +int ClusterMessage::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -38274,11 +38554,11 @@ int ClusterMessage::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ClusterMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ClusterMessage::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -38291,10 +38571,10 @@ int ClusterMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ClusterMessage::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ClusterMessage::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -38313,8 +38593,8 @@ inline ClusterMessageChoice& ClusterMessage::choice() } // ACCESSORS -template -int ClusterMessage::accessAttributes(ACCESSOR& accessor) const +template +int ClusterMessage::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -38323,11 +38603,11 @@ int ClusterMessage::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ClusterMessage::accessAttribute(ACCESSOR& accessor, int id) const +template +int ClusterMessage::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -38340,8 +38620,8 @@ int ClusterMessage::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ClusterMessage::accessAttribute(ACCESSOR& accessor, +template +int ClusterMessage::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -38361,21 +38641,111 @@ inline const ClusterMessageChoice& ClusterMessage::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ClusterMessage& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); -} - // -------------------------- // class ControlMessageChoice // -------------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void ControlMessageChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef ControlMessageChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_STATUS: + hashAppend(hashAlgorithm, this->status()); + break; + case Class::SELECTION_ID_DISCONNECT: + hashAppend(hashAlgorithm, this->disconnect()); + break; + case Class::SELECTION_ID_DISCONNECT_RESPONSE: + hashAppend(hashAlgorithm, this->disconnectResponse()); + break; + case Class::SELECTION_ID_ADMIN_COMMAND: + hashAppend(hashAlgorithm, this->adminCommand()); + break; + case Class::SELECTION_ID_ADMIN_COMMAND_RESPONSE: + hashAppend(hashAlgorithm, this->adminCommandResponse()); + break; + case Class::SELECTION_ID_CLUSTER_MESSAGE: + hashAppend(hashAlgorithm, this->clusterMessage()); + break; + case Class::SELECTION_ID_OPEN_QUEUE: + hashAppend(hashAlgorithm, this->openQueue()); + break; + case Class::SELECTION_ID_OPEN_QUEUE_RESPONSE: + hashAppend(hashAlgorithm, this->openQueueResponse()); + break; + case Class::SELECTION_ID_CLOSE_QUEUE: + hashAppend(hashAlgorithm, this->closeQueue()); + break; + case Class::SELECTION_ID_CLOSE_QUEUE_RESPONSE: + hashAppend(hashAlgorithm, this->closeQueueResponse()); + break; + case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM: + hashAppend(hashAlgorithm, this->configureQueueStream()); + break; + case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM_RESPONSE: + hashAppend(hashAlgorithm, this->configureQueueStreamResponse()); + break; + case Class::SELECTION_ID_CONFIGURE_STREAM: + hashAppend(hashAlgorithm, this->configureStream()); + break; + case Class::SELECTION_ID_CONFIGURE_STREAM_RESPONSE: + hashAppend(hashAlgorithm, this->configureStreamResponse()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool +ControlMessageChoice::isEqualTo(const ControlMessageChoice& rhs) const +{ + typedef ControlMessageChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_STATUS: return this->status() == rhs.status(); + case Class::SELECTION_ID_DISCONNECT: + return this->disconnect() == rhs.disconnect(); + case Class::SELECTION_ID_DISCONNECT_RESPONSE: + return this->disconnectResponse() == rhs.disconnectResponse(); + case Class::SELECTION_ID_ADMIN_COMMAND: + return this->adminCommand() == rhs.adminCommand(); + case Class::SELECTION_ID_ADMIN_COMMAND_RESPONSE: + return this->adminCommandResponse() == rhs.adminCommandResponse(); + case Class::SELECTION_ID_CLUSTER_MESSAGE: + return this->clusterMessage() == rhs.clusterMessage(); + case Class::SELECTION_ID_OPEN_QUEUE: + return this->openQueue() == rhs.openQueue(); + case Class::SELECTION_ID_OPEN_QUEUE_RESPONSE: + return this->openQueueResponse() == rhs.openQueueResponse(); + case Class::SELECTION_ID_CLOSE_QUEUE: + return this->closeQueue() == rhs.closeQueue(); + case Class::SELECTION_ID_CLOSE_QUEUE_RESPONSE: + return this->closeQueueResponse() == rhs.closeQueueResponse(); + case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM: + return this->configureQueueStream() == rhs.configureQueueStream(); + case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM_RESPONSE: + return this->configureQueueStreamResponse() == + rhs.configureQueueStreamResponse(); + case Class::SELECTION_ID_CONFIGURE_STREAM: + return this->configureStream() == rhs.configureStream(); + case Class::SELECTION_ID_CONFIGURE_STREAM_RESPONSE: + return this->configureStreamResponse() == + rhs.configureStreamResponse(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline ControlMessageChoice::ControlMessageChoice( bslma::Allocator* basicAllocator) @@ -38390,8 +38760,8 @@ inline ControlMessageChoice::~ControlMessageChoice() } // MANIPULATORS -template -int ControlMessageChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int ControlMessageChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case ControlMessageChoice::SELECTION_ID_STATUS: @@ -38545,8 +38915,8 @@ inline int ControlMessageChoice::selectionId() const return d_selectionId; } -template -int ControlMessageChoice::accessSelection(ACCESSOR& accessor) const +template +int ControlMessageChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_STATUS: @@ -38768,69 +39138,14 @@ inline bool ControlMessageChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ControlMessageChoice& object) -{ - typedef bmqp_ctrlmsg::ControlMessageChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_STATUS: - hashAppend(hashAlg, object.status()); - break; - case Class::SELECTION_ID_DISCONNECT: - hashAppend(hashAlg, object.disconnect()); - break; - case Class::SELECTION_ID_DISCONNECT_RESPONSE: - hashAppend(hashAlg, object.disconnectResponse()); - break; - case Class::SELECTION_ID_ADMIN_COMMAND: - hashAppend(hashAlg, object.adminCommand()); - break; - case Class::SELECTION_ID_ADMIN_COMMAND_RESPONSE: - hashAppend(hashAlg, object.adminCommandResponse()); - break; - case Class::SELECTION_ID_CLUSTER_MESSAGE: - hashAppend(hashAlg, object.clusterMessage()); - break; - case Class::SELECTION_ID_OPEN_QUEUE: - hashAppend(hashAlg, object.openQueue()); - break; - case Class::SELECTION_ID_OPEN_QUEUE_RESPONSE: - hashAppend(hashAlg, object.openQueueResponse()); - break; - case Class::SELECTION_ID_CLOSE_QUEUE: - hashAppend(hashAlg, object.closeQueue()); - break; - case Class::SELECTION_ID_CLOSE_QUEUE_RESPONSE: - hashAppend(hashAlg, object.closeQueueResponse()); - break; - case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM: - hashAppend(hashAlg, object.configureQueueStream()); - break; - case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM_RESPONSE: - hashAppend(hashAlg, object.configureQueueStreamResponse()); - break; - case Class::SELECTION_ID_CONFIGURE_STREAM: - hashAppend(hashAlg, object.configureStream()); - break; - case Class::SELECTION_ID_CONFIGURE_STREAM_RESPONSE: - hashAppend(hashAlg, object.configureStreamResponse()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // -------------------- // class ControlMessage // -------------------- // CLASS METHODS // MANIPULATORS -template -int ControlMessage::manipulateAttributes(MANIPULATOR& manipulator) +template +int ControlMessage::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -38844,11 +39159,11 @@ int ControlMessage::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ControlMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ControlMessage::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -38864,10 +39179,10 @@ int ControlMessage::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ControlMessage::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ControlMessage::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -38891,8 +39206,8 @@ inline ControlMessageChoice& ControlMessage::choice() } // ACCESSORS -template -int ControlMessage::accessAttributes(ACCESSOR& accessor) const +template +int ControlMessage::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -38906,11 +39221,11 @@ int ControlMessage::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ControlMessage::accessAttribute(ACCESSOR& accessor, int id) const +template +int ControlMessage::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -38926,8 +39241,8 @@ int ControlMessage::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ControlMessage::accessAttribute(ACCESSOR& accessor, +template +int ControlMessage::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -38952,2331 +39267,10 @@ inline const ControlMessageChoice& ControlMessage::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const bmqp_ctrlmsg::ControlMessage& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.rId()); - hashAppend(hashAlg, object.choice()); -} - } // close package namespace // FREE FUNCTIONS -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::AdminCommand& lhs, - const bmqp_ctrlmsg::AdminCommand& rhs) -{ - return lhs.command() == rhs.command(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::AdminCommand& lhs, - const bmqp_ctrlmsg::AdminCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::AdminCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::AdminCommandResponse& lhs, - const bmqp_ctrlmsg::AdminCommandResponse& rhs) -{ - return lhs.text() == rhs.text(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::AdminCommandResponse& lhs, - const bmqp_ctrlmsg::AdminCommandResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::AdminCommandResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::AppIdInfo& lhs, - const bmqp_ctrlmsg::AppIdInfo& rhs) -{ - return lhs.appId() == rhs.appId() && lhs.appKey() == rhs.appKey(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::AppIdInfo& lhs, - const bmqp_ctrlmsg::AppIdInfo& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::AppIdInfo& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::ClientLanguage::Value rhs) -{ - return bmqp_ctrlmsg::ClientLanguage::print(stream, rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::ClientType::Value rhs) -{ - return bmqp_ctrlmsg::ClientType::print(stream, rhs); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::CloseQueueResponse&, - const bmqp_ctrlmsg::CloseQueueResponse&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::CloseQueueResponse&, - const bmqp_ctrlmsg::CloseQueueResponse&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::CloseQueueResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClusterSyncRequest&, - const bmqp_ctrlmsg::ClusterSyncRequest&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClusterSyncRequest&, - const bmqp_ctrlmsg::ClusterSyncRequest&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClusterSyncRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClusterSyncResponse&, - const bmqp_ctrlmsg::ClusterSyncResponse&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClusterSyncResponse&, - const bmqp_ctrlmsg::ClusterSyncResponse&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClusterSyncResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ConsumerInfo& lhs, - const bmqp_ctrlmsg::ConsumerInfo& rhs) -{ - return lhs.maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && - lhs.maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && - lhs.consumerPriority() == rhs.consumerPriority() && - lhs.consumerPriorityCount() == rhs.consumerPriorityCount(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ConsumerInfo& lhs, - const bmqp_ctrlmsg::ConsumerInfo& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ConsumerInfo& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::Disconnect&, - const bmqp_ctrlmsg::Disconnect&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::Disconnect&, - const bmqp_ctrlmsg::Disconnect&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::Disconnect& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::DisconnectResponse&, - const bmqp_ctrlmsg::DisconnectResponse&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::DisconnectResponse&, - const bmqp_ctrlmsg::DisconnectResponse&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::DisconnectResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::DumpActionType::Value rhs) -{ - return bmqp_ctrlmsg::DumpActionType::print(stream, rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::DumpMsgType::Value rhs) -{ - return bmqp_ctrlmsg::DumpMsgType::print(stream, rhs); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ElectionProposal&, - const bmqp_ctrlmsg::ElectionProposal&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ElectionProposal&, - const bmqp_ctrlmsg::ElectionProposal&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ElectionProposal& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ElectionResponse&, - const bmqp_ctrlmsg::ElectionResponse&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ElectionResponse&, - const bmqp_ctrlmsg::ElectionResponse&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ElectionResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ElectorNodeStatus& lhs, - const bmqp_ctrlmsg::ElectorNodeStatus& rhs) -{ - return lhs.isAvailable() == rhs.isAvailable(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ElectorNodeStatus& lhs, - const bmqp_ctrlmsg::ElectorNodeStatus& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ElectorNodeStatus& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::ExpressionVersion::Value rhs) -{ - return bmqp_ctrlmsg::ExpressionVersion::print(stream, rhs); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::FollowerClusterStateRequest&, - const bmqp_ctrlmsg::FollowerClusterStateRequest&) -{ - return true; -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::FollowerClusterStateRequest&, - const bmqp_ctrlmsg::FollowerClusterStateRequest&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::FollowerClusterStateRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::FollowerLSNRequest&, - const bmqp_ctrlmsg::FollowerLSNRequest&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::FollowerLSNRequest&, - const bmqp_ctrlmsg::FollowerLSNRequest&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::FollowerLSNRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::GuidInfo& lhs, - const bmqp_ctrlmsg::GuidInfo& rhs) -{ - return lhs.clientId() == rhs.clientId() && - lhs.nanoSecondsFromEpoch() == rhs.nanoSecondsFromEpoch(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::GuidInfo& lhs, - const bmqp_ctrlmsg::GuidInfo& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::GuidInfo& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::HeartbeatResponse&, - const bmqp_ctrlmsg::HeartbeatResponse&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::HeartbeatResponse&, - const bmqp_ctrlmsg::HeartbeatResponse&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::HeartbeatResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderHeartbeat&, - const bmqp_ctrlmsg::LeaderHeartbeat&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderHeartbeat&, - const bmqp_ctrlmsg::LeaderHeartbeat&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderHeartbeat& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderMessageSequence& lhs, - const bmqp_ctrlmsg::LeaderMessageSequence& rhs) -{ - return lhs.electorTerm() == rhs.electorTerm() && - lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderMessageSequence& lhs, - const bmqp_ctrlmsg::LeaderMessageSequence& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderMessageSequence& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderPassive&, - const bmqp_ctrlmsg::LeaderPassive&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderPassive&, - const bmqp_ctrlmsg::LeaderPassive&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderPassive& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderSyncDataQuery&, - const bmqp_ctrlmsg::LeaderSyncDataQuery&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderSyncDataQuery&, - const bmqp_ctrlmsg::LeaderSyncDataQuery&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderSyncDataQuery& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderSyncStateQuery&, - const bmqp_ctrlmsg::LeaderSyncStateQuery&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderSyncStateQuery&, - const bmqp_ctrlmsg::LeaderSyncStateQuery&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderSyncStateQuery& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeadershipCessionNotification&, - const bmqp_ctrlmsg::LeadershipCessionNotification&) -{ - return true; -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeadershipCessionNotification&, - const bmqp_ctrlmsg::LeadershipCessionNotification&) -{ - return false; -} - -inline bsl::ostream& bmqp_ctrlmsg::operator<<( - bsl::ostream& stream, - const bmqp_ctrlmsg::LeadershipCessionNotification& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::NodeStatus::Value rhs) -{ - return bmqp_ctrlmsg::NodeStatus::print(stream, rhs); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionPrimaryInfo& lhs, - const bmqp_ctrlmsg::PartitionPrimaryInfo& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.primaryNodeId() == rhs.primaryNodeId() && - lhs.primaryLeaseId() == rhs.primaryLeaseId(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionPrimaryInfo& lhs, - const bmqp_ctrlmsg::PartitionPrimaryInfo& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionPrimaryInfo& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionSequenceNumber& lhs, - const bmqp_ctrlmsg::PartitionSequenceNumber& rhs) -{ - return lhs.primaryLeaseId() == rhs.primaryLeaseId() && - lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionSequenceNumber& lhs, - const bmqp_ctrlmsg::PartitionSequenceNumber& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionSequenceNumber& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==( - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& lhs, - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.endPrimaryLeaseId() == rhs.endPrimaryLeaseId() && - lhs.endSequenceNum() == rhs.endSequenceNum(); -} - -inline bool bmqp_ctrlmsg::operator!=( - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& lhs, - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& bmqp_ctrlmsg::operator<<( - bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionSyncDataQueryResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionSyncStateQuery& lhs, - const bmqp_ctrlmsg::PartitionSyncStateQuery& rhs) -{ - return lhs.partitionId() == rhs.partitionId(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionSyncStateQuery& lhs, - const bmqp_ctrlmsg::PartitionSyncStateQuery& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionSyncStateQuery& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::PrimaryStatus::Value rhs) -{ - return bmqp_ctrlmsg::PrimaryStatus::print(stream, rhs); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueAssignmentRequest& lhs, - const bmqp_ctrlmsg::QueueAssignmentRequest& rhs) -{ - return lhs.queueUri() == rhs.queueUri(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueAssignmentRequest& lhs, - const bmqp_ctrlmsg::QueueAssignmentRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueAssignmentRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueUnassignmentRequest& lhs, - const bmqp_ctrlmsg::QueueUnassignmentRequest& rhs) -{ - return lhs.queueUri() == rhs.queueUri() && - lhs.partitionId() == rhs.partitionId() && - lhs.queueKey() == rhs.queueKey(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueUnassignmentRequest& lhs, - const bmqp_ctrlmsg::QueueUnassignmentRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueUnassignmentRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::RegistrationResponse&, - const bmqp_ctrlmsg::RegistrationResponse&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::RegistrationResponse&, - const bmqp_ctrlmsg::RegistrationResponse&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::RegistrationResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::ReplicaDataType::Value rhs) -{ - return bmqp_ctrlmsg::ReplicaDataType::print(stream, rhs); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ReverseConnectionRequest& lhs, - const bmqp_ctrlmsg::ReverseConnectionRequest& rhs) -{ - return lhs.protocolVersion() == rhs.protocolVersion() && - lhs.clusterName() == rhs.clusterName() && - lhs.clusterNodeId() == rhs.clusterNodeId(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ReverseConnectionRequest& lhs, - const bmqp_ctrlmsg::ReverseConnectionRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ReverseConnectionRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::RoutingConfiguration& lhs, - const bmqp_ctrlmsg::RoutingConfiguration& rhs) -{ - return lhs.flags() == rhs.flags(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::RoutingConfiguration& lhs, - const bmqp_ctrlmsg::RoutingConfiguration& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::RoutingConfiguration& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::RoutingConfigurationFlags::Value rhs) -{ - return bmqp_ctrlmsg::RoutingConfigurationFlags::print(stream, rhs); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ScoutingRequest&, - const bmqp_ctrlmsg::ScoutingRequest&) -{ - return true; -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ScoutingRequest&, - const bmqp_ctrlmsg::ScoutingRequest&) -{ - return false; -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ScoutingRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ScoutingResponse& lhs, - const bmqp_ctrlmsg::ScoutingResponse& rhs) -{ - return lhs.willVote() == rhs.willVote(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ScoutingResponse& lhs, - const bmqp_ctrlmsg::ScoutingResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ScoutingResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::StatusCategory::Value rhs) -{ - return bmqp_ctrlmsg::StatusCategory::print(stream, rhs); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StopRequest& lhs, - const bmqp_ctrlmsg::StopRequest& rhs) -{ - return lhs.clusterName() == rhs.clusterName(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StopRequest& lhs, - const bmqp_ctrlmsg::StopRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StopRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StopResponse& lhs, - const bmqp_ctrlmsg::StopResponse& rhs) -{ - return lhs.clusterName() == rhs.clusterName(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StopResponse& lhs, - const bmqp_ctrlmsg::StopResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StopResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - bmqp_ctrlmsg::StorageSyncResponseType::Value rhs) -{ - return bmqp_ctrlmsg::StorageSyncResponseType::print(stream, rhs); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::SubQueueIdInfo& lhs, - const bmqp_ctrlmsg::SubQueueIdInfo& rhs) -{ - return lhs.subId() == rhs.subId() && lhs.appId() == rhs.appId(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::SubQueueIdInfo& lhs, - const bmqp_ctrlmsg::SubQueueIdInfo& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::SubQueueIdInfo& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::SyncPoint& lhs, - const bmqp_ctrlmsg::SyncPoint& rhs) -{ - return lhs.primaryLeaseId() == rhs.primaryLeaseId() && - lhs.sequenceNum() == rhs.sequenceNum() && - lhs.dataFileOffsetDwords() == rhs.dataFileOffsetDwords() && - lhs.qlistFileOffsetWords() == rhs.qlistFileOffsetWords(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::SyncPoint& lhs, - const bmqp_ctrlmsg::SyncPoint& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::SyncPoint& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClientIdentity& lhs, - const bmqp_ctrlmsg::ClientIdentity& rhs) -{ - return lhs.protocolVersion() == rhs.protocolVersion() && - lhs.sdkVersion() == rhs.sdkVersion() && - lhs.clientType() == rhs.clientType() && - lhs.processName() == rhs.processName() && lhs.pid() == rhs.pid() && - lhs.sessionId() == rhs.sessionId() && - lhs.hostName() == rhs.hostName() && - lhs.features() == rhs.features() && - lhs.clusterName() == rhs.clusterName() && - lhs.clusterNodeId() == rhs.clusterNodeId() && - lhs.sdkLanguage() == rhs.sdkLanguage() && - lhs.guidInfo() == rhs.guidInfo(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClientIdentity& lhs, - const bmqp_ctrlmsg::ClientIdentity& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClientIdentity& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::DumpMessages& lhs, - const bmqp_ctrlmsg::DumpMessages& rhs) -{ - return lhs.msgTypeToDump() == rhs.msgTypeToDump() && - lhs.dumpActionType() == rhs.dumpActionType() && - lhs.dumpActionValue() == rhs.dumpActionValue(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::DumpMessages& lhs, - const bmqp_ctrlmsg::DumpMessages& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::DumpMessages& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ElectorMessageChoice& lhs, - const bmqp_ctrlmsg::ElectorMessageChoice& rhs) -{ - typedef bmqp_ctrlmsg::ElectorMessageChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_ELECTION_PROPOSAL: - return lhs.electionProposal() == rhs.electionProposal(); - case Class::SELECTION_ID_ELECTION_RESPONSE: - return lhs.electionResponse() == rhs.electionResponse(); - case Class::SELECTION_ID_LEADER_HEARTBEAT: - return lhs.leaderHeartbeat() == rhs.leaderHeartbeat(); - case Class::SELECTION_ID_ELECTOR_NODE_STATUS: - return lhs.electorNodeStatus() == rhs.electorNodeStatus(); - case Class::SELECTION_ID_HEARTBEAT_RESPONSE: - return lhs.heartbeatResponse() == rhs.heartbeatResponse(); - case Class::SELECTION_ID_SCOUTING_REQUEST: - return lhs.scoutingRequest() == rhs.scoutingRequest(); - case Class::SELECTION_ID_SCOUTING_RESPONSE: - return lhs.scoutingResponse() == rhs.scoutingResponse(); - case Class::SELECTION_ID_LEADERSHIP_CESSION_NOTIFICATION: - return lhs.leadershipCessionNotification() == - rhs.leadershipCessionNotification(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ElectorMessageChoice& lhs, - const bmqp_ctrlmsg::ElectorMessageChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ElectorMessageChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::Expression& lhs, - const bmqp_ctrlmsg::Expression& rhs) -{ - return lhs.version() == rhs.version() && lhs.text() == rhs.text(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::Expression& lhs, - const bmqp_ctrlmsg::Expression& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::Expression& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::FollowerLSNResponse& lhs, - const bmqp_ctrlmsg::FollowerLSNResponse& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::FollowerLSNResponse& lhs, - const bmqp_ctrlmsg::FollowerLSNResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::FollowerLSNResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderAdvisoryAck& lhs, - const bmqp_ctrlmsg::LeaderAdvisoryAck& rhs) -{ - return lhs.sequenceNumberAcked() == rhs.sequenceNumberAcked(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderAdvisoryAck& lhs, - const bmqp_ctrlmsg::LeaderAdvisoryAck& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderAdvisoryAck& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderAdvisoryCommit& lhs, - const bmqp_ctrlmsg::LeaderAdvisoryCommit& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber() && - lhs.sequenceNumberCommitted() == rhs.sequenceNumberCommitted(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderAdvisoryCommit& lhs, - const bmqp_ctrlmsg::LeaderAdvisoryCommit& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderAdvisoryCommit& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& lhs, - const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& rhs) -{ - return lhs.leaderMessageSequence() == rhs.leaderMessageSequence(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& lhs, - const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderSyncStateQueryResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::NodeStatusAdvisory& lhs, - const bmqp_ctrlmsg::NodeStatusAdvisory& rhs) -{ - return lhs.status() == rhs.status(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::NodeStatusAdvisory& lhs, - const bmqp_ctrlmsg::NodeStatusAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::NodeStatusAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionPrimaryAdvisory& lhs, - const bmqp_ctrlmsg::PartitionPrimaryAdvisory& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber() && - lhs.partitions() == rhs.partitions(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionPrimaryAdvisory& lhs, - const bmqp_ctrlmsg::PartitionPrimaryAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionPrimaryAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PrimaryStateRequest& lhs, - const bmqp_ctrlmsg::PrimaryStateRequest& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PrimaryStateRequest& lhs, - const bmqp_ctrlmsg::PrimaryStateRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PrimaryStateRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PrimaryStateResponse& lhs, - const bmqp_ctrlmsg::PrimaryStateResponse& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PrimaryStateResponse& lhs, - const bmqp_ctrlmsg::PrimaryStateResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PrimaryStateResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PrimaryStatusAdvisory& lhs, - const bmqp_ctrlmsg::PrimaryStatusAdvisory& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.primaryLeaseId() == rhs.primaryLeaseId() && - lhs.status() == rhs.status(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PrimaryStatusAdvisory& lhs, - const bmqp_ctrlmsg::PrimaryStatusAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PrimaryStatusAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueHandleParameters& lhs, - const bmqp_ctrlmsg::QueueHandleParameters& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.qId() == rhs.qId() && - lhs.subIdInfo() == rhs.subIdInfo() && lhs.flags() == rhs.flags() && - lhs.readCount() == rhs.readCount() && - lhs.writeCount() == rhs.writeCount() && - lhs.adminCount() == rhs.adminCount(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueHandleParameters& lhs, - const bmqp_ctrlmsg::QueueHandleParameters& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueHandleParameters& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueInfo& lhs, - const bmqp_ctrlmsg::QueueInfo& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.key() == rhs.key() && - lhs.partitionId() == rhs.partitionId() && - lhs.appIds() == rhs.appIds(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueInfo& lhs, - const bmqp_ctrlmsg::QueueInfo& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueInfo& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueInfoUpdate& lhs, - const bmqp_ctrlmsg::QueueInfoUpdate& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.key() == rhs.key() && - lhs.partitionId() == rhs.partitionId() && - lhs.addedAppIds() == rhs.addedAppIds() && - lhs.removedAppIds() == rhs.removedAppIds() && - lhs.domain() == rhs.domain(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueInfoUpdate& lhs, - const bmqp_ctrlmsg::QueueInfoUpdate& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueInfoUpdate& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueStreamParameters& lhs, - const bmqp_ctrlmsg::QueueStreamParameters& rhs) -{ - return lhs.subIdInfo() == rhs.subIdInfo() && - lhs.maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && - lhs.maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && - lhs.consumerPriority() == rhs.consumerPriority() && - lhs.consumerPriorityCount() == rhs.consumerPriorityCount(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueStreamParameters& lhs, - const bmqp_ctrlmsg::QueueStreamParameters& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueStreamParameters& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::RegistrationRequest& lhs, - const bmqp_ctrlmsg::RegistrationRequest& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::RegistrationRequest& lhs, - const bmqp_ctrlmsg::RegistrationRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::RegistrationRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ReplicaDataRequest& lhs, - const bmqp_ctrlmsg::ReplicaDataRequest& rhs) -{ - return lhs.replicaDataType() == rhs.replicaDataType() && - lhs.partitionId() == rhs.partitionId() && - lhs.beginSequenceNumber() == rhs.beginSequenceNumber() && - lhs.endSequenceNumber() == rhs.endSequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ReplicaDataRequest& lhs, - const bmqp_ctrlmsg::ReplicaDataRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ReplicaDataRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ReplicaDataResponse& lhs, - const bmqp_ctrlmsg::ReplicaDataResponse& rhs) -{ - return lhs.replicaDataType() == rhs.replicaDataType() && - lhs.partitionId() == rhs.partitionId() && - lhs.beginSequenceNumber() == rhs.beginSequenceNumber() && - lhs.endSequenceNumber() == rhs.endSequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ReplicaDataResponse& lhs, - const bmqp_ctrlmsg::ReplicaDataResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ReplicaDataResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ReplicaStateRequest& lhs, - const bmqp_ctrlmsg::ReplicaStateRequest& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ReplicaStateRequest& lhs, - const bmqp_ctrlmsg::ReplicaStateRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ReplicaStateRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ReplicaStateResponse& lhs, - const bmqp_ctrlmsg::ReplicaStateResponse& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.sequenceNumber() == rhs.sequenceNumber(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ReplicaStateResponse& lhs, - const bmqp_ctrlmsg::ReplicaStateResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ReplicaStateResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StateNotificationChoice& lhs, - const bmqp_ctrlmsg::StateNotificationChoice& rhs) -{ - typedef bmqp_ctrlmsg::StateNotificationChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_LEADER_PASSIVE: - return lhs.leaderPassive() == rhs.leaderPassive(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StateNotificationChoice& lhs, - const bmqp_ctrlmsg::StateNotificationChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StateNotificationChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::Status& lhs, - const bmqp_ctrlmsg::Status& rhs) -{ - return lhs.category() == rhs.category() && lhs.code() == rhs.code() && - lhs.message() == rhs.message(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::Status& lhs, - const bmqp_ctrlmsg::Status& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::Status& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StorageSyncResponse& lhs, - const bmqp_ctrlmsg::StorageSyncResponse& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.storageSyncResponseType() == rhs.storageSyncResponseType() && - lhs.beginSyncPoint() == rhs.beginSyncPoint() && - lhs.endSyncPoint() == rhs.endSyncPoint(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StorageSyncResponse& lhs, - const bmqp_ctrlmsg::StorageSyncResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StorageSyncResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::SyncPointOffsetPair& lhs, - const bmqp_ctrlmsg::SyncPointOffsetPair& rhs) -{ - return lhs.syncPoint() == rhs.syncPoint() && lhs.offset() == rhs.offset(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::SyncPointOffsetPair& lhs, - const bmqp_ctrlmsg::SyncPointOffsetPair& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::SyncPointOffsetPair& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::BrokerResponse& lhs, - const bmqp_ctrlmsg::BrokerResponse& rhs) -{ - return lhs.result() == rhs.result() && - lhs.protocolVersion() == rhs.protocolVersion() && - lhs.brokerVersion() == rhs.brokerVersion() && - lhs.isDeprecatedSdk() == rhs.isDeprecatedSdk() && - lhs.brokerIdentity() == rhs.brokerIdentity() && - lhs.heartbeatIntervalMs() == rhs.heartbeatIntervalMs() && - lhs.maxMissedHeartbeats() == rhs.maxMissedHeartbeats(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::BrokerResponse& lhs, - const bmqp_ctrlmsg::BrokerResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::BrokerResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::CloseQueue& lhs, - const bmqp_ctrlmsg::CloseQueue& rhs) -{ - return lhs.handleParameters() == rhs.handleParameters() && - lhs.isFinal() == rhs.isFinal(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::CloseQueue& lhs, - const bmqp_ctrlmsg::CloseQueue& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::CloseQueue& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ConfigureQueueStream& lhs, - const bmqp_ctrlmsg::ConfigureQueueStream& rhs) -{ - return lhs.qId() == rhs.qId() && - lhs.streamParameters() == rhs.streamParameters(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ConfigureQueueStream& lhs, - const bmqp_ctrlmsg::ConfigureQueueStream& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ConfigureQueueStream& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ElectorMessage& lhs, - const bmqp_ctrlmsg::ElectorMessage& rhs) -{ - return lhs.term() == rhs.term() && lhs.choice() == rhs.choice(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ElectorMessage& lhs, - const bmqp_ctrlmsg::ElectorMessage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ElectorMessage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderAdvisory& lhs, - const bmqp_ctrlmsg::LeaderAdvisory& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber() && - lhs.partitions() == rhs.partitions() && - lhs.queues() == rhs.queues(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderAdvisory& lhs, - const bmqp_ctrlmsg::LeaderAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::OpenQueue& lhs, - const bmqp_ctrlmsg::OpenQueue& rhs) -{ - return lhs.handleParameters() == rhs.handleParameters(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::OpenQueue& lhs, - const bmqp_ctrlmsg::OpenQueue& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::OpenQueue& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionMessageChoice& lhs, - const bmqp_ctrlmsg::PartitionMessageChoice& rhs) -{ - typedef bmqp_ctrlmsg::PartitionMessageChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_REPLICA_STATE_REQUEST: - return lhs.replicaStateRequest() == rhs.replicaStateRequest(); - case Class::SELECTION_ID_REPLICA_STATE_RESPONSE: - return lhs.replicaStateResponse() == rhs.replicaStateResponse(); - case Class::SELECTION_ID_PRIMARY_STATE_REQUEST: - return lhs.primaryStateRequest() == rhs.primaryStateRequest(); - case Class::SELECTION_ID_PRIMARY_STATE_RESPONSE: - return lhs.primaryStateResponse() == rhs.primaryStateResponse(); - case Class::SELECTION_ID_REPLICA_DATA_REQUEST: - return lhs.replicaDataRequest() == rhs.replicaDataRequest(); - case Class::SELECTION_ID_REPLICA_DATA_RESPONSE: - return lhs.replicaDataResponse() == rhs.replicaDataResponse(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionMessageChoice& lhs, - const bmqp_ctrlmsg::PartitionMessageChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionMessageChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionSyncDataQuery& lhs, - const bmqp_ctrlmsg::PartitionSyncDataQuery& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.lastPrimaryLeaseId() == rhs.lastPrimaryLeaseId() && - lhs.lastSequenceNum() == rhs.lastSequenceNum() && - lhs.uptoPrimaryLeaseId() == rhs.uptoPrimaryLeaseId() && - lhs.uptoSequenceNum() == rhs.uptoSequenceNum() && - lhs.lastSyncPointOffsetPair() == rhs.lastSyncPointOffsetPair(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionSyncDataQuery& lhs, - const bmqp_ctrlmsg::PartitionSyncDataQuery& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionSyncDataQuery& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& lhs, - const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.status() == rhs.status(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& lhs, - const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionSyncDataQueryStatus& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==( - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& lhs, - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.primaryLeaseId() == rhs.primaryLeaseId() && - lhs.sequenceNum() == rhs.sequenceNum() && - lhs.lastSyncPointOffsetPair() == rhs.lastSyncPointOffsetPair(); -} - -inline bool bmqp_ctrlmsg::operator!=( - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& lhs, - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& bmqp_ctrlmsg::operator<<( - bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionSyncStateQueryResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueAssignmentAdvisory& lhs, - const bmqp_ctrlmsg::QueueAssignmentAdvisory& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber() && - lhs.queues() == rhs.queues(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueAssignmentAdvisory& lhs, - const bmqp_ctrlmsg::QueueAssignmentAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueAssignmentAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& lhs, - const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& rhs) -{ - return lhs.primaryNodeId() == rhs.primaryNodeId() && - lhs.primaryLeaseId() == rhs.primaryLeaseId() && - lhs.partitionId() == rhs.partitionId() && - lhs.queues() == rhs.queues(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& lhs, - const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueUnAssignmentAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueUnassignedAdvisory& lhs, - const bmqp_ctrlmsg::QueueUnassignedAdvisory& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber() && - lhs.partitionId() == rhs.partitionId() && - lhs.primaryLeaseId() == rhs.primaryLeaseId() && - lhs.primaryNodeId() == rhs.primaryNodeId() && - lhs.queues() == rhs.queues(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueUnassignedAdvisory& lhs, - const bmqp_ctrlmsg::QueueUnassignedAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueUnassignedAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::QueueUpdateAdvisory& lhs, - const bmqp_ctrlmsg::QueueUpdateAdvisory& rhs) -{ - return lhs.sequenceNumber() == rhs.sequenceNumber() && - lhs.queueUpdates() == rhs.queueUpdates(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::QueueUpdateAdvisory& lhs, - const bmqp_ctrlmsg::QueueUpdateAdvisory& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::QueueUpdateAdvisory& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StateNotification& lhs, - const bmqp_ctrlmsg::StateNotification& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StateNotification& lhs, - const bmqp_ctrlmsg::StateNotification& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StateNotification& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StorageSyncRequest& lhs, - const bmqp_ctrlmsg::StorageSyncRequest& rhs) -{ - return lhs.partitionId() == rhs.partitionId() && - lhs.beginSyncPointOffsetPair() == rhs.beginSyncPointOffsetPair() && - lhs.endSyncPointOffsetPair() == rhs.endSyncPointOffsetPair(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StorageSyncRequest& lhs, - const bmqp_ctrlmsg::StorageSyncRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StorageSyncRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::Subscription& lhs, - const bmqp_ctrlmsg::Subscription& rhs) -{ - return lhs.sId() == rhs.sId() && lhs.expression() == rhs.expression() && - lhs.consumers() == rhs.consumers(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::Subscription& lhs, - const bmqp_ctrlmsg::Subscription& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::Subscription& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ConfigureQueueStreamResponse& lhs, - const bmqp_ctrlmsg::ConfigureQueueStreamResponse& rhs) -{ - return lhs.request() == rhs.request(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ConfigureQueueStreamResponse& lhs, - const bmqp_ctrlmsg::ConfigureQueueStreamResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ConfigureQueueStreamResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::FollowerClusterStateResponse& lhs, - const bmqp_ctrlmsg::FollowerClusterStateResponse& rhs) -{ - return lhs.clusterStateSnapshot() == rhs.clusterStateSnapshot(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::FollowerClusterStateResponse& lhs, - const bmqp_ctrlmsg::FollowerClusterStateResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::FollowerClusterStateResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& lhs, - const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& rhs) -{ - return lhs.leaderSyncData() == rhs.leaderSyncData(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& lhs, - const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::LeaderSyncDataQueryResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::NegotiationMessage& lhs, - const bmqp_ctrlmsg::NegotiationMessage& rhs) -{ - typedef bmqp_ctrlmsg::NegotiationMessage Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_CLIENT_IDENTITY: - return lhs.clientIdentity() == rhs.clientIdentity(); - case Class::SELECTION_ID_BROKER_RESPONSE: - return lhs.brokerResponse() == rhs.brokerResponse(); - case Class::SELECTION_ID_REVERSE_CONNECTION_REQUEST: - return lhs.reverseConnectionRequest() == - rhs.reverseConnectionRequest(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::NegotiationMessage& lhs, - const bmqp_ctrlmsg::NegotiationMessage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::NegotiationMessage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::OpenQueueResponse& lhs, - const bmqp_ctrlmsg::OpenQueueResponse& rhs) -{ - return lhs.originalRequest() == rhs.originalRequest() && - lhs.routingConfiguration() == rhs.routingConfiguration() && - lhs.deduplicationTimeMs() == rhs.deduplicationTimeMs(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::OpenQueueResponse& lhs, - const bmqp_ctrlmsg::OpenQueueResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::OpenQueueResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::PartitionMessage& lhs, - const bmqp_ctrlmsg::PartitionMessage& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::PartitionMessage& lhs, - const bmqp_ctrlmsg::PartitionMessage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::PartitionMessage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::StreamParameters& lhs, - const bmqp_ctrlmsg::StreamParameters& rhs) -{ - return lhs.appId() == rhs.appId() && - lhs.subscriptions() == rhs.subscriptions(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::StreamParameters& lhs, - const bmqp_ctrlmsg::StreamParameters& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::StreamParameters& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& lhs, - const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& rhs) -{ - typedef bmqp_ctrlmsg::ClusterStateFSMMessageChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_FOLLOWER_L_S_N_REQUEST: - return lhs.followerLSNRequest() == rhs.followerLSNRequest(); - case Class::SELECTION_ID_FOLLOWER_L_S_N_RESPONSE: - return lhs.followerLSNResponse() == rhs.followerLSNResponse(); - case Class::SELECTION_ID_REGISTRATION_REQUEST: - return lhs.registrationRequest() == rhs.registrationRequest(); - case Class::SELECTION_ID_REGISTRATION_RESPONSE: - return lhs.registrationResponse() == rhs.registrationResponse(); - case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_REQUEST: - return lhs.followerClusterStateRequest() == - rhs.followerClusterStateRequest(); - case Class::SELECTION_ID_FOLLOWER_CLUSTER_STATE_RESPONSE: - return lhs.followerClusterStateResponse() == - rhs.followerClusterStateResponse(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& lhs, - const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClusterStateFSMMessageChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ConfigureStream& lhs, - const bmqp_ctrlmsg::ConfigureStream& rhs) -{ - return lhs.qId() == rhs.qId() && - lhs.streamParameters() == rhs.streamParameters(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ConfigureStream& lhs, - const bmqp_ctrlmsg::ConfigureStream& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ConfigureStream& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClusterStateFSMMessage& lhs, - const bmqp_ctrlmsg::ClusterStateFSMMessage& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClusterStateFSMMessage& lhs, - const bmqp_ctrlmsg::ClusterStateFSMMessage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClusterStateFSMMessage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ConfigureStreamResponse& lhs, - const bmqp_ctrlmsg::ConfigureStreamResponse& rhs) -{ - return lhs.request() == rhs.request(); -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ConfigureStreamResponse& lhs, - const bmqp_ctrlmsg::ConfigureStreamResponse& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ConfigureStreamResponse& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClusterMessageChoice& lhs, - const bmqp_ctrlmsg::ClusterMessageChoice& rhs) -{ - typedef bmqp_ctrlmsg::ClusterMessageChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_PARTITION_PRIMARY_ADVISORY: - return lhs.partitionPrimaryAdvisory() == - rhs.partitionPrimaryAdvisory(); - case Class::SELECTION_ID_LEADER_ADVISORY: - return lhs.leaderAdvisory() == rhs.leaderAdvisory(); - case Class::SELECTION_ID_QUEUE_ASSIGNMENT_ADVISORY: - return lhs.queueAssignmentAdvisory() == - rhs.queueAssignmentAdvisory(); - case Class::SELECTION_ID_NODE_STATUS_ADVISORY: - return lhs.nodeStatusAdvisory() == rhs.nodeStatusAdvisory(); - case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY: - return lhs.leaderSyncStateQuery() == rhs.leaderSyncStateQuery(); - case Class::SELECTION_ID_LEADER_SYNC_STATE_QUERY_RESPONSE: - return lhs.leaderSyncStateQueryResponse() == - rhs.leaderSyncStateQueryResponse(); - case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY: - return lhs.leaderSyncDataQuery() == rhs.leaderSyncDataQuery(); - case Class::SELECTION_ID_LEADER_SYNC_DATA_QUERY_RESPONSE: - return lhs.leaderSyncDataQueryResponse() == - rhs.leaderSyncDataQueryResponse(); - case Class::SELECTION_ID_QUEUE_ASSIGNMENT_REQUEST: - return lhs.queueAssignmentRequest() == - rhs.queueAssignmentRequest(); - case Class::SELECTION_ID_STORAGE_SYNC_REQUEST: - return lhs.storageSyncRequest() == rhs.storageSyncRequest(); - case Class::SELECTION_ID_STORAGE_SYNC_RESPONSE: - return lhs.storageSyncResponse() == rhs.storageSyncResponse(); - case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY: - return lhs.partitionSyncStateQuery() == - rhs.partitionSyncStateQuery(); - case Class::SELECTION_ID_PARTITION_SYNC_STATE_QUERY_RESPONSE: - return lhs.partitionSyncStateQueryResponse() == - rhs.partitionSyncStateQueryResponse(); - case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY: - return lhs.partitionSyncDataQuery() == - rhs.partitionSyncDataQuery(); - case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_RESPONSE: - return lhs.partitionSyncDataQueryResponse() == - rhs.partitionSyncDataQueryResponse(); - case Class::SELECTION_ID_PARTITION_SYNC_DATA_QUERY_STATUS: - return lhs.partitionSyncDataQueryStatus() == - rhs.partitionSyncDataQueryStatus(); - case Class::SELECTION_ID_PRIMARY_STATUS_ADVISORY: - return lhs.primaryStatusAdvisory() == rhs.primaryStatusAdvisory(); - case Class::SELECTION_ID_CLUSTER_SYNC_REQUEST: - return lhs.clusterSyncRequest() == rhs.clusterSyncRequest(); - case Class::SELECTION_ID_CLUSTER_SYNC_RESPONSE: - return lhs.clusterSyncResponse() == rhs.clusterSyncResponse(); - case Class::SELECTION_ID_QUEUE_UN_ASSIGNMENT_ADVISORY: - return lhs.queueUnAssignmentAdvisory() == - rhs.queueUnAssignmentAdvisory(); - case Class::SELECTION_ID_QUEUE_UNASSIGNED_ADVISORY: - return lhs.queueUnassignedAdvisory() == - rhs.queueUnassignedAdvisory(); - case Class::SELECTION_ID_LEADER_ADVISORY_ACK: - return lhs.leaderAdvisoryAck() == rhs.leaderAdvisoryAck(); - case Class::SELECTION_ID_LEADER_ADVISORY_COMMIT: - return lhs.leaderAdvisoryCommit() == rhs.leaderAdvisoryCommit(); - case Class::SELECTION_ID_STATE_NOTIFICATION: - return lhs.stateNotification() == rhs.stateNotification(); - case Class::SELECTION_ID_STOP_REQUEST: - return lhs.stopRequest() == rhs.stopRequest(); - case Class::SELECTION_ID_STOP_RESPONSE: - return lhs.stopResponse() == rhs.stopResponse(); - case Class::SELECTION_ID_QUEUE_UNASSIGNMENT_REQUEST: - return lhs.queueUnassignmentRequest() == - rhs.queueUnassignmentRequest(); - case Class::SELECTION_ID_QUEUE_UPDATE_ADVISORY: - return lhs.queueUpdateAdvisory() == rhs.queueUpdateAdvisory(); - case Class::SELECTION_ID_CLUSTER_STATE_F_S_M_MESSAGE: - return lhs.clusterStateFSMMessage() == - rhs.clusterStateFSMMessage(); - case Class::SELECTION_ID_PARTITION_MESSAGE: - return lhs.partitionMessage() == rhs.partitionMessage(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClusterMessageChoice& lhs, - const bmqp_ctrlmsg::ClusterMessageChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClusterMessageChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ClusterMessage& lhs, - const bmqp_ctrlmsg::ClusterMessage& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ClusterMessage& lhs, - const bmqp_ctrlmsg::ClusterMessage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ClusterMessage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool -bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ControlMessageChoice& lhs, - const bmqp_ctrlmsg::ControlMessageChoice& rhs) -{ - typedef bmqp_ctrlmsg::ControlMessageChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_STATUS: return lhs.status() == rhs.status(); - case Class::SELECTION_ID_DISCONNECT: - return lhs.disconnect() == rhs.disconnect(); - case Class::SELECTION_ID_DISCONNECT_RESPONSE: - return lhs.disconnectResponse() == rhs.disconnectResponse(); - case Class::SELECTION_ID_ADMIN_COMMAND: - return lhs.adminCommand() == rhs.adminCommand(); - case Class::SELECTION_ID_ADMIN_COMMAND_RESPONSE: - return lhs.adminCommandResponse() == rhs.adminCommandResponse(); - case Class::SELECTION_ID_CLUSTER_MESSAGE: - return lhs.clusterMessage() == rhs.clusterMessage(); - case Class::SELECTION_ID_OPEN_QUEUE: - return lhs.openQueue() == rhs.openQueue(); - case Class::SELECTION_ID_OPEN_QUEUE_RESPONSE: - return lhs.openQueueResponse() == rhs.openQueueResponse(); - case Class::SELECTION_ID_CLOSE_QUEUE: - return lhs.closeQueue() == rhs.closeQueue(); - case Class::SELECTION_ID_CLOSE_QUEUE_RESPONSE: - return lhs.closeQueueResponse() == rhs.closeQueueResponse(); - case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM: - return lhs.configureQueueStream() == rhs.configureQueueStream(); - case Class::SELECTION_ID_CONFIGURE_QUEUE_STREAM_RESPONSE: - return lhs.configureQueueStreamResponse() == - rhs.configureQueueStreamResponse(); - case Class::SELECTION_ID_CONFIGURE_STREAM: - return lhs.configureStream() == rhs.configureStream(); - case Class::SELECTION_ID_CONFIGURE_STREAM_RESPONSE: - return lhs.configureStreamResponse() == - rhs.configureStreamResponse(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool -bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ControlMessageChoice& lhs, - const bmqp_ctrlmsg::ControlMessageChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ControlMessageChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool bmqp_ctrlmsg::operator==(const bmqp_ctrlmsg::ControlMessage& lhs, - const bmqp_ctrlmsg::ControlMessage& rhs) -{ - return lhs.rId() == rhs.rId() && lhs.choice() == rhs.choice(); -} - -inline bool bmqp_ctrlmsg::operator!=(const bmqp_ctrlmsg::ControlMessage& lhs, - const bmqp_ctrlmsg::ControlMessage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -bmqp_ctrlmsg::operator<<(bsl::ostream& stream, - const bmqp_ctrlmsg::ControlMessage& rhs) -{ - return rhs.print(stream, 0, -1); -} - } // close enterprise namespace #endif diff --git a/src/groups/bmq/bmqp/bmqp_event.h b/src/groups/bmq/bmqp/bmqp_event.h index 44e2a89c29..0512dcb4bb 100644 --- a/src/groups/bmq/bmqp/bmqp_event.h +++ b/src/groups/bmq/bmqp/bmqp_event.h @@ -102,9 +102,9 @@ class Event { // PRIVATE ACCESSORS /// Load into the specified `message`, the decoded message contained in - /// this event. The behavior is undefined unless `isControlEvent()` or - /// 'isElectorEvent() returns true. Return 0 on success, and a non-zero - /// return code on error. + /// this event. The behavior is undefined unless `isControlEvent()`, + /// `isElectorEvent()`, or `isAuthenticationEvent()` returns true. Return + /// 0 on success, and a non-zero return code on error. template int loadSchemaEvent(TYPE* message) const; @@ -165,6 +165,8 @@ class Event { /// `isValid()` returns true. EventType::Enum type() const; + /// Return true if this event is of the corresponding type. The + /// behavior is undefined unless `isValid()` returns true. bool isControlEvent() const; bool isPutEvent() const; bool isConfirmEvent() const; @@ -178,10 +180,8 @@ class Event { bool isHeartbeatReqEvent() const; bool isHeartbeatRspEvent() const; bool isRejectEvent() const; - - /// Return true if this event is of the corresponding type. The - /// behavior is undefined unless `isValid()` returns true. bool isReceiptEvent() const; + bool isAuthenticationEvent() const; /// Load into the specified `message`, the decoded message contained in /// this event. The behavior is undefined unless `isControlEvent()` @@ -197,6 +197,13 @@ class Event { template int loadElectorEvent(TYPE* message) const; + /// Load into the specified `message`, the decoded message contained in + /// this event. The behavior is undefined unless `isAuthenticationEvent()` + /// returns true. Return 0 on success, and a non-zero return code on + /// error. + template + int loadAuthenticationEvent(TYPE* message) const; + void loadAckMessageIterator(AckMessageIterator* iterator) const; void loadConfirmMessageIterator(ConfirmMessageIterator* iterator) const; void loadPushMessageIterator(PushMessageIterator* iterator, @@ -315,7 +322,8 @@ template int Event::loadSchemaEvent(TYPE* message) const { // PRECONDITIONS - BSLS_ASSERT_SAFE(isControlEvent() || isElectorEvent()); + BSLS_ASSERT_SAFE(isControlEvent() || isElectorEvent() || + isAuthenticationEvent()); if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY(!isValid())) { BSLS_PERFORMANCEHINT_UNLIKELY_HINT; @@ -540,6 +548,14 @@ inline bool Event::isReceiptEvent() const return d_header->type() == EventType::e_REPLICATION_RECEIPT; } +inline bool Event::isAuthenticationEvent() const +{ + // PRECONDITIONS + BSLS_ASSERT_SAFE(isValid()); + + return d_header->type() == EventType::e_AUTHENTICATION; +} + template int Event::loadControlEvent(TYPE* message) const { @@ -558,6 +574,15 @@ int Event::loadElectorEvent(TYPE* message) const return loadSchemaEvent(message); } +template +int Event::loadAuthenticationEvent(TYPE* message) const +{ + // PRECONDITIONS + BSLS_ASSERT_SAFE(isAuthenticationEvent()); + + return loadSchemaEvent(message); +} + inline void Event::loadAckMessageIterator(AckMessageIterator* iterator) const { // PRECONDITIONS diff --git a/src/groups/bmq/bmqp/bmqp_protocol.cpp b/src/groups/bmq/bmqp/bmqp_protocol.cpp index a1b521e514..ee382578b7 100644 --- a/src/groups/bmq/bmqp/bmqp_protocol.cpp +++ b/src/groups/bmq/bmqp/bmqp_protocol.cpp @@ -207,6 +207,7 @@ const char* EventType::toAscii(EventType::Enum value) CASE(HEARTBEAT_REQ) CASE(HEARTBEAT_RSP) CASE(REPLICATION_RECEIPT) + CASE(AUTHENTICATION) default: return "(* UNKNOWN *)"; } diff --git a/src/groups/bmq/bmqp/bmqp_protocol.h b/src/groups/bmq/bmqp/bmqp_protocol.h index ffc9e69730..5d0c984acb 100644 --- a/src/groups/bmq/bmqp/bmqp_protocol.h +++ b/src/groups/bmq/bmqp/bmqp_protocol.h @@ -475,7 +475,10 @@ struct EventType { e_HEARTBEAT_REQ = 11, e_HEARTBEAT_RSP = 12, e_REJECT = 13, - e_REPLICATION_RECEIPT = 14 + e_REPLICATION_RECEIPT = 14, + + // Authentication event + e_AUTHENTICATION = 15, }; // CONSTANTS diff --git a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.h b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.h index e19932a04a..5fadebda7a 100644 --- a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.h @@ -222,6 +222,7 @@ int SchemaEventBuilder::setMessage(const TYPE& message, EventType::Enum type) BSLS_ASSERT_SAFE(d_blob_sp->length() == 0); // Ensure the blob is empty BSLS_ASSERT_SAFE(d_encodingType != EncodingType::e_UNKNOWN); BSLS_ASSERT_SAFE(type == EventType::e_CONTROL || + type == EventType::e_AUTHENTICATION || (type == EventType::e_ELECTOR && d_encodingType == EncodingType::e_BER)); // Currently, we only support BER encoding for elector messages diff --git a/src/groups/mqb/mqba/mqba_application.cpp b/src/groups/mqb/mqba/mqba_application.cpp index 8b8a4169cf..74e39575f5 100644 --- a/src/groups/mqb/mqba/mqba_application.cpp +++ b/src/groups/mqb/mqba/mqba_application.cpp @@ -18,6 +18,7 @@ #include // MQB +#include #include #include #include @@ -316,6 +317,11 @@ int Application::start(bsl::ostream& errorDescription) } // Start the transport manager + bslma::ManagedPtr authenticatorMp( + new (*d_allocator_p) + Authenticator(&d_blobSpPool, d_allocators.get("Authenticator")), + d_allocator_p); + SessionNegotiator* sessionNegotiator = new (*d_allocator_p) SessionNegotiator(&d_bufferFactory, d_dispatcher_mp.get(), @@ -339,6 +345,7 @@ int Application::start(bsl::ostream& errorDescription) bslma::ManagedPtr initialConnectionHandlerMp( new (*d_allocator_p) InitialConnectionHandler( + authenticatorMp, negotiatorMp, d_allocators.get("InitialConnectionHandler")), d_allocator_p); diff --git a/src/groups/mqb/mqba/mqba_authenticator.cpp b/src/groups/mqb/mqba/mqba_authenticator.cpp new file mode 100644 index 0000000000..87d264d0f3 --- /dev/null +++ b/src/groups/mqb/mqba/mqba_authenticator.cpp @@ -0,0 +1,209 @@ +// Copyright 2025 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// mqba_authenticator.h -*-C++-*- +#include + +#include + +/// Implementation Notes +///==================== +/// TODO + +// MQB +#include + +// BMQ + +// BDE +#include + +namespace BloombergLP { +namespace mqba { + +namespace { +BALL_LOG_SET_NAMESPACE_CATEGORY("MQBA.AUTHENTICATOR"); + +const int k_AUTHENTICATION_READTIMEOUT = 3 * 60; // 3 minutes + +} + +// ------------------- +// class Authenticator +// ------------------- + +int Authenticator::onAuthenticationRequest( + bsl::ostream& errorDescription, + const AuthenticationContextSp& context) +{ + // PRECONDITIONS + BSLS_ASSERT_SAFE( + context->d_authenticationMessage.isAuthenticateRequestValue()); + BSLS_ASSERT_SAFE(context->d_initialConnectionContext_p->isIncoming() || + context->d_isReversed); + + bmqp_ctrlmsg::AuthenticateRequest& authenticateRequest = + context->d_authenticationMessage.authenticateRequest(); + + BALL_LOG_DEBUG + << "Received authentication message from '" + << context->d_initialConnectionContext_p->channel()->peerUri() + << "': " << authenticateRequest; + + bmqp_ctrlmsg::AuthenticationMessage authenticationResponse; + bmqp_ctrlmsg::AuthenticateResponse& response = + authenticationResponse.makeAuthenticateResponse(); + + // TODO: authenticate + if (authenticateRequest.mechanism() == "") { + BALL_LOG_ERROR << "Error on authentication"; + + bmqu::MemOutStream os; + os << "Mechanism is unspecified"; + response.status().category() = + bmqp_ctrlmsg::StatusCategory::E_NOT_SUPPORTED; + response.status().message() = os.str(); + response.status().code() = -1; + } + else { + response.status().category() = bmqp_ctrlmsg::StatusCategory::E_SUCCESS; + response.status().code() = 0; + response.lifetimeMs() = 10 * 60 * 1000; + } + + int rc = sendAuthenticationMessage(errorDescription, + authenticationResponse, + context); + + return rc; +} + +int Authenticator::onAuthenticationResponse( + bsl::ostream& errorDescription, + const AuthenticationContextSp& context) +{ + BALL_LOG_ERROR << "Not Implemented"; + + return -1; +} + +int Authenticator::sendAuthenticationMessage( + bsl::ostream& errorDescription, + const bmqp_ctrlmsg::AuthenticationMessage& message, + const AuthenticationContextSp& context) +{ + enum RcEnum { + // Value for the various RC error categories + rc_SUCCESS = 0, + rc_BUILD_FAILURE = -1, + rc_WRITE_FAILURE = -2 + }; + + bmqp::EncodingType::Enum encodingType = bmqp::EncodingType::e_BER; + + bdlma::LocalSequentialAllocator<2048> localAllocator(d_allocator_p); + + bmqp::SchemaEventBuilder builder(d_blobSpPool_p, + encodingType, + &localAllocator); + + int rc = builder.setMessage(message, bmqp::EventType::e_AUTHENTICATION); + if (rc != 0) { + errorDescription << "Failed building AuthenticationMessage " + << "[rc: " << rc << ", message: " << message << "]"; + return rc_BUILD_FAILURE; // RETURN + } + + // Send response event + bmqio::Status status; + context->d_initialConnectionContext_p->channel()->write(&status, + *builder.blob()); + if (!status) { + errorDescription << "Failed sending AuthenticationMessage " + << "[status: " << status << ", message: " << message + << "]"; + return rc_WRITE_FAILURE; // RETURN + } + + return rc_SUCCESS; +} + +void Authenticator::initiateOutboundAuthentication( + const AuthenticationContextSp& context) +{ +} + +// CREATORS +Authenticator::Authenticator(BlobSpPool* blobSpPool, + bslma::Allocator* allocator) +: d_allocator_p(allocator) +, d_blobSpPool_p(blobSpPool) +, d_clusterCatalog_p(0) +{ + // NOTHING +} + +/// Destructor +Authenticator::~Authenticator() +{ + // NOTHING: (required because of inheritance) +} + +int Authenticator::handleAuthenticationOnMsgType( + bsl::ostream& errorDescription, + bool* isContinueRead, + const AuthenticationContextSp& context) +{ + enum RcEnum { + // Value for the various RC error categories + rc_SUCCESS = 0, + rc_ERROR = -1, + }; + + bmqu::MemOutStream errStream; + int rc = rc_SUCCESS; + + switch (context->d_authenticationMessage.selectionId()) { + case bmqp_ctrlmsg::AuthenticationMessage:: + SELECTION_ID_AUTHENTICATE_REQUEST: { + rc = onAuthenticationRequest(errStream, context); + } break; // BREAK + case bmqp_ctrlmsg::AuthenticationMessage:: + SELECTION_ID_AUTHENTICATE_RESPONSE: { + rc = onAuthenticationResponse(errStream, context); + } break; // BREAK + default: { + errorDescription + << "Invalid authentication message received (unknown type): " + << context->d_authenticationMessage; + return rc_ERROR; // RETURN + } + } + + if (rc == rc_SUCCESS) { + *isContinueRead = true; + } + + return rc; +} + +int Authenticator::authenticationOutboundOrReverse( + const AuthenticationContextSp& context) +{ + return 0; +} + +} // close package namespace +} // close enterprise namespace diff --git a/src/groups/mqb/mqba/mqba_authenticator.h b/src/groups/mqb/mqba/mqba_authenticator.h new file mode 100644 index 0000000000..91eb40090b --- /dev/null +++ b/src/groups/mqb/mqba/mqba_authenticator.h @@ -0,0 +1,186 @@ +// Copyright 2025 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// mqba_authenticator.h -*-C++-*- +#ifndef INCLUDED_MQBA_AUTHENTICATOR +#define INCLUDED_MQBA_AUTHENTICATOR + +/// @file mqba_authenticator.h +/// +/// @brief +/// +/// +/// Thread Safety {#mqba_authenticator_thread} +/// ============= +/// +/// The implementation must be thread safe as 'authenticate()' may be called +/// concurrently from many IO threads. + +// MQB +#include +#include + +// BMQ +#include +#include +#include + +// BDE +#include +#include +#include +#include +#include +#include +#include + +namespace BloombergLP { + +// FORWARD DECLARATION +namespace mqbblp { +class ClusterCatalog; +} +namespace mqbi { +class Dispatcher; +} + +namespace mqba { + +// =================== +// class Authenticator +// =================== + +/// Authenticator for a BlazingMQ session with client or broker +class Authenticator : public mqbnet::Authenticator { + public: + // TYPES + + /// Type of a pool of shared pointers to blob + typedef bdlcc::SharedObjectPool< + bdlbb::Blob, + bdlcc::ObjectPoolFunctors::DefaultCreator, + bdlcc::ObjectPoolFunctors::RemoveAll > + BlobSpPool; + + private: + typedef bsl::shared_ptr + AuthenticationContextSp; + + private: + // DATA + + /// Allocator to use. + bslma::Allocator* d_allocator_p; + + BlobSpPool* d_blobSpPool_p; + + /// Cluster catalog to query for cluster information. + mqbblp::ClusterCatalog* d_clusterCatalog_p; + + private: + // NOT IMPLEMENTED + + /// Copy constructor and assignment operator not implemented. + Authenticator(const Authenticator&); // = delete + Authenticator& operator=(const Authenticator&); // = delete + + private: + // PRIVATE MANIPULATORS + + /// Invoked when received a `ClientIdentity` authentication message with + /// the specified `context`. Creates and return a Session on success, + /// or return a null pointer and populate the specified + /// `errorDescription` with a description of the error on failure. + int onAuthenticationRequest(bsl::ostream& errorDescription, + const AuthenticationContextSp& context); + + /// Invoked when received a `BrokerResponse` authentication message with + /// the specified `context`. Creates and return a Session on success, + /// or return a null pointer and populate the specified + /// `errorDescription` with a description of the error on failure. + int onAuthenticationResponse(bsl::ostream& errorDescription, + const AuthenticationContextSp& context); + + /// Send the specified `message` to the peer associated with the + /// specified `context` and return 0 on success, or return a non-zero + /// code on error and populate the specified `errorDescription` with a + /// description of the error. + int sendAuthenticationMessage( + bsl::ostream& errorDescription, + const bmqp_ctrlmsg::AuthenticationMessage& message, + const AuthenticationContextSp& context); + + /// Initiate an outbound authentication (i.e., send out some authentication + /// message and schedule a read of the response) using the specified + /// `context`. + /// Senario: reverse connection + void + initiateOutboundAuthentication(const AuthenticationContextSp& context); + + public: + // TRAITS + BSLMF_NESTED_TRAIT_DECLARATION(Authenticator, bslma::UsesBslmaAllocator) + + public: + // CREATORS + + /// Create a new `Authenticator` using the specified + /// `bufferFactory`, `dispatcher`, `statContext`, `scheduler` and + /// `blobSpPool` to inject in the negotiated sessions. Use the + /// specified `allocator` for all memory allocations. + Authenticator(BlobSpPool* blobSpPool, bslma::Allocator* allocator); + + /// Destructor + ~Authenticator() BSLS_KEYWORD_OVERRIDE; + + // MANIPULATORS + + /// Set the cluster catalog to use to the specified `value` and return a + /// reference offering modifiable access to this object. + Authenticator& setClusterCatalog(mqbblp::ClusterCatalog* value); + + // MANIPULATORS + // (virtual: mqbnet::Authenticator) + + int handleAuthenticationOnMsgType(bsl::ostream& errorDescription, + bool* isContinueRead, + const AuthenticationContextSp& context) + BSLS_KEYWORD_OVERRIDE; + + /// Send out outbound authentication message or reverse connection request + /// with the specified `context`. + int authenticationOutboundOrReverse(const AuthenticationContextSp& context) + BSLS_KEYWORD_OVERRIDE; +}; + +// ============================================================================ +// INLINE DEFINITIONS +// ============================================================================ + +// ------------------- +// class Authenticator +// ------------------- + +inline Authenticator& +Authenticator::setClusterCatalog(mqbblp::ClusterCatalog* value) +{ + d_clusterCatalog_p = value; + return *this; +} + +} // close package namespace +} // close enterprise namespace + +#endif diff --git a/src/groups/mqb/mqba/mqba_initialconnectionhandler.cpp b/src/groups/mqb/mqba/mqba_initialconnectionhandler.cpp index 485fa2a9a0..049c5dd7b0 100644 --- a/src/groups/mqb/mqba/mqba_initialconnectionhandler.cpp +++ b/src/groups/mqb/mqba/mqba_initialconnectionhandler.cpp @@ -175,17 +175,29 @@ int InitialConnectionHandler::processBlob( rc_INVALID_NEGOTIATION_MESSAGE = -1, }; - bsl::optional negotiationMsg; + bsl::optional authenticationMsg; + bsl::optional negotiationMsg; int rc = decodeInitialConnectionMessage(errorDescription, blob, + &authenticationMsg, &negotiationMsg); - if (rc != 0) { + if (rc != rc_SUCCESS) { return (rc * 10) + rc_INVALID_NEGOTIATION_MESSAGE; // RETURN } - if (negotiationMsg.has_value()) { + // Authentication or Negotiation based on the type of message received. + if (authenticationMsg.has_value()) { + context->authenticationContext()->d_authenticationMessage = + authenticationMsg.value(); + + rc = d_authenticator_mp->handleAuthenticationOnMsgType( + errorDescription, + isContinueRead, + context->authenticationContext()); + } + else if (negotiationMsg.has_value()) { context->negotiationContext()->d_negotiationMessage = negotiationMsg.value(); @@ -196,9 +208,9 @@ int InitialConnectionHandler::processBlob( context->negotiationContext()); } else { - errorDescription - << "Decode NegotiationMessage succeeds but nothing is " - "loaded into the NegotiationMessage."; + errorDescription << "Decode AuthenticationMessage or " + "NegotiationMessage succeeds but nothing gets " + "loaded in."; rc = (rc * 10) + rc_INVALID_NEGOTIATION_MESSAGE; } @@ -206,18 +218,21 @@ int InitialConnectionHandler::processBlob( } int InitialConnectionHandler::decodeInitialConnectionMessage( - bsl::ostream& errorDescription, - const bdlbb::Blob& blob, - bsl::optional* message) + bsl::ostream& errorDescription, + const bdlbb::Blob& blob, + bsl::optional* authenticationMsg, + bsl::optional* negotiationMsg) { - BSLS_ASSERT(message); + BSLS_ASSERT(authenticationMsg); + BSLS_ASSERT(negotiationMsg); enum RcEnum { // Value for the various RC error categories - rc_SUCCESS = 0, - rc_INVALID_MESSAGE = -1, - rc_NOT_CONTROL_EVENT = -2, - rc_INVALID_CONTROL_EVENT = -3 + rc_SUCCESS = 0, + rc_INVALID_MESSAGE = -1, + rc_INVALID_EVENT = -2, + rc_INVALID_AUTHENTICATION_EVENT = -3, + rc_INVALID_CONTROL_EVENT = -4 }; bdlma::LocalSequentialAllocator<2048> localAllocator(d_allocator_p); @@ -231,25 +246,40 @@ int InitialConnectionHandler::decodeInitialConnectionMessage( return rc_INVALID_MESSAGE; // RETURN } - if (!event.isControlEvent()) { - errorDescription << "Invalid negotiation message received " - << "(packet is not a ControlEvent):\n" - << bmqu::BlobStartHexDumper(&blob); - return rc_NOT_CONTROL_EVENT; // RETURN - } - - bmqp_ctrlmsg::NegotiationMessage negotiationMessage; - - int rc = event.loadControlEvent(&negotiationMessage); + bmqp_ctrlmsg::AuthenticationMessage authenticationMessage; + bmqp_ctrlmsg::NegotiationMessage negotiationMessage; + + if (event.isAuthenticationEvent()) { + const int rc = event.loadAuthenticationEvent(&authenticationMessage); + if (rc != 0) { + BALL_LOG_ERROR + << "Invalid response from broker [reason: 'authentication " + "event is not an AuthenticationMessage', rc: " + << rc << "]: " << event; + return rc_INVALID_AUTHENTICATION_EVENT; // RETURN + } - if (rc != 0) { - errorDescription << "Invalid negotiation message received (failed " - << "decoding ControlEvent): [rc: " << rc << "]:\n" - << bmqu::BlobStartHexDumper(&blob); - return rc_INVALID_CONTROL_EVENT; // RETURN + *authenticationMsg = authenticationMessage; } + else if (event.isControlEvent()) { + const int rc = event.loadControlEvent(&negotiationMessage); + if (rc != 0) { + BALL_LOG_ERROR << "Invalid response from broker [reason: 'control " + "event is not an NegotiationMessage', rc: " + << rc << "]: " << event; + + return rc_INVALID_CONTROL_EVENT; // RETURN + } - *message = negotiationMessage; + *negotiationMsg = negotiationMessage; + } + else { + errorDescription + << "Invalid initial connection message received " + << "(packet is not an AuthenticationEvent or ControlEvent):\n" + << bmqu::BlobStartHexDumper(&blob); + return rc_INVALID_EVENT; // RETURN + } return rc_SUCCESS; } @@ -297,9 +327,11 @@ void InitialConnectionHandler::complete( } InitialConnectionHandler::InitialConnectionHandler( - bslma::ManagedPtr& negotiator, - bslma::Allocator* allocator) -: d_negotiator_mp(negotiator) + bslma::ManagedPtr& authenticator, + bslma::ManagedPtr& negotiator, + bslma::Allocator* allocator) +: d_authenticator_mp(authenticator) +, d_negotiator_mp(negotiator) , d_allocator_p(allocator) { } @@ -308,9 +340,21 @@ InitialConnectionHandler::~InitialConnectionHandler() { } -void InitialConnectionHandler::handleInitialConnection( +void InitialConnectionHandler::setupContext( const InitialConnectionContextSp& context) { + // Create an AuthenticationContext for that connection + bsl::shared_ptr authenticationContext; + authenticationContext.createInplace(d_allocator_p); + + authenticationContext->d_initialConnectionContext_p = context.get(); + authenticationContext->d_isReversed = false; + authenticationContext->d_clusterName = ""; + authenticationContext->d_connectionType = + mqbnet::ConnectionType::e_UNKNOWN; + + context->setAuthenticationContext(authenticationContext); + // Create an NegotiationContext for that connection bsl::shared_ptr negotiationContext; negotiationContext.createInplace(d_allocator_p); @@ -321,7 +365,11 @@ void InitialConnectionHandler::handleInitialConnection( negotiationContext->d_connectionType = mqbnet::ConnectionType::e_UNKNOWN; context->setNegotiationContext(negotiationContext); +} +void InitialConnectionHandler::handleConnectionFlow( + const InitialConnectionContextSp& context) +{ // Reading for inbound request or continue to read // after sending a request ourselves @@ -363,5 +411,12 @@ void InitialConnectionHandler::handleInitialConnection( guard.release(); } +void InitialConnectionHandler::handleInitialConnection( + const InitialConnectionContextSp& context) +{ + setupContext(context); + handleConnectionFlow(context); +} + } // close package namespace } // close enterprise namespace diff --git a/src/groups/mqb/mqba/mqba_initialconnectionhandler.h b/src/groups/mqb/mqba/mqba_initialconnectionhandler.h index f787e4b648..1f47df91e1 100644 --- a/src/groups/mqb/mqba/mqba_initialconnectionhandler.h +++ b/src/groups/mqb/mqba/mqba_initialconnectionhandler.h @@ -20,6 +20,7 @@ #include // MQB +#include #include #include @@ -37,9 +38,6 @@ namespace BloombergLP { namespace mqba { -// FORWARD DECLARATION -class SessionNegotiator; - // ============================== // class InitialConnectionHandler // ============================== @@ -53,7 +51,10 @@ class InitialConnectionHandler : public mqbnet::InitialConnectionHandler { private: // DATA - /// Negotiator to use for converting a Channel to a Session + /// Authenticator to use for authenticating a connection. + bslma::ManagedPtr d_authenticator_mp; + + /// Negotiator to use for converting a Channel to a Session. bslma::ManagedPtr d_negotiator_mp; /// Allocator to use. @@ -99,9 +100,10 @@ class InitialConnectionHandler : public mqbnet::InitialConnectionHandler { /// populate the specified `errorDescription` with a description of the /// error. int decodeInitialConnectionMessage( - bsl::ostream& errorDescription, - const bdlbb::Blob& blob, - bsl::optional* negotiationMsg); + bsl::ostream& errorDescription, + const bdlbb::Blob& blob, + bsl::optional* authenticationMsg, + bsl::optional* negotiationMsg); /// Schedule a read for the initial connection of the session of the /// specified `context`. Return a non-zero code on error and @@ -118,11 +120,17 @@ class InitialConnectionHandler : public mqbnet::InitialConnectionHandler { const bsl::string& error, const bsl::shared_ptr& session); + void setupContext(const InitialConnectionContextSp& context); + + void handleConnectionFlow(const InitialConnectionContextSp& context); + public: // CREATORS - InitialConnectionHandler(bslma::ManagedPtr& negotiator, - bslma::Allocator* allocator); + InitialConnectionHandler( + bslma::ManagedPtr& authenticator, + bslma::ManagedPtr& negotiator, + bslma::Allocator* allocator); /// Destructor ~InitialConnectionHandler() BSLS_KEYWORD_OVERRIDE; diff --git a/src/groups/mqb/mqba/mqba_sessionnegotiator.h b/src/groups/mqb/mqba/mqba_sessionnegotiator.h index cee55d3b56..652645bef8 100644 --- a/src/groups/mqb/mqba/mqba_sessionnegotiator.h +++ b/src/groups/mqb/mqba/mqba_sessionnegotiator.h @@ -44,7 +44,6 @@ // BDE #include -#include #include #include #include diff --git a/src/groups/mqb/mqba/package/mqba.mem b/src/groups/mqb/mqba/package/mqba.mem index af31e02095..fa8824f950 100644 --- a/src/groups/mqb/mqba/package/mqba.mem +++ b/src/groups/mqb/mqba/package/mqba.mem @@ -1,5 +1,6 @@ mqba_adminsession mqba_application +mqba_authenticator mqba_clientsession mqba_commandrouter mqba_configprovider diff --git a/src/groups/mqb/mqbblp/mqbblp_cluster.cpp b/src/groups/mqb/mqbblp/mqbblp_cluster.cpp index f110414027..d2282d003f 100644 --- a/src/groups/mqb/mqbblp/mqbblp_cluster.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_cluster.cpp @@ -3369,6 +3369,11 @@ void Cluster::processEvent(const bmqp::Event& event, // Receipt event arrives from replication nodes to primary. d_storageManager_mp->processReceiptEvent(event, source); } break; // BREAK + case bmqp::EventType::e_AUTHENTICATION: { + // TODO + BALL_LOG_ERROR << "Received Authentication Event but reauthentication " + "logic is not implemented yet."; + } break; // BREAK case bmqp::EventType::e_UNDEFINED: default: { BMQTSK_ALARMLOG_ALARM("CLUSTER") diff --git a/src/groups/mqb/mqbblp/mqbblp_clusterproxy.cpp b/src/groups/mqb/mqbblp/mqbblp_clusterproxy.cpp index ba99575edb..7ca0546252 100644 --- a/src/groups/mqb/mqbblp/mqbblp_clusterproxy.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_clusterproxy.cpp @@ -772,6 +772,11 @@ void ClusterProxy::processEvent(const bmqp::Event& event, .setBlob(blobSp); dispatcher()->dispatchEvent(dispEvent, this); } break; + case bmqp::EventType::e_AUTHENTICATION: { + // TODO + BALL_LOG_ERROR << "Received Authentication Event but reauthentication " + "logic is not implemented yet."; + } break; // BREAK case bmqp::EventType::e_UNDEFINED: case bmqp::EventType::e_CLUSTER_STATE: case bmqp::EventType::e_ELECTOR: diff --git a/src/groups/mqb/mqbnet/mqbnet_authenticationcontext.cpp b/src/groups/mqb/mqbnet/mqbnet_authenticationcontext.cpp new file mode 100644 index 0000000000..ba9943403d --- /dev/null +++ b/src/groups/mqb/mqbnet/mqbnet_authenticationcontext.cpp @@ -0,0 +1,26 @@ +// Copyright 2025 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// mqbnet_authenticationcontext.cpp -*-C++-*- +#include + +#include +namespace BloombergLP { +namespace mqbnet { + +// NOTHING + +} // close package namespace +} // close enterprise namespace diff --git a/src/groups/mqb/mqbnet/mqbnet_authenticationcontext.h b/src/groups/mqb/mqbnet/mqbnet_authenticationcontext.h new file mode 100644 index 0000000000..3996921b5d --- /dev/null +++ b/src/groups/mqb/mqbnet/mqbnet_authenticationcontext.h @@ -0,0 +1,64 @@ +// Copyright 2025 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// mqbnet_authenticationcontext.h -*-C++-*- +#ifndef INCLUDED_MQBNET_AUTHENTICATIONCONTEXT +#define INCLUDED_MQBNET_AUTHENTICATIONCONTEXT + +/// @file mqbnet_authenticationcontext.h +/// +/// @brief Provide the context for initial connection handler for establishing +/// sessions. +/// + +// MQB +#include + +// BMQ +#include + +namespace BloombergLP { +namespace mqbnet { + +// =========================== +// class AuthenticationContext +// =========================== + +// VST for an implementation of AuthenticationContext +struct AuthenticationContext { + // DATA + /// The associated InitialConnectionContext passed in by the caller. + /// Held, not owned + InitialConnectionContext* d_initialConnectionContext_p; + + /// The authentication message received from the remote peer. + bmqp_ctrlmsg::AuthenticationMessage d_authenticationMessage; + + /// The cluster involved in the session being authenticated, + /// or empty if none. + bsl::string d_clusterName; + + /// True if this is a "reversed" connection (on either side of the + /// connection). + bool d_isReversed; + + /// The type of the session being authenticated. + ConnectionType::Enum d_connectionType; +}; + +} // close package namespace +} // close enterprise namespace + +#endif diff --git a/src/groups/mqb/mqbnet/mqbnet_authenticator.cpp b/src/groups/mqb/mqbnet/mqbnet_authenticator.cpp new file mode 100644 index 0000000000..dab11f8336 --- /dev/null +++ b/src/groups/mqb/mqbnet/mqbnet_authenticator.cpp @@ -0,0 +1,34 @@ +// Copyright 2025 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// mqbnet_authenticator.cpp -*-C++-*- +#include + +#include + +namespace BloombergLP { +namespace mqbnet { + +// ---------------- +// class Authenticator +// ---------------- + +Authenticator::~Authenticator() +{ + // NOTHING: Pure interface +} + +} // close package namespace +} // close enterprise namespace diff --git a/src/groups/mqb/mqbnet/mqbnet_authenticator.h b/src/groups/mqb/mqbnet/mqbnet_authenticator.h new file mode 100644 index 0000000000..d423a93180 --- /dev/null +++ b/src/groups/mqb/mqbnet/mqbnet_authenticator.h @@ -0,0 +1,64 @@ +// Copyright 2025 Bloomberg Finance L.P. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// mqbnet_authenticator.h -*-C++-*- +#ifndef INCLUDED_MQBNET_AUTHENTICATOR +#define INCLUDED_MQBNET_AUTHENTICATOR + +//@PURPOSE: +// +//@CLASSES: +// +//@DESCRIPTION: + +// MQB +#include + +// BDE +#include + +namespace BloombergLP { + +namespace mqbnet { + +// ================ +// class Authenticator +// ================ + +/// Protocol for an Authenticator +class Authenticator { + public: + // CREATORS + + /// Destructor + virtual ~Authenticator(); + + // MANIPULATORS + + virtual int handleAuthenticationOnMsgType( + bsl::ostream& errorDescription, + bool* isContinueRead, + const bsl::shared_ptr& context) = 0; + + /// Send out outbound authentication message or reverse connection request + /// with the specified `context`. + virtual int authenticationOutboundOrReverse( + const bsl::shared_ptr& context) = 0; +}; + +} // close package namespace +} // close enterprise namespace + +#endif diff --git a/src/groups/mqb/mqbnet/mqbnet_channel.cpp b/src/groups/mqb/mqbnet/mqbnet_channel.cpp index 412b9ecc62..5c5d20a89c 100644 --- a/src/groups/mqb/mqbnet/mqbnet_channel.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_channel.cpp @@ -455,6 +455,7 @@ Channel::writeBufferedItem(bool* isConsumed, case bmqp::EventType::e_HEARTBEAT_REQ: case bmqp::EventType::e_HEARTBEAT_RSP: case bmqp::EventType::e_REPLICATION_RECEIPT: + case bmqp::EventType::e_AUTHENTICATION: default: { ControlArgs x(item); rc = writeImmediate(isConsumed, diff --git a/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.cpp b/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.cpp index b520d6212f..8d243e7abc 100644 --- a/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.cpp @@ -60,6 +60,13 @@ InitialConnectionContext::setInitialConnectionCompleteCb( return *this; } +InitialConnectionContext& InitialConnectionContext::setAuthenticationContext( + const bsl::shared_ptr& value) +{ + d_authenticationCtxSp = value; + return *this; +} + InitialConnectionContext& InitialConnectionContext::setNegotiationContext( const bsl::shared_ptr& value) { @@ -94,6 +101,12 @@ InitialConnectionContext::initialConnectionCompleteCb() const return d_initialConnectionCompleteCb; } +const bsl::shared_ptr& +InitialConnectionContext::authenticationContext() const +{ + return d_authenticationCtxSp; +} + const bsl::shared_ptr& InitialConnectionContext::negotiationContext() const { diff --git a/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.h b/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.h index 10ce1a862e..be0a1dacd8 100644 --- a/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.h +++ b/src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.h @@ -45,8 +45,25 @@ namespace mqbnet { class SessionEventProcessor; class Cluster; class Session; +struct AuthenticationContext; struct NegotiationContext; +// ===================== +// struct ConnectionType +// ===================== + +struct ConnectionType { + // Enum representing the type of session being connected, from that + // side of the connection's point of view. + enum Enum { + e_UNKNOWN, + e_CLUSTER_PROXY, // Reverse connection proxy -> broker + e_CLUSTER_MEMBER, // Cluster node -> cluster node + e_CLIENT, // Either SDK or Proxy -> Proxy or cluster node + e_ADMIN + }; +}; + // ============================== // class InitialConnectionContext // ============================== @@ -113,6 +130,10 @@ class InitialConnectionContext { /// connection. InitialConnectionCompleteCb d_initialConnectionCompleteCb; + /// The AuthenticationContext updated upon receiving an + /// authentication message. + bsl::shared_ptr d_authenticationCtxSp; + /// The NegotiationContext updated upon receiving a negotiation message. bsl::shared_ptr d_negotiationCtxSp; @@ -132,6 +153,8 @@ class InitialConnectionContext { setChannel(const bsl::shared_ptr& value); InitialConnectionContext& setInitialConnectionCompleteCb(const InitialConnectionCompleteCb& value); + InitialConnectionContext& setAuthenticationContext( + const bsl::shared_ptr& value); InitialConnectionContext& setNegotiationContext(const bsl::shared_ptr& value); @@ -143,6 +166,8 @@ class InitialConnectionContext { void* resultState() const; const bsl::shared_ptr& channel() const; const InitialConnectionCompleteCb& initialConnectionCompleteCb() const; + const bsl::shared_ptr& + authenticationContext() const; const bsl::shared_ptr& negotiationContext() const; }; diff --git a/src/groups/mqb/mqbnet/mqbnet_negotiationcontext.h b/src/groups/mqb/mqbnet/mqbnet_negotiationcontext.h index ae1794a123..19d8b87b47 100644 --- a/src/groups/mqb/mqbnet/mqbnet_negotiationcontext.h +++ b/src/groups/mqb/mqbnet/mqbnet_negotiationcontext.h @@ -32,18 +32,6 @@ namespace BloombergLP { namespace mqbnet { -struct ConnectionType { - // Enum representing the type of session being negotiated, from that - // side of the connection's point of view. - enum Enum { - e_UNKNOWN, - e_CLUSTER_PROXY, // Reverse connection proxy -> broker - e_CLUSTER_MEMBER, // Cluster node -> cluster node - e_CLIENT, // Either SDK or Proxy -> Proxy or cluster node - e_ADMIN - }; -}; - // ======================== // class NegotiationContext // ======================== diff --git a/src/groups/mqb/mqbnet/package/mqbnet.mem b/src/groups/mqb/mqbnet/package/mqbnet.mem index 9a179f13b3..540455cdd1 100644 --- a/src/groups/mqb/mqbnet/package/mqbnet.mem +++ b/src/groups/mqb/mqbnet/package/mqbnet.mem @@ -1,3 +1,4 @@ +mqbnet_authenticator mqbnet_channel mqbnet_cluster mqbnet_clusteractivenodemanager