From d324416721e9c5eae333ed9a4a4decd34737352c Mon Sep 17 00:00:00 2001 From: Melvin He Date: Thu, 4 Apr 2024 07:54:27 -0400 Subject: [PATCH 01/21] Fix: data type consistency and Wconv catch (#238) Signed-off-by: Melvin He --- src/groups/mwc/mwcc/mwcc_array.t.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/groups/mwc/mwcc/mwcc_array.t.cpp b/src/groups/mwc/mwcc/mwcc_array.t.cpp index b7dd3a63e1..72ec8c991d 100644 --- a/src/groups/mwc/mwcc/mwcc_array.t.cpp +++ b/src/groups/mwc/mwcc/mwcc_array.t.cpp @@ -397,11 +397,11 @@ static void test1_breathingTest() ObjType obj1(s_allocator_p); ObjType obj2(s_allocator_p); - for (size_t i = 0; i < 50; ++i) { + for (int i = 0; i < 50; ++i) { obj1.push_back(TestType("a", s_allocator_p)); } - for (size_t i = 0; i < 100; ++i) { + for (int i = 0; i < 100; ++i) { obj2.push_back(TestType("b", s_allocator_p)); } @@ -416,11 +416,11 @@ static void test1_breathingTest() ObjType obj1(s_allocator_p); ObjType obj2(s_allocator_p); - for (size_t i = 0; i < 50; ++i) { + for (int i = 0; i < 50; ++i) { obj1.push_back(TestType("a", s_allocator_p)); } - for (size_t i = 0; i < 100; ++i) { + for (int i = 0; i < 100; ++i) { obj2.push_back(TestType("b", s_allocator_p)); } @@ -434,7 +434,7 @@ static void test1_breathingTest() { ObjType* obj = new (*s_allocator_p) ObjType(s_allocator_p); - for (size_t i = 0; i < 50; ++i) { + for (int i = 0; i < 50; ++i) { obj->push_back(TestType("a", s_allocator_p)); } @@ -629,12 +629,12 @@ static void test6_assign() bslma::TestAllocator ta("testAlloc"); ObjType obj(&ta); - for (size_t i = 0; i < k_STATIC_LEN + 5; ++i) { + for (int i = 0; i < k_STATIC_LEN + 5; ++i) { obj.push_back(TestType(i, s_allocator_p)); } bsl::vector srcVec(s_allocator_p); - for (size_t i = 0; i < 2 * k_STATIC_LEN; ++i) { + for (int i = 0; i < 2 * k_STATIC_LEN; ++i) { srcVec.push_back(TestType(10 * i, s_allocator_p)); } From c8edbcf64aee2a1b7ee5b5309ab33d864fb3a761 Mon Sep 17 00:00:00 2001 From: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com> Date: Sat, 6 Apr 2024 09:10:05 -0400 Subject: [PATCH 02/21] protect ClientSession::initiateShutdownDispatched (#239) Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com> --- src/groups/mqb/mqba/mqba_clientsession.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/groups/mqb/mqba/mqba_clientsession.cpp b/src/groups/mqb/mqba/mqba_clientsession.cpp index f09d34ab63..dad5741bf1 100644 --- a/src/groups/mqb/mqba/mqba_clientsession.cpp +++ b/src/groups/mqb/mqba/mqba_clientsession.cpp @@ -2811,10 +2811,11 @@ void ClientSession::initiateShutdown(const ShutdownCb& callback, BALL_LOG_INFO << description() << ": initiateShutdown"; dispatcher()->execute( - bdlf::BindUtil::bind(&ClientSession::initiateShutdownDispatched, - this, - callback, - timeout), + bdlf::BindUtil::bind( + bdlf::MemFnUtil::memFn(&ClientSession::initiateShutdownDispatched, + d_self.acquire()), + callback, + timeout), this, mqbi::DispatcherEventType::e_DISPATCHER); // Use 'mqbi::DispatcherEventType::e_DISPATCHER' to avoid (re)enabling From 18b9adcb418b9dac4a9c94a77c8c7fde19b6b525 Mon Sep 17 00:00:00 2001 From: Stanislav Yuzvinsky <152279698+syuzvinsky@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:53:04 +0300 Subject: [PATCH 03/21] Wait ACKs for all messages posted by bmqtool (#231) Instead of waiting for Ctrl+C in auto-posting mode, bmqtool will be counting ACKs and terminate after all posted messages are acknowledged. Signed-off-by: Stanislav Yuzvinsky --- src/applications/bmqtool/bmqtoolcmd.xsd | 2 +- .../bmqtool/m_bmqtool_application.cpp | 23 +- .../bmqtool/m_bmqtool_application.h | 13 + .../bmqtool/m_bmqtool_messages.cpp | 246 +- src/applications/bmqtool/m_bmqtool_messages.h | 8965 ++++++++--------- .../bmqtool/m_bmqtool_parameters.h | 20 +- 6 files changed, 4284 insertions(+), 4985 deletions(-) diff --git a/src/applications/bmqtool/bmqtoolcmd.xsd b/src/applications/bmqtool/bmqtoolcmd.xsd index cc721aa67b..9a888358dd 100644 --- a/src/applications/bmqtool/bmqtoolcmd.xsd +++ b/src/applications/bmqtool/bmqtoolcmd.xsd @@ -206,7 +206,7 @@ - + diff --git a/src/applications/bmqtool/m_bmqtool_application.cpp b/src/applications/bmqtool/m_bmqtool_application.cpp index 4caa063c63..842139ed00 100644 --- a/src/applications/bmqtool/m_bmqtool_application.cpp +++ b/src/applications/bmqtool/m_bmqtool_application.cpp @@ -768,6 +768,12 @@ void Application::onMessageEvent(const bmqa::MessageEvent& event) // Write to log file d_fileLogger.writeAckMessage(message); + + if (d_numExpectedAcks != 0 && + d_numExpectedAcks == ++d_numAcknowledged) { + BALL_LOG_INFO << "All posted messages have been acknowledged"; + d_shutdownSemaphore_p->post(); + } } else { // Message is a push message @@ -931,7 +937,7 @@ void Application::producerThread() } eventBuilder.reset(); - for (int msgId = 0; msgId < d_parameters_p->eventSize(); + for (bsl::uint64_t msgId = 0; msgId < d_parameters_p->eventSize(); ++msgId, ++msgSeqId) { bmqa::Message& msg = eventBuilder.startMessage(); int length = 0; @@ -1046,12 +1052,7 @@ void Application::producerThread() } } - // Finished posting messages in auto mode? - // If shutDownGrace is set, signal to the main thread to exit. - if (d_parameters_p->mode() == ParametersMode::e_AUTO && - d_parameters_p->shutdownGrace() != 0) { - // We do not need to sleep the grace period, since it is done - // by the main thread, in the stop() function. + if (!bmqt::QueueFlagsUtil::isAck(d_parameters_p->queueFlags())) { d_shutdownSemaphore_p->post(); } } @@ -1131,6 +1132,8 @@ Application::Application(Parameters* parameters, , d_latencies(allocator) , d_autoReadInProgress(false) , d_autoReadActivity(false) +, d_numExpectedAcks(0) +, d_numAcknowledged(0) { // NOTHING } @@ -1194,8 +1197,12 @@ int Application::run() d_shutdownSemaphore_p->post(); } else { - // Start the thread if (bmqt::QueueFlagsUtil::isWriter(d_parameters_p->queueFlags())) { + d_numExpectedAcks = d_parameters_p->eventsCount() * + d_parameters_p->eventSize(); + d_numAcknowledged = 0; + + // Start the thread rc = bslmt::ThreadUtil::create( &d_runningThread, bdlf::MemFnUtil::memFn(&Application::producerThread, this)); diff --git a/src/applications/bmqtool/m_bmqtool_application.h b/src/applications/bmqtool/m_bmqtool_application.h index a0416d1e9b..85eb0a36bc 100644 --- a/src/applications/bmqtool/m_bmqtool_application.h +++ b/src/applications/bmqtool/m_bmqtool_application.h @@ -167,6 +167,19 @@ class Application : public bmqa::SessionEventHandler { // message was seen during the current // grace period. + bsl::uint64_t d_numExpectedAcks; + // Auto-produce mode only. The total number of messages + // the tool will send. After posting is finished + // the tool will be waiting for this number of ACK + // messages, after which the shutdown semaphore will + // be posted. + + bsl::uint64_t d_numAcknowledged; + // Auto-produce mode only. The number of acknowledged + // messages. When the value of this field becomes equal + // to d_numExpectedAcks, the shutdown semaphore will be + // posted. + // PRIVATE MANIPULATORS // (virtual: bmqa::SessionEventHandler) diff --git a/src/applications/bmqtool/m_bmqtool_messages.cpp b/src/applications/bmqtool/m_bmqtool_messages.cpp index 593556d23a..5829bfadd1 100644 --- a/src/applications/bmqtool/m_bmqtool_messages.cpp +++ b/src/applications/bmqtool/m_bmqtool_messages.cpp @@ -30,9 +30,11 @@ #include #include +#include #include #include #include +#include namespace BloombergLP { namespace m_bmqtool { @@ -194,49 +196,16 @@ const bdlat_AttributeInfo* CloseStorageCommand::lookupAttributeInfo(int id) // CREATORS -CloseStorageCommand::CloseStorageCommand() -{ -} - -CloseStorageCommand::CloseStorageCommand(const CloseStorageCommand& original) -{ - (void)original; -} - -CloseStorageCommand::~CloseStorageCommand() -{ -} - // MANIPULATORS -CloseStorageCommand& -CloseStorageCommand::operator=(const CloseStorageCommand& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -CloseStorageCommand& CloseStorageCommand::operator=(CloseStorageCommand&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void CloseStorageCommand::reset() { } // ACCESSORS -bsl::ostream& CloseStorageCommand::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& CloseStorageCommand::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1296,48 +1265,16 @@ const bdlat_AttributeInfo* ListQueuesCommand::lookupAttributeInfo(int id) // CREATORS -ListQueuesCommand::ListQueuesCommand() -{ -} - -ListQueuesCommand::ListQueuesCommand(const ListQueuesCommand& original) -{ - (void)original; -} - -ListQueuesCommand::~ListQueuesCommand() -{ -} - // MANIPULATORS -ListQueuesCommand& ListQueuesCommand::operator=(const ListQueuesCommand& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -ListQueuesCommand& ListQueuesCommand::operator=(ListQueuesCommand&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void ListQueuesCommand::reset() { } // ACCESSORS -bsl::ostream& ListQueuesCommand::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& ListQueuesCommand::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -1428,48 +1365,16 @@ const bdlat_AttributeInfo* MetadataCommand::lookupAttributeInfo(int id) // CREATORS -MetadataCommand::MetadataCommand() -{ -} - -MetadataCommand::MetadataCommand(const MetadataCommand& original) -{ - (void)original; -} - -MetadataCommand::~MetadataCommand() -{ -} - // MANIPULATORS -MetadataCommand& MetadataCommand::operator=(const MetadataCommand& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -MetadataCommand& MetadataCommand::operator=(MetadataCommand&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void MetadataCommand::reset() { } // ACCESSORS -bsl::ostream& MetadataCommand::print(bsl::ostream& stream, - int level, - int spacesPerLevel) const +bsl::ostream& MetadataCommand::print(bsl::ostream& stream, int, int) const { - (void)level; - (void)spacesPerLevel; return stream; } @@ -2225,38 +2130,8 @@ StartCommand::StartCommand() { } -StartCommand::StartCommand(const StartCommand& original) -: d_async(original.d_async) -{ -} - -StartCommand::~StartCommand() -{ -} - // MANIPULATORS -StartCommand& StartCommand::operator=(const StartCommand& rhs) -{ - if (this != &rhs) { - d_async = rhs.d_async; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -StartCommand& StartCommand::operator=(StartCommand&& rhs) -{ - if (this != &rhs) { - d_async = bsl::move(rhs.d_async); - } - - return *this; -} -#endif - void StartCommand::reset() { d_async = DEFAULT_INITIALIZER_ASYNC; @@ -2325,38 +2200,8 @@ StopCommand::StopCommand() { } -StopCommand::StopCommand(const StopCommand& original) -: d_async(original.d_async) -{ -} - -StopCommand::~StopCommand() -{ -} - // MANIPULATORS -StopCommand& StopCommand::operator=(const StopCommand& rhs) -{ - if (this != &rhs) { - d_async = rhs.d_async; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -StopCommand& StopCommand::operator=(StopCommand&& rhs) -{ - if (this != &rhs) { - d_async = bsl::move(rhs.d_async); - } - - return *this; -} -#endif - void StopCommand::reset() { d_async = DEFAULT_INITIALIZER_ASYNC; @@ -2832,38 +2677,8 @@ DataCommand::DataCommand() { } -DataCommand::DataCommand(const DataCommand& original) -: d_choice(original.d_choice) -{ -} - -DataCommand::~DataCommand() -{ -} - // MANIPULATORS -DataCommand& DataCommand::operator=(const DataCommand& rhs) -{ - if (this != &rhs) { - d_choice = rhs.d_choice; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -DataCommand& DataCommand::operator=(DataCommand&& rhs) -{ - if (this != &rhs) { - d_choice = bsl::move(rhs.d_choice); - } - - return *this; -} -#endif - void DataCommand::reset() { bdlat_ValueTypeFunctions::reset(&d_choice); @@ -4101,38 +3916,8 @@ QlistCommand::QlistCommand() { } -QlistCommand::QlistCommand(const QlistCommand& original) -: d_choice(original.d_choice) -{ -} - -QlistCommand::~QlistCommand() -{ -} - // MANIPULATORS -QlistCommand& QlistCommand::operator=(const QlistCommand& rhs) -{ - if (this != &rhs) { - d_choice = rhs.d_choice; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -QlistCommand& QlistCommand::operator=(QlistCommand&& rhs) -{ - if (this != &rhs) { - d_choice = bsl::move(rhs.d_choice); - } - - return *this; -} -#endif - void QlistCommand::reset() { bdlat_ValueTypeFunctions::reset(&d_choice); @@ -4175,7 +3960,8 @@ const bool CommandLineParameters::DEFAULT_INITIALIZER_DUMP_MSG = false; const bool CommandLineParameters::DEFAULT_INITIALIZER_CONFIRM_MSG = false; -const int CommandLineParameters::DEFAULT_INITIALIZER_EVENT_SIZE = 1; +const bsls::Types::Int64 + CommandLineParameters::DEFAULT_INITIALIZER_EVENT_SIZE = 1; const int CommandLineParameters::DEFAULT_INITIALIZER_MSG_SIZE = 1024; @@ -4415,7 +4201,8 @@ const bdlat_AttributeInfo* CommandLineParameters::lookupAttributeInfo(int id) // CREATORS CommandLineParameters::CommandLineParameters(bslma::Allocator* basicAllocator) -: d_subscriptions(basicAllocator) +: d_eventSize(DEFAULT_INITIALIZER_EVENT_SIZE) +, d_subscriptions(basicAllocator) , d_messageProperties(basicAllocator) , d_mode(DEFAULT_INITIALIZER_MODE, basicAllocator) , d_broker(DEFAULT_INITIALIZER_BROKER, basicAllocator) @@ -4431,7 +4218,6 @@ CommandLineParameters::CommandLineParameters(bslma::Allocator* basicAllocator) , d_log(DEFAULT_INITIALIZER_LOG, basicAllocator) , d_sequentialMessagePattern(DEFAULT_INITIALIZER_SEQUENTIAL_MESSAGE_PATTERN, basicAllocator) -, d_eventSize(DEFAULT_INITIALIZER_EVENT_SIZE) , d_msgSize(DEFAULT_INITIALIZER_MSG_SIZE) , d_postRate(DEFAULT_INITIALIZER_POST_RATE) , d_postInterval(DEFAULT_INITIALIZER_POST_INTERVAL) @@ -4447,7 +4233,8 @@ CommandLineParameters::CommandLineParameters(bslma::Allocator* basicAllocator) CommandLineParameters::CommandLineParameters( const CommandLineParameters& original, bslma::Allocator* basicAllocator) -: d_subscriptions(original.d_subscriptions, basicAllocator) +: d_eventSize(original.d_eventSize) +, d_subscriptions(original.d_subscriptions, basicAllocator) , d_messageProperties(original.d_messageProperties, basicAllocator) , d_mode(original.d_mode, basicAllocator) , d_broker(original.d_broker, basicAllocator) @@ -4463,7 +4250,6 @@ CommandLineParameters::CommandLineParameters( , d_log(original.d_log, basicAllocator) , d_sequentialMessagePattern(original.d_sequentialMessagePattern, basicAllocator) -, d_eventSize(original.d_eventSize) , d_msgSize(original.d_msgSize) , d_postRate(original.d_postRate) , d_postInterval(original.d_postInterval) @@ -4480,7 +4266,8 @@ CommandLineParameters::CommandLineParameters( defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) CommandLineParameters::CommandLineParameters( CommandLineParameters&& original) noexcept -: d_subscriptions(bsl::move(original.d_subscriptions)), +: d_eventSize(bsl::move(original.d_eventSize)), + d_subscriptions(bsl::move(original.d_subscriptions)), d_messageProperties(bsl::move(original.d_messageProperties)), d_mode(bsl::move(original.d_mode)), d_broker(bsl::move(original.d_broker)), @@ -4495,7 +4282,6 @@ CommandLineParameters::CommandLineParameters( d_storage(bsl::move(original.d_storage)), d_log(bsl::move(original.d_log)), d_sequentialMessagePattern(bsl::move(original.d_sequentialMessagePattern)), - d_eventSize(bsl::move(original.d_eventSize)), d_msgSize(bsl::move(original.d_msgSize)), d_postRate(bsl::move(original.d_postRate)), d_postInterval(bsl::move(original.d_postInterval)), @@ -4510,7 +4296,8 @@ CommandLineParameters::CommandLineParameters( CommandLineParameters::CommandLineParameters(CommandLineParameters&& original, bslma::Allocator* basicAllocator) -: d_subscriptions(bsl::move(original.d_subscriptions), basicAllocator) +: d_eventSize(bsl::move(original.d_eventSize)) +, d_subscriptions(bsl::move(original.d_subscriptions), basicAllocator) , d_messageProperties(bsl::move(original.d_messageProperties), basicAllocator) , d_mode(bsl::move(original.d_mode), basicAllocator) , d_broker(bsl::move(original.d_broker), basicAllocator) @@ -4526,7 +4313,6 @@ CommandLineParameters::CommandLineParameters(CommandLineParameters&& original, , d_log(bsl::move(original.d_log), basicAllocator) , d_sequentialMessagePattern(bsl::move(original.d_sequentialMessagePattern), basicAllocator) -, d_eventSize(bsl::move(original.d_eventSize)) , d_msgSize(bsl::move(original.d_msgSize)) , d_postRate(bsl::move(original.d_postRate)) , d_postInterval(bsl::move(original.d_postInterval)) @@ -6504,6 +6290,6 @@ const char* Command::selectionName() const } // close package namespace } // close enterprise namespace -// GENERATED BY @BLP_BAS_CODEGEN_VERSION@ +// GENERATED BY BLP_BAS_CODEGEN_2024.03.30 // USING bas_codegen.pl -m msg --noAggregateConversion --noExternalization // --noIdent --package m_bmqtool --msgComponent messages bmqtoolcmd.xsd diff --git a/src/applications/bmqtool/m_bmqtool_messages.h b/src/applications/bmqtool/m_bmqtool_messages.h index 1a7d50ae76..b50855fe25 100644 --- a/src/applications/bmqtool/m_bmqtool_messages.h +++ b/src/applications/bmqtool/m_bmqtool_messages.h @@ -153,185 +153,191 @@ class CloseQueueCommand { 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 `CloseQueueCommand` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit CloseQueueCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'CloseQueueCommand' 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 `CloseQueueCommand` 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. CloseQueueCommand(const CloseQueueCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'CloseQueueCommand' 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 `CloseQueueCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. CloseQueueCommand(CloseQueueCommand&& original) noexcept; + // Create an object of type 'CloseQueueCommand' 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 `CloseQueueCommand` 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. CloseQueueCommand(CloseQueueCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'CloseQueueCommand' 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. ~CloseQueueCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. CloseQueueCommand& operator=(const CloseQueueCommand& 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. CloseQueueCommand& operator=(CloseQueueCommand&& 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 "Async" attribute of this - /// object. bool& async(); + // Return a reference to the modifiable "Async" 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 "Async" attribute of this - /// object. bool async() const; + // Return the value of the "Async" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const CloseQueueCommand& lhs, + const CloseQueueCommand& 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.uri() == rhs.uri() && lhs.async() == rhs.async(); + } + + friend bool operator!=(const CloseQueueCommand& lhs, + const CloseQueueCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const CloseQueueCommand& 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 CloseQueueCommand& 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 + // 'CloseQueueCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.uri()); + hashAppend(hashAlg, object.async()); + } }; -// 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 CloseQueueCommand& lhs, - const CloseQueueCommand& 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 CloseQueueCommand& lhs, - const CloseQueueCommand& 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 CloseQueueCommand& 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 `CloseQueueCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::CloseQueueCommand& object); - } // close package namespace // TRAITS @@ -357,156 +363,129 @@ class CloseStorageCommand { 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 `CloseStorageCommand` having the default - /// value. - CloseStorageCommand(); - - /// Create an object of type `CloseStorageCommand` having the value of - /// the specified `original` object. - CloseStorageCommand(const CloseStorageCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `CloseStorageCommand` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - CloseStorageCommand(CloseStorageCommand&& original) = default; -#endif - - /// Destroy this object. - ~CloseStorageCommand(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - CloseStorageCommand& operator=(const CloseStorageCommand& 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. - CloseStorageCommand& operator=(CloseStorageCommand&& 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 CloseStorageCommand&, + const CloseStorageCommand&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const CloseStorageCommand& lhs, + const CloseStorageCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const CloseStorageCommand& 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 CloseStorageCommand&) + // 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 + // 'CloseStorageCommand'. + { + } }; -// 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 CloseStorageCommand& lhs, - const CloseStorageCommand& 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 CloseStorageCommand& lhs, - const CloseStorageCommand& 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 CloseStorageCommand& 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 `CloseStorageCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::CloseStorageCommand& object); - } // close package namespace // TRAITS @@ -539,183 +518,192 @@ class ConfirmCommand { 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 `ConfirmCommand` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit ConfirmCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfirmCommand' 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 `ConfirmCommand` 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. ConfirmCommand(const ConfirmCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfirmCommand' 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 `ConfirmCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ConfirmCommand(ConfirmCommand&& original) noexcept; + // Create an object of type 'ConfirmCommand' 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 `ConfirmCommand` 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. ConfirmCommand(ConfirmCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ConfirmCommand' 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. ~ConfirmCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ConfirmCommand& operator=(const ConfirmCommand& 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. ConfirmCommand& operator=(ConfirmCommand&& 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 "Guid" attribute of this - /// object. bsl::string& guid(); + // Return a reference to the modifiable "Guid" 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 "Guid" attribute of this - /// object. const bsl::string& guid() const; + // Return a reference offering non-modifiable access to the "Guid" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ConfirmCommand& lhs, + const ConfirmCommand& 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.uri() == rhs.uri() && lhs.guid() == rhs.guid(); + } + + friend bool operator!=(const ConfirmCommand& lhs, + const ConfirmCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConfirmCommand& 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 ConfirmCommand& 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 + // 'ConfirmCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.uri()); + hashAppend(hashAlg, object.guid()); + } }; -// 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 ConfirmCommand& lhs, const ConfirmCommand& 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 ConfirmCommand& lhs, const ConfirmCommand& 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 ConfirmCommand& 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 `ConfirmCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::ConfirmCommand& object); - } // close package namespace // TRAITS @@ -744,6 +732,12 @@ class DataCommandChoice { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const DataCommandChoice& rhs) const; + public: // TYPES @@ -778,295 +772,304 @@ class DataCommandChoice { 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 `DataCommandChoice` having the default - /// value. DataCommandChoice(); + // Create an object of type 'DataCommandChoice' having the default + // value. - /// Create an object of type `DataCommandChoice` having the value of the - /// specified `original` object. DataCommandChoice(const DataCommandChoice& original); + // Create an object of type 'DataCommandChoice' 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 `DataCommandChoice` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. DataCommandChoice(DataCommandChoice&& original) noexcept; + // Create an object of type 'DataCommandChoice' 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. ~DataCommandChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. DataCommandChoice& operator=(const DataCommandChoice& 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. DataCommandChoice& operator=(DataCommandChoice&& 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). - /// Set the value of this object to be a "N" value. Optionally specify - /// the `value` of the "N". If `value` is not specified, the default - /// "N" value is used. bsls::Types::Uint64& makeN(); bsls::Types::Uint64& makeN(bsls::Types::Uint64 value); + // Set the value of this object to be a "N" value. Optionally specify + // the 'value' of the "N". If 'value' is not specified, the default + // "N" value is used. - /// Set the value of this object to be a "Next" value. Optionally - /// specify the `value` of the "Next". If `value` is not specified, the - /// default "Next" value is used. bsls::Types::Uint64& makeNext(); bsls::Types::Uint64& makeNext(bsls::Types::Uint64 value); + // Set the value of this object to be a "Next" value. Optionally + // specify the 'value' of the "Next". If 'value' is not specified, the + // default "Next" value is used. - /// Set the value of this object to be a "P" value. Optionally specify - /// the `value` of the "P". If `value` is not specified, the default - /// "P" value is used. bsls::Types::Uint64& makeP(); bsls::Types::Uint64& makeP(bsls::Types::Uint64 value); + // Set the value of this object to be a "P" value. Optionally specify + // the 'value' of the "P". If 'value' is not specified, the default + // "P" value is used. - /// Set the value of this object to be a "Prev" value. Optionally - /// specify the `value` of the "Prev". If `value` is not specified, the - /// default "Prev" value is used. bsls::Types::Uint64& makePrev(); bsls::Types::Uint64& makePrev(bsls::Types::Uint64 value); + // Set the value of this object to be a "Prev" value. Optionally + // specify the 'value' of the "Prev". If 'value' is not specified, the + // default "Prev" value is used. - /// Set the value of this object to be a "R" value. Optionally specify - /// the `value` of the "R". If `value` is not specified, the default - /// "R" value is used. bsls::Types::Uint64& makeR(); bsls::Types::Uint64& makeR(bsls::Types::Uint64 value); + // Set the value of this object to be a "R" value. Optionally specify + // the 'value' of the "R". If 'value' is not specified, the default + // "R" value is used. - /// Set the value of this object to be a "Record" value. Optionally - /// specify the `value` of the "Record". If `value` is not specified, - /// the default "Record" value is used. bsls::Types::Uint64& makeRecord(); bsls::Types::Uint64& makeRecord(bsls::Types::Uint64 value); + // Set the value of this object to be a "Record" value. Optionally + // specify the 'value' of the "Record". If 'value' is not specified, + // the default "Record" value is used. - /// Set the value of this object to be a "List" value. Optionally - /// specify the `value` of the "List". If `value` is not specified, the - /// default "List" value is used. int& makeList(); int& makeList(int value); + // Set the value of this object to be a "List" value. Optionally + // specify the 'value' of the "List". If 'value' is not specified, the + // default "List" value is used. - /// Set the value of this object to be a "L" value. Optionally specify - /// the `value` of the "L". If `value` is not specified, the default - /// "L" value is used. int& makeL(); int& makeL(int value); + // Set the value of this object to be a "L" value. Optionally specify + // the 'value' of the "L". If 'value' is not specified, the default + // "L" 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. - /// 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 "N" selection of this object if - /// "N" is the current selection. The behavior is undefined unless "N" - /// is the selection of this object. bsls::Types::Uint64& n(); + // Return a reference to the modifiable "N" selection of this object if + // "N" is the current selection. The behavior is undefined unless "N" + // is the selection of this object. - /// Return a reference to the modifiable "Next" selection of this object - /// if "Next" is the current selection. The behavior is undefined - /// unless "Next" is the selection of this object. bsls::Types::Uint64& next(); + // Return a reference to the modifiable "Next" selection of this object + // if "Next" is the current selection. The behavior is undefined + // unless "Next" is the selection of this object. - /// Return a reference to the modifiable "P" selection of this object if - /// "P" is the current selection. The behavior is undefined unless "P" - /// is the selection of this object. bsls::Types::Uint64& p(); + // Return a reference to the modifiable "P" selection of this object if + // "P" is the current selection. The behavior is undefined unless "P" + // is the selection of this object. - /// Return a reference to the modifiable "Prev" selection of this object - /// if "Prev" is the current selection. The behavior is undefined - /// unless "Prev" is the selection of this object. bsls::Types::Uint64& prev(); + // Return a reference to the modifiable "Prev" selection of this object + // if "Prev" is the current selection. The behavior is undefined + // unless "Prev" is the selection of this object. - /// Return a reference to the modifiable "R" selection of this object if - /// "R" is the current selection. The behavior is undefined unless "R" - /// is the selection of this object. bsls::Types::Uint64& r(); + // Return a reference to the modifiable "R" selection of this object if + // "R" is the current selection. The behavior is undefined unless "R" + // is the selection of this object. - /// Return a reference to the modifiable "Record" selection of this - /// object if "Record" is the current selection. The behavior is - /// undefined unless "Record" is the selection of this object. bsls::Types::Uint64& record(); + // Return a reference to the modifiable "Record" selection of this + // object if "Record" is the current selection. The behavior is + // undefined unless "Record" is the selection of this object. - /// Return a reference to the modifiable "List" selection of this object - /// if "List" is the current selection. The behavior is undefined - /// unless "List" is the selection of this object. int& list(); + // Return a reference to the modifiable "List" selection of this object + // if "List" is the current selection. The behavior is undefined + // unless "List" is the selection of this object. - /// Return a reference to the modifiable "L" selection of this object if - /// "L" is the current selection. The behavior is undefined unless "L" - /// is the selection of this object. int& l(); + // Return a reference to the modifiable "L" selection of this object if + // "L" is the current selection. The behavior is undefined unless "L" + // 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 "N" selection of this - /// object if "N" is the current selection. The behavior is undefined - /// unless "N" is the selection of this object. const bsls::Types::Uint64& n() const; + // Return a reference to the non-modifiable "N" selection of this + // object if "N" is the current selection. The behavior is undefined + // unless "N" is the selection of this object. - /// Return a reference to the non-modifiable "Next" selection of this - /// object if "Next" is the current selection. The behavior is - /// undefined unless "Next" is the selection of this object. const bsls::Types::Uint64& next() const; + // Return a reference to the non-modifiable "Next" selection of this + // object if "Next" is the current selection. The behavior is + // undefined unless "Next" is the selection of this object. - /// Return a reference to the non-modifiable "P" selection of this - /// object if "P" is the current selection. The behavior is undefined - /// unless "P" is the selection of this object. const bsls::Types::Uint64& p() const; + // Return a reference to the non-modifiable "P" selection of this + // object if "P" is the current selection. The behavior is undefined + // unless "P" is the selection of this object. - /// Return a reference to the non-modifiable "Prev" selection of this - /// object if "Prev" is the current selection. The behavior is - /// undefined unless "Prev" is the selection of this object. const bsls::Types::Uint64& prev() const; + // Return a reference to the non-modifiable "Prev" selection of this + // object if "Prev" is the current selection. The behavior is + // undefined unless "Prev" is the selection of this object. - /// Return a reference to the non-modifiable "R" selection of this - /// object if "R" is the current selection. The behavior is undefined - /// unless "R" is the selection of this object. const bsls::Types::Uint64& r() const; + // Return a reference to the non-modifiable "R" selection of this + // object if "R" is the current selection. The behavior is undefined + // unless "R" is the selection of this object. - /// Return a reference to the non-modifiable "Record" selection of this - /// object if "Record" is the current selection. The behavior is - /// undefined unless "Record" is the selection of this object. const bsls::Types::Uint64& record() const; + // Return a reference to the non-modifiable "Record" selection of this + // object if "Record" is the current selection. The behavior is + // undefined unless "Record" is the selection of this object. - /// Return a reference to the non-modifiable "List" selection of this - /// object if "List" is the current selection. The behavior is - /// undefined unless "List" is the selection of this object. const int& list() const; + // Return a reference to the non-modifiable "List" selection of this + // object if "List" is the current selection. The behavior is + // undefined unless "List" is the selection of this object. - /// Return a reference to the non-modifiable "L" selection of this - /// object if "L" is the current selection. The behavior is undefined - /// unless "L" is the selection of this object. const int& l() const; + // Return a reference to the non-modifiable "L" selection of this + // object if "L" is the current selection. The behavior is undefined + // unless "L" is the selection of this object. - /// Return `true` if the value of this object is a "N" value, and return - /// `false` otherwise. bool isNValue() const; + // Return 'true' if the value of this object is a "N" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Next" value, and - /// return `false` otherwise. bool isNextValue() const; + // Return 'true' if the value of this object is a "Next" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "P" value, and return - /// `false` otherwise. bool isPValue() const; + // Return 'true' if the value of this object is a "P" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Prev" value, and - /// return `false` otherwise. bool isPrevValue() const; + // Return 'true' if the value of this object is a "Prev" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "R" value, and return - /// `false` otherwise. bool isRValue() const; + // Return 'true' if the value of this object is a "R" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Record" value, and - /// return `false` otherwise. bool isRecordValue() const; + // Return 'true' if the value of this object is a "Record" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "List" value, and - /// return `false` otherwise. bool isListValue() const; + // Return 'true' if the value of this object is a "List" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "L" value, and return - /// `false` otherwise. bool isLValue() const; + // Return 'true' if the value of this object is a "L" 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 DataCommandChoice& lhs, + const DataCommandChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'DataCommandChoice' 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 DataCommandChoice& lhs, + const DataCommandChoice& 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 DataCommandChoice& 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 DataCommandChoice& 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 + // 'DataCommandChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `DataCommandChoice` 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 DataCommandChoice& lhs, - const DataCommandChoice& 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 DataCommandChoice& lhs, - const DataCommandChoice& 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 DataCommandChoice& 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 `DataCommandChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::DataCommandChoice& object); - } // close package namespace // TRAITS @@ -1099,184 +1102,191 @@ class DumpQueueCommand { 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 `DumpQueueCommand` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit DumpQueueCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'DumpQueueCommand' 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 `DumpQueueCommand` 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. DumpQueueCommand(const DumpQueueCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'DumpQueueCommand' 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 `DumpQueueCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. DumpQueueCommand(DumpQueueCommand&& original) noexcept; + // Create an object of type 'DumpQueueCommand' 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 `DumpQueueCommand` 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. DumpQueueCommand(DumpQueueCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'DumpQueueCommand' 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. ~DumpQueueCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. DumpQueueCommand& operator=(const DumpQueueCommand& 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. DumpQueueCommand& operator=(DumpQueueCommand&& 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::string& key(); + // Return a reference to the modifiable "Key" 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::string& key() const; + // Return a reference offering non-modifiable access to the "Key" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const DumpQueueCommand& lhs, + const DumpQueueCommand& 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.uri() == rhs.uri() && lhs.key() == rhs.key(); + } + + friend bool operator!=(const DumpQueueCommand& lhs, + const DumpQueueCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DumpQueueCommand& 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 DumpQueueCommand& 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 + // 'DumpQueueCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.uri()); + hashAppend(hashAlg, object.key()); + } }; -// 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 DumpQueueCommand& lhs, - const DumpQueueCommand& 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 DumpQueueCommand& lhs, - const DumpQueueCommand& 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 DumpQueueCommand& 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 `DumpQueueCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::DumpQueueCommand& object); - } // close package namespace // TRAITS @@ -1303,41 +1313,41 @@ struct JournalCommandChoiceType { 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, - JournalCommandChoiceType::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 JournalCommandChoiceType::print(stream, rhs); + } +}; } // close package namespace @@ -1370,172 +1380,179 @@ class ListCommand { 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 `ListCommand` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit ListCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ListCommand' 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 `ListCommand` 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. ListCommand(const ListCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ListCommand' 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 `ListCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ListCommand(ListCommand&& original) noexcept; + // Create an object of type 'ListCommand' 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 `ListCommand` 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. ListCommand(ListCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ListCommand' 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. ~ListCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ListCommand& operator=(const ListCommand& 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. ListCommand& operator=(ListCommand&& 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. bdlb::NullableValue& uri(); + // Return a reference to the modifiable "Uri" 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 bdlb::NullableValue& uri() const; + // Return a reference offering non-modifiable access to the "Uri" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const ListCommand& lhs, const ListCommand& 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.uri() == rhs.uri(); + } + + friend bool operator!=(const ListCommand& lhs, const ListCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ListCommand& 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 ListCommand& 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 'ListCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.uri()); + } }; -// 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 ListCommand& lhs, const ListCommand& 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 ListCommand& lhs, const ListCommand& 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 ListCommand& 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 `ListCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::ListCommand& object); - } // close package namespace // TRAITS @@ -1561,156 +1578,128 @@ class ListQueuesCommand { 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 `ListQueuesCommand` having the default - /// value. - ListQueuesCommand(); - - /// Create an object of type `ListQueuesCommand` having the value of the - /// specified `original` object. - ListQueuesCommand(const ListQueuesCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `ListQueuesCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - ListQueuesCommand(ListQueuesCommand&& original) = default; -#endif - - /// Destroy this object. - ~ListQueuesCommand(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - ListQueuesCommand& operator=(const ListQueuesCommand& 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. - ListQueuesCommand& operator=(ListQueuesCommand&& 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 ListQueuesCommand&, const ListQueuesCommand&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const ListQueuesCommand& lhs, + const ListQueuesCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ListQueuesCommand& 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 ListQueuesCommand&) + // 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 + // 'ListQueuesCommand'. + { + } }; -// 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 ListQueuesCommand& lhs, - const ListQueuesCommand& 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 ListQueuesCommand& lhs, - const ListQueuesCommand& 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 ListQueuesCommand& 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 `ListQueuesCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::ListQueuesCommand& object); - } // close package namespace // TRAITS @@ -1723,8 +1712,9 @@ namespace m_bmqtool { // class MessagePropertyType // ========================= -/// Enumeration of supported MessageProperty types. struct MessagePropertyType { + // Enumeration of supported MessageProperty types. + public: // TYPES enum Value { E_STRING = 0, E_INT = 1 }; @@ -1737,41 +1727,41 @@ struct MessagePropertyType { 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, - MessagePropertyType::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 MessagePropertyType::print(stream, rhs); + } +}; } // close package namespace @@ -1797,153 +1787,128 @@ class MetadataCommand { 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 `MetadataCommand` having the default value. - MetadataCommand(); - - /// Create an object of type `MetadataCommand` having the value of the - /// specified `original` object. - MetadataCommand(const MetadataCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `MetadataCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - MetadataCommand(MetadataCommand&& original) = default; -#endif - - /// Destroy this object. - ~MetadataCommand(); - // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - MetadataCommand& operator=(const MetadataCommand& 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. - MetadataCommand& operator=(MetadataCommand&& 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 MetadataCommand&, const MetadataCommand&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const MetadataCommand& lhs, + const MetadataCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const MetadataCommand& 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 MetadataCommand&) + // 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 + // 'MetadataCommand'. + { + } }; -// 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 MetadataCommand& lhs, const MetadataCommand& 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 MetadataCommand& lhs, const MetadataCommand& 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 MetadataCommand& 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 `MetadataCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::MetadataCommand& object); - } // close package namespace // TRAITS @@ -1975,178 +1940,184 @@ class OpenStorageCommand { 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 `OpenStorageCommand` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit OpenStorageCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenStorageCommand' 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 `OpenStorageCommand` 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. OpenStorageCommand(const OpenStorageCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenStorageCommand' 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 `OpenStorageCommand` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. OpenStorageCommand(OpenStorageCommand&& original) noexcept; + // Create an object of type 'OpenStorageCommand' 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 `OpenStorageCommand` 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. OpenStorageCommand(OpenStorageCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'OpenStorageCommand' 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. ~OpenStorageCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. OpenStorageCommand& operator=(const OpenStorageCommand& 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. OpenStorageCommand& operator=(OpenStorageCommand&& 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 "Path" attribute of this - /// object. bsl::string& path(); + // Return a reference to the modifiable "Path" 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 "Path" attribute of this - /// object. const bsl::string& path() const; + // Return a reference offering non-modifiable access to the "Path" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const OpenStorageCommand& lhs, + const OpenStorageCommand& 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.path() == rhs.path(); + } + + friend bool operator!=(const OpenStorageCommand& lhs, + const OpenStorageCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const OpenStorageCommand& 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 OpenStorageCommand& 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 + // 'OpenStorageCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.path()); + } }; -// 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 OpenStorageCommand& lhs, - const OpenStorageCommand& 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 OpenStorageCommand& lhs, - const OpenStorageCommand& 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 OpenStorageCommand& 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 `OpenStorageCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::OpenStorageCommand& object); - } // close package namespace // TRAITS @@ -2175,6 +2146,12 @@ class QlistCommandChoice { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QlistCommandChoice& rhs) const; + public: // TYPES @@ -2209,295 +2186,304 @@ class QlistCommandChoice { 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 `QlistCommandChoice` having the default - /// value. QlistCommandChoice(); + // Create an object of type 'QlistCommandChoice' having the default + // value. - /// Create an object of type `QlistCommandChoice` having the value of - /// the specified `original` object. QlistCommandChoice(const QlistCommandChoice& original); + // Create an object of type 'QlistCommandChoice' 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 `QlistCommandChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. QlistCommandChoice(QlistCommandChoice&& original) noexcept; + // Create an object of type 'QlistCommandChoice' 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. ~QlistCommandChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. QlistCommandChoice& operator=(const QlistCommandChoice& 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. QlistCommandChoice& operator=(QlistCommandChoice&& 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). - /// Set the value of this object to be a "N" value. Optionally specify - /// the `value` of the "N". If `value` is not specified, the default - /// "N" value is used. bsls::Types::Uint64& makeN(); bsls::Types::Uint64& makeN(bsls::Types::Uint64 value); + // Set the value of this object to be a "N" value. Optionally specify + // the 'value' of the "N". If 'value' is not specified, the default + // "N" value is used. - /// Set the value of this object to be a "Next" value. Optionally - /// specify the `value` of the "Next". If `value` is not specified, the - /// default "Next" value is used. bsls::Types::Uint64& makeNext(); bsls::Types::Uint64& makeNext(bsls::Types::Uint64 value); + // Set the value of this object to be a "Next" value. Optionally + // specify the 'value' of the "Next". If 'value' is not specified, the + // default "Next" value is used. - /// Set the value of this object to be a "P" value. Optionally specify - /// the `value` of the "P". If `value` is not specified, the default - /// "P" value is used. bsls::Types::Uint64& makeP(); bsls::Types::Uint64& makeP(bsls::Types::Uint64 value); + // Set the value of this object to be a "P" value. Optionally specify + // the 'value' of the "P". If 'value' is not specified, the default + // "P" value is used. - /// Set the value of this object to be a "Prev" value. Optionally - /// specify the `value` of the "Prev". If `value` is not specified, the - /// default "Prev" value is used. bsls::Types::Uint64& makePrev(); bsls::Types::Uint64& makePrev(bsls::Types::Uint64 value); + // Set the value of this object to be a "Prev" value. Optionally + // specify the 'value' of the "Prev". If 'value' is not specified, the + // default "Prev" value is used. - /// Set the value of this object to be a "R" value. Optionally specify - /// the `value` of the "R". If `value` is not specified, the default - /// "R" value is used. bsls::Types::Uint64& makeR(); bsls::Types::Uint64& makeR(bsls::Types::Uint64 value); + // Set the value of this object to be a "R" value. Optionally specify + // the 'value' of the "R". If 'value' is not specified, the default + // "R" value is used. - /// Set the value of this object to be a "Record" value. Optionally - /// specify the `value` of the "Record". If `value` is not specified, - /// the default "Record" value is used. bsls::Types::Uint64& makeRecord(); bsls::Types::Uint64& makeRecord(bsls::Types::Uint64 value); + // Set the value of this object to be a "Record" value. Optionally + // specify the 'value' of the "Record". If 'value' is not specified, + // the default "Record" value is used. - /// Set the value of this object to be a "List" value. Optionally - /// specify the `value` of the "List". If `value` is not specified, the - /// default "List" value is used. int& makeList(); int& makeList(int value); + // Set the value of this object to be a "List" value. Optionally + // specify the 'value' of the "List". If 'value' is not specified, the + // default "List" value is used. - /// Set the value of this object to be a "L" value. Optionally specify - /// the `value` of the "L". If `value` is not specified, the default - /// "L" value is used. int& makeL(); int& makeL(int value); + // Set the value of this object to be a "L" value. Optionally specify + // the 'value' of the "L". If 'value' is not specified, the default + // "L" 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. - /// 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 "N" selection of this object if - /// "N" is the current selection. The behavior is undefined unless "N" - /// is the selection of this object. bsls::Types::Uint64& n(); + // Return a reference to the modifiable "N" selection of this object if + // "N" is the current selection. The behavior is undefined unless "N" + // is the selection of this object. - /// Return a reference to the modifiable "Next" selection of this object - /// if "Next" is the current selection. The behavior is undefined - /// unless "Next" is the selection of this object. bsls::Types::Uint64& next(); + // Return a reference to the modifiable "Next" selection of this object + // if "Next" is the current selection. The behavior is undefined + // unless "Next" is the selection of this object. - /// Return a reference to the modifiable "P" selection of this object if - /// "P" is the current selection. The behavior is undefined unless "P" - /// is the selection of this object. bsls::Types::Uint64& p(); + // Return a reference to the modifiable "P" selection of this object if + // "P" is the current selection. The behavior is undefined unless "P" + // is the selection of this object. - /// Return a reference to the modifiable "Prev" selection of this object - /// if "Prev" is the current selection. The behavior is undefined - /// unless "Prev" is the selection of this object. bsls::Types::Uint64& prev(); + // Return a reference to the modifiable "Prev" selection of this object + // if "Prev" is the current selection. The behavior is undefined + // unless "Prev" is the selection of this object. - /// Return a reference to the modifiable "R" selection of this object if - /// "R" is the current selection. The behavior is undefined unless "R" - /// is the selection of this object. bsls::Types::Uint64& r(); + // Return a reference to the modifiable "R" selection of this object if + // "R" is the current selection. The behavior is undefined unless "R" + // is the selection of this object. - /// Return a reference to the modifiable "Record" selection of this - /// object if "Record" is the current selection. The behavior is - /// undefined unless "Record" is the selection of this object. bsls::Types::Uint64& record(); + // Return a reference to the modifiable "Record" selection of this + // object if "Record" is the current selection. The behavior is + // undefined unless "Record" is the selection of this object. - /// Return a reference to the modifiable "List" selection of this object - /// if "List" is the current selection. The behavior is undefined - /// unless "List" is the selection of this object. int& list(); + // Return a reference to the modifiable "List" selection of this object + // if "List" is the current selection. The behavior is undefined + // unless "List" is the selection of this object. - /// Return a reference to the modifiable "L" selection of this object if - /// "L" is the current selection. The behavior is undefined unless "L" - /// is the selection of this object. int& l(); + // Return a reference to the modifiable "L" selection of this object if + // "L" is the current selection. The behavior is undefined unless "L" + // 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 "N" selection of this - /// object if "N" is the current selection. The behavior is undefined - /// unless "N" is the selection of this object. const bsls::Types::Uint64& n() const; + // Return a reference to the non-modifiable "N" selection of this + // object if "N" is the current selection. The behavior is undefined + // unless "N" is the selection of this object. - /// Return a reference to the non-modifiable "Next" selection of this - /// object if "Next" is the current selection. The behavior is - /// undefined unless "Next" is the selection of this object. const bsls::Types::Uint64& next() const; + // Return a reference to the non-modifiable "Next" selection of this + // object if "Next" is the current selection. The behavior is + // undefined unless "Next" is the selection of this object. - /// Return a reference to the non-modifiable "P" selection of this - /// object if "P" is the current selection. The behavior is undefined - /// unless "P" is the selection of this object. const bsls::Types::Uint64& p() const; + // Return a reference to the non-modifiable "P" selection of this + // object if "P" is the current selection. The behavior is undefined + // unless "P" is the selection of this object. - /// Return a reference to the non-modifiable "Prev" selection of this - /// object if "Prev" is the current selection. The behavior is - /// undefined unless "Prev" is the selection of this object. const bsls::Types::Uint64& prev() const; + // Return a reference to the non-modifiable "Prev" selection of this + // object if "Prev" is the current selection. The behavior is + // undefined unless "Prev" is the selection of this object. - /// Return a reference to the non-modifiable "R" selection of this - /// object if "R" is the current selection. The behavior is undefined - /// unless "R" is the selection of this object. const bsls::Types::Uint64& r() const; + // Return a reference to the non-modifiable "R" selection of this + // object if "R" is the current selection. The behavior is undefined + // unless "R" is the selection of this object. - /// Return a reference to the non-modifiable "Record" selection of this - /// object if "Record" is the current selection. The behavior is - /// undefined unless "Record" is the selection of this object. const bsls::Types::Uint64& record() const; + // Return a reference to the non-modifiable "Record" selection of this + // object if "Record" is the current selection. The behavior is + // undefined unless "Record" is the selection of this object. - /// Return a reference to the non-modifiable "List" selection of this - /// object if "List" is the current selection. The behavior is - /// undefined unless "List" is the selection of this object. const int& list() const; + // Return a reference to the non-modifiable "List" selection of this + // object if "List" is the current selection. The behavior is + // undefined unless "List" is the selection of this object. - /// Return a reference to the non-modifiable "L" selection of this - /// object if "L" is the current selection. The behavior is undefined - /// unless "L" is the selection of this object. const int& l() const; + // Return a reference to the non-modifiable "L" selection of this + // object if "L" is the current selection. The behavior is undefined + // unless "L" is the selection of this object. - /// Return `true` if the value of this object is a "N" value, and return - /// `false` otherwise. bool isNValue() const; + // Return 'true' if the value of this object is a "N" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Next" value, and - /// return `false` otherwise. bool isNextValue() const; + // Return 'true' if the value of this object is a "Next" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "P" value, and return - /// `false` otherwise. bool isPValue() const; + // Return 'true' if the value of this object is a "P" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Prev" value, and - /// return `false` otherwise. bool isPrevValue() const; + // Return 'true' if the value of this object is a "Prev" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "R" value, and return - /// `false` otherwise. bool isRValue() const; + // Return 'true' if the value of this object is a "R" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Record" value, and - /// return `false` otherwise. bool isRecordValue() const; + // Return 'true' if the value of this object is a "Record" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "List" value, and - /// return `false` otherwise. bool isListValue() const; + // Return 'true' if the value of this object is a "List" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "L" value, and return - /// `false` otherwise. bool isLValue() const; + // Return 'true' if the value of this object is a "L" 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 QlistCommandChoice& lhs, + const QlistCommandChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'QlistCommandChoice' 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 QlistCommandChoice& lhs, + const QlistCommandChoice& 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 QlistCommandChoice& 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 QlistCommandChoice& 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 + // 'QlistCommandChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `QlistCommandChoice` 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 QlistCommandChoice& lhs, - const QlistCommandChoice& 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 QlistCommandChoice& lhs, - const QlistCommandChoice& 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 QlistCommandChoice& 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 `QlistCommandChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::QlistCommandChoice& object); - } // close package namespace // TRAITS @@ -2531,160 +2517,140 @@ class StartCommand { 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 `StartCommand` having the default value. StartCommand(); - - /// Create an object of type `StartCommand` having the value of the - /// specified `original` object. - StartCommand(const StartCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StartCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - StartCommand(StartCommand&& original) = default; -#endif - - /// Destroy this object. - ~StartCommand(); + // Create an object of type 'StartCommand' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - StartCommand& operator=(const StartCommand& 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. - StartCommand& operator=(StartCommand&& 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 "Async" attribute of this - /// object. bool& async(); + // Return a reference to the modifiable "Async" 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 "Async" attribute of this - /// object. bool async() const; + // Return the value of the "Async" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const StartCommand& lhs, const StartCommand& 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.async() == rhs.async(); + } + + friend bool operator!=(const StartCommand& lhs, const StartCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StartCommand& 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 StartCommand& 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 + // 'StartCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.async()); + } }; -// 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 StartCommand& lhs, const StartCommand& 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 StartCommand& lhs, const StartCommand& 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 StartCommand& 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 `StartCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::StartCommand& object); - } // close package namespace // TRAITS @@ -2718,158 +2684,138 @@ class StopCommand { 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 `StopCommand` having the default value. StopCommand(); - - /// Create an object of type `StopCommand` having the value of the - /// specified `original` object. - StopCommand(const StopCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `StopCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - StopCommand(StopCommand&& original) = default; -#endif - - /// Destroy this object. - ~StopCommand(); + // Create an object of type 'StopCommand' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - StopCommand& operator=(const StopCommand& 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. - StopCommand& operator=(StopCommand&& 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 "Async" attribute of this - /// object. bool& async(); + // Return a reference to the modifiable "Async" 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 "Async" attribute of this - /// object. bool async() const; -}; + // Return the value of the "Async" 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 StopCommand& lhs, const StopCommand& rhs); + // HIDDEN FRIENDS + friend bool operator==(const StopCommand& lhs, const StopCommand& 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.async() == rhs.async(); + } -/// 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 StopCommand& lhs, const StopCommand& rhs); + friend bool operator!=(const StopCommand& lhs, const StopCommand& 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 StopCommand& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StopCommand& 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 `StopCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::StopCommand& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StopCommand& 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 'StopCommand'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.async()); + } +}; } // close package namespace @@ -2891,6 +2837,12 @@ class Subscription { bdlb::NullableValue d_maxUnconfirmedBytes; bdlb::NullableValue d_consumerPriority; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Subscription& rhs) const; + public: // TYPES enum { @@ -2918,206 +2870,212 @@ 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 "CorrelationId" attribute of - /// this object. bdlb::NullableValue& correlationId(); + // Return a reference to the modifiable "CorrelationId" attribute of + // this object. - /// Return a reference to the modifiable "Expression" attribute of this - /// object. bdlb::NullableValue& expression(); + // Return a reference to the modifiable "Expression" attribute of this + // object. - /// Return a reference to the modifiable "MaxUnconfirmedMessages" - /// attribute of this object. bdlb::NullableValue& maxUnconfirmedMessages(); + // Return a reference to the modifiable "MaxUnconfirmedMessages" + // attribute of this object. - /// Return a reference to the modifiable "MaxUnconfirmedBytes" attribute - /// of this object. bdlb::NullableValue& maxUnconfirmedBytes(); + // Return a reference to the modifiable "MaxUnconfirmedBytes" attribute + // of this object. - /// Return a reference to the modifiable "ConsumerPriority" attribute of - /// this object. bdlb::NullableValue& consumerPriority(); + // Return a reference to the modifiable "ConsumerPriority" 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 "CorrelationId" attribute - /// of this object. const bdlb::NullableValue& correlationId() const; + // Return a reference offering non-modifiable access to the + // "CorrelationId" attribute of this object. - /// Return a reference to the non-modifiable "Expression" attribute of - /// this object. const bdlb::NullableValue& expression() const; + // Return a reference offering non-modifiable access to the + // "Expression" attribute of this object. - /// Return a reference to the non-modifiable "MaxUnconfirmedMessages" - /// attribute of this object. const bdlb::NullableValue& maxUnconfirmedMessages() const; + // Return a reference offering non-modifiable access to the + // "MaxUnconfirmedMessages" attribute of this object. - /// Return a reference to the non-modifiable "MaxUnconfirmedBytes" - /// attribute of this object. const bdlb::NullableValue& maxUnconfirmedBytes() const; + // Return a reference offering non-modifiable access to the + // "MaxUnconfirmedBytes" attribute of this object. - /// Return a reference to the non-modifiable "ConsumerPriority" - /// attribute of this object. const bdlb::NullableValue& consumerPriority() const; + // Return a reference offering non-modifiable access to the + // "ConsumerPriority" 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.isEqualTo(rhs); + } + + 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 - -/// 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); - -/// 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); - -/// 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); - -/// 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 m_bmqtool::Subscription& object); - } // close package namespace // TRAITS @@ -3140,6 +3098,12 @@ class ConfigureQueueCommand { int d_consumerPriority; bool d_async; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const ConfigureQueueCommand& rhs) const; + public: // TYPES enum { @@ -3177,217 +3141,220 @@ class ConfigureQueueCommand { 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 `ConfigureQueueCommand` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit ConfigureQueueCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureQueueCommand' 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 `ConfigureQueueCommand` 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. ConfigureQueueCommand(const ConfigureQueueCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'ConfigureQueueCommand' 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 `ConfigureQueueCommand` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. ConfigureQueueCommand(ConfigureQueueCommand&& original) noexcept; + // Create an object of type 'ConfigureQueueCommand' 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 `ConfigureQueueCommand` 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. ConfigureQueueCommand(ConfigureQueueCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'ConfigureQueueCommand' 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. ~ConfigureQueueCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. ConfigureQueueCommand& operator=(const ConfigureQueueCommand& 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. ConfigureQueueCommand& operator=(ConfigureQueueCommand&& 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 "Async" attribute of this - /// object. bool& async(); + // Return a reference to the modifiable "Async" attribute of this + // object. - /// Return a reference to the modifiable "MaxUnconfirmedMessages" - /// attribute of this object. int& maxUnconfirmedMessages(); + // Return a reference to the modifiable "MaxUnconfirmedMessages" + // attribute of this object. - /// Return a reference to the modifiable "MaxUnconfirmedBytes" attribute - /// of this object. int& 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 "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 "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 "Async" attribute of this - /// object. bool async() const; + // Return the value of the "Async" attribute of this object. - /// Return a reference to the non-modifiable "MaxUnconfirmedMessages" - /// attribute of this object. int maxUnconfirmedMessages() const; + // Return the value of the "MaxUnconfirmedMessages" attribute of this + // object. - /// Return a reference to the non-modifiable "MaxUnconfirmedBytes" - /// attribute of this object. int 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 "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 ConfigureQueueCommand& lhs, + const ConfigureQueueCommand& 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 ConfigureQueueCommand& lhs, + const ConfigureQueueCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const ConfigureQueueCommand& 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 ConfigureQueueCommand& 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 + // 'ConfigureQueueCommand'. + { + 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 ConfigureQueueCommand& lhs, - const ConfigureQueueCommand& 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 ConfigureQueueCommand& lhs, - const ConfigureQueueCommand& 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 ConfigureQueueCommand& 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 `ConfigureQueueCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::ConfigureQueueCommand& object); - } // close package namespace // TRAITS @@ -3420,159 +3387,140 @@ class DataCommand { 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 `DataCommand` having the default value. DataCommand(); - - /// Create an object of type `DataCommand` having the value of the - /// specified `original` object. - DataCommand(const DataCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `DataCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - DataCommand(DataCommand&& original) = default; -#endif - - /// Destroy this object. - ~DataCommand(); + // Create an object of type 'DataCommand' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - DataCommand& operator=(const DataCommand& 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. - DataCommand& operator=(DataCommand&& 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. DataCommandChoice& 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 DataCommandChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const DataCommand& lhs, const DataCommand& 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 DataCommand& lhs, const DataCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DataCommand& 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 DataCommand& 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 'DataCommand'. + { + 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 DataCommand& lhs, const DataCommand& 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 DataCommand& lhs, const DataCommand& 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 DataCommand& 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 `DataCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::DataCommand& object); - } // close package namespace // TRAITS @@ -3603,6 +3551,12 @@ class JournalCommandChoice { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const JournalCommandChoice& rhs) const; + public: // TYPES @@ -3641,127 +3595,124 @@ class JournalCommandChoice { 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 `JournalCommandChoice` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit JournalCommandChoice(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'JournalCommandChoice' 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 `JournalCommandChoice` 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. JournalCommandChoice(const JournalCommandChoice& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'JournalCommandChoice' 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 `JournalCommandChoice` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. JournalCommandChoice(JournalCommandChoice&& original) noexcept; + // Create an object of type 'JournalCommandChoice' 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 `JournalCommandChoice` 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. JournalCommandChoice(JournalCommandChoice&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'JournalCommandChoice' 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. ~JournalCommandChoice(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. JournalCommandChoice& operator=(const JournalCommandChoice& 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. JournalCommandChoice& operator=(JournalCommandChoice&& 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). - /// Set the value of this object to be a "N" value. Optionally specify - /// the `value` of the "N". If `value` is not specified, the default - /// "N" value is used. bsls::Types::Uint64& makeN(); bsls::Types::Uint64& makeN(bsls::Types::Uint64 value); + // Set the value of this object to be a "N" value. Optionally specify + // the 'value' of the "N". If 'value' is not specified, the default + // "N" value is used. - /// Set the value of this object to be a "Next" value. Optionally - /// specify the `value` of the "Next". If `value` is not specified, the - /// default "Next" value is used. bsls::Types::Uint64& makeNext(); bsls::Types::Uint64& makeNext(bsls::Types::Uint64 value); + // Set the value of this object to be a "Next" value. Optionally + // specify the 'value' of the "Next". If 'value' is not specified, the + // default "Next" value is used. - /// Set the value of this object to be a "P" value. Optionally specify - /// the `value` of the "P". If `value` is not specified, the default - /// "P" value is used. bsls::Types::Uint64& makeP(); bsls::Types::Uint64& makeP(bsls::Types::Uint64 value); + // Set the value of this object to be a "P" value. Optionally specify + // the 'value' of the "P". If 'value' is not specified, the default + // "P" value is used. - /// Set the value of this object to be a "Prev" value. Optionally - /// specify the `value` of the "Prev". If `value` is not specified, the - /// default "Prev" value is used. bsls::Types::Uint64& makePrev(); bsls::Types::Uint64& makePrev(bsls::Types::Uint64 value); + // Set the value of this object to be a "Prev" value. Optionally + // specify the 'value' of the "Prev". If 'value' is not specified, the + // default "Prev" value is used. - /// Set the value of this object to be a "R" value. Optionally specify - /// the `value` of the "R". If `value` is not specified, the default - /// "R" value is used. bsls::Types::Uint64& makeR(); bsls::Types::Uint64& makeR(bsls::Types::Uint64 value); + // Set the value of this object to be a "R" value. Optionally specify + // the 'value' of the "R". If 'value' is not specified, the default + // "R" value is used. - /// Set the value of this object to be a "Record" value. Optionally - /// specify the `value` of the "Record". If `value` is not specified, - /// the default "Record" value is used. bsls::Types::Uint64& makeRecord(); bsls::Types::Uint64& makeRecord(bsls::Types::Uint64 value); + // Set the value of this object to be a "Record" value. Optionally + // specify the 'value' of the "Record". If 'value' is not specified, + // the default "Record" value is used. - /// Set the value of this object to be a "List" value. Optionally - /// specify the `value` of the "List". If `value` is not specified, the - /// default "List" value is used. int& makeList(); int& makeList(int value); + // Set the value of this object to be a "List" value. Optionally + // specify the 'value' of the "List". If 'value' is not specified, the + // default "List" value is used. - /// Set the value of this object to be a "L" value. Optionally specify - /// the `value` of the "L". If `value` is not specified, the default - /// "L" value is used. int& makeL(); int& makeL(int value); + // Set the value of this object to be a "L" value. Optionally specify + // the 'value' of the "L". If 'value' is not specified, the default + // "L" value is used. bsl::string& makeDump(); bsl::string& makeDump(const bsl::string& value); @@ -3773,222 +3724,234 @@ class JournalCommandChoice { // specify the 'value' of the "Dump". If 'value' is not specified, the // default "Dump" value is used. - /// Set the value of this object to be a "Type" value. Optionally - /// specify the `value` of the "Type". If `value` is not specified, the - /// default "Type" value is used. JournalCommandChoiceType::Value& makeType(); JournalCommandChoiceType::Value& makeType(JournalCommandChoiceType::Value value); + // Set the value of this object to be a "Type" value. Optionally + // specify the 'value' of the "Type". If 'value' is not specified, the + // default "Type" 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. - /// 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 "N" selection of this object if - /// "N" is the current selection. The behavior is undefined unless "N" - /// is the selection of this object. bsls::Types::Uint64& n(); + // Return a reference to the modifiable "N" selection of this object if + // "N" is the current selection. The behavior is undefined unless "N" + // is the selection of this object. - /// Return a reference to the modifiable "Next" selection of this object - /// if "Next" is the current selection. The behavior is undefined - /// unless "Next" is the selection of this object. bsls::Types::Uint64& next(); + // Return a reference to the modifiable "Next" selection of this object + // if "Next" is the current selection. The behavior is undefined + // unless "Next" is the selection of this object. - /// Return a reference to the modifiable "P" selection of this object if - /// "P" is the current selection. The behavior is undefined unless "P" - /// is the selection of this object. bsls::Types::Uint64& p(); + // Return a reference to the modifiable "P" selection of this object if + // "P" is the current selection. The behavior is undefined unless "P" + // is the selection of this object. - /// Return a reference to the modifiable "Prev" selection of this object - /// if "Prev" is the current selection. The behavior is undefined - /// unless "Prev" is the selection of this object. bsls::Types::Uint64& prev(); + // Return a reference to the modifiable "Prev" selection of this object + // if "Prev" is the current selection. The behavior is undefined + // unless "Prev" is the selection of this object. - /// Return a reference to the modifiable "R" selection of this object if - /// "R" is the current selection. The behavior is undefined unless "R" - /// is the selection of this object. bsls::Types::Uint64& r(); + // Return a reference to the modifiable "R" selection of this object if + // "R" is the current selection. The behavior is undefined unless "R" + // is the selection of this object. - /// Return a reference to the modifiable "Record" selection of this - /// object if "Record" is the current selection. The behavior is - /// undefined unless "Record" is the selection of this object. bsls::Types::Uint64& record(); + // Return a reference to the modifiable "Record" selection of this + // object if "Record" is the current selection. The behavior is + // undefined unless "Record" is the selection of this object. - /// Return a reference to the modifiable "List" selection of this object - /// if "List" is the current selection. The behavior is undefined - /// unless "List" is the selection of this object. int& list(); + // Return a reference to the modifiable "List" selection of this object + // if "List" is the current selection. The behavior is undefined + // unless "List" is the selection of this object. - /// Return a reference to the modifiable "L" selection of this object if - /// "L" is the current selection. The behavior is undefined unless "L" - /// is the selection of this object. int& l(); + // Return a reference to the modifiable "L" selection of this object if + // "L" is the current selection. The behavior is undefined unless "L" + // is the selection of this object. - /// Return a reference to the modifiable "Dump" selection of this object - /// if "Dump" is the current selection. The behavior is undefined - /// unless "Dump" is the selection of this object. bsl::string& dump(); + // Return a reference to the modifiable "Dump" selection of this object + // if "Dump" is the current selection. The behavior is undefined + // unless "Dump" is the selection of this object. - /// Return a reference to the modifiable "Type" selection of this object - /// if "Type" is the current selection. The behavior is undefined - /// unless "Type" is the selection of this object. JournalCommandChoiceType::Value& type(); + // Return a reference to the modifiable "Type" selection of this object + // if "Type" is the current selection. The behavior is undefined + // unless "Type" 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 "N" selection of this - /// object if "N" is the current selection. The behavior is undefined - /// unless "N" is the selection of this object. const bsls::Types::Uint64& n() const; + // Return a reference to the non-modifiable "N" selection of this + // object if "N" is the current selection. The behavior is undefined + // unless "N" is the selection of this object. - /// Return a reference to the non-modifiable "Next" selection of this - /// object if "Next" is the current selection. The behavior is - /// undefined unless "Next" is the selection of this object. const bsls::Types::Uint64& next() const; + // Return a reference to the non-modifiable "Next" selection of this + // object if "Next" is the current selection. The behavior is + // undefined unless "Next" is the selection of this object. - /// Return a reference to the non-modifiable "P" selection of this - /// object if "P" is the current selection. The behavior is undefined - /// unless "P" is the selection of this object. const bsls::Types::Uint64& p() const; + // Return a reference to the non-modifiable "P" selection of this + // object if "P" is the current selection. The behavior is undefined + // unless "P" is the selection of this object. - /// Return a reference to the non-modifiable "Prev" selection of this - /// object if "Prev" is the current selection. The behavior is - /// undefined unless "Prev" is the selection of this object. const bsls::Types::Uint64& prev() const; + // Return a reference to the non-modifiable "Prev" selection of this + // object if "Prev" is the current selection. The behavior is + // undefined unless "Prev" is the selection of this object. - /// Return a reference to the non-modifiable "R" selection of this - /// object if "R" is the current selection. The behavior is undefined - /// unless "R" is the selection of this object. const bsls::Types::Uint64& r() const; + // Return a reference to the non-modifiable "R" selection of this + // object if "R" is the current selection. The behavior is undefined + // unless "R" is the selection of this object. - /// Return a reference to the non-modifiable "Record" selection of this - /// object if "Record" is the current selection. The behavior is - /// undefined unless "Record" is the selection of this object. const bsls::Types::Uint64& record() const; + // Return a reference to the non-modifiable "Record" selection of this + // object if "Record" is the current selection. The behavior is + // undefined unless "Record" is the selection of this object. - /// Return a reference to the non-modifiable "List" selection of this - /// object if "List" is the current selection. The behavior is - /// undefined unless "List" is the selection of this object. const int& list() const; + // Return a reference to the non-modifiable "List" selection of this + // object if "List" is the current selection. The behavior is + // undefined unless "List" is the selection of this object. - /// Return a reference to the non-modifiable "L" selection of this - /// object if "L" is the current selection. The behavior is undefined - /// unless "L" is the selection of this object. const int& l() const; + // Return a reference to the non-modifiable "L" selection of this + // object if "L" is the current selection. The behavior is undefined + // unless "L" is the selection of this object. - /// Return a reference to the non-modifiable "Dump" selection of this - /// object if "Dump" is the current selection. The behavior is - /// undefined unless "Dump" is the selection of this object. const bsl::string& dump() const; + // Return a reference to the non-modifiable "Dump" selection of this + // object if "Dump" is the current selection. The behavior is + // undefined unless "Dump" is the selection of this object. - /// Return a reference to the non-modifiable "Type" selection of this - /// object if "Type" is the current selection. The behavior is - /// undefined unless "Type" is the selection of this object. const JournalCommandChoiceType::Value& type() const; + // Return a reference to the non-modifiable "Type" selection of this + // object if "Type" is the current selection. The behavior is + // undefined unless "Type" is the selection of this object. - /// Return `true` if the value of this object is a "N" value, and return - /// `false` otherwise. bool isNValue() const; + // Return 'true' if the value of this object is a "N" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Next" value, and - /// return `false` otherwise. bool isNextValue() const; + // Return 'true' if the value of this object is a "Next" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "P" value, and return - /// `false` otherwise. bool isPValue() const; + // Return 'true' if the value of this object is a "P" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Prev" value, and - /// return `false` otherwise. bool isPrevValue() const; + // Return 'true' if the value of this object is a "Prev" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "R" value, and return - /// `false` otherwise. bool isRValue() const; + // Return 'true' if the value of this object is a "R" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Record" value, and - /// return `false` otherwise. bool isRecordValue() const; + // Return 'true' if the value of this object is a "Record" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "List" value, and - /// return `false` otherwise. bool isListValue() const; + // Return 'true' if the value of this object is a "List" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "L" value, and return - /// `false` otherwise. bool isLValue() const; + // Return 'true' if the value of this object is a "L" value, and return + // 'false' otherwise. - /// Return `true` if the value of this object is a "Dump" value, and - /// return `false` otherwise. bool isDumpValue() const; + // Return 'true' if the value of this object is a "Dump" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "Type" value, and - /// return `false` otherwise. bool isTypeValue() const; + // Return 'true' if the value of this object is a "Type" 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 JournalCommandChoice& lhs, + const JournalCommandChoice& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'JournalCommandChoice' 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 JournalCommandChoice& lhs, + const JournalCommandChoice& 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 JournalCommandChoice& 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 JournalCommandChoice& 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 + // 'JournalCommandChoice'. + { + return object.hashAppendImpl(hashAlg); + } }; -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `JournalCommandChoice` 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 JournalCommandChoice& lhs, - const JournalCommandChoice& 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 JournalCommandChoice& lhs, - const JournalCommandChoice& 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 JournalCommandChoice& 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 `JournalCommandChoice`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::JournalCommandChoice& object); - } // close package namespace // TRAITS @@ -4008,6 +3971,10 @@ class MessageProperty { bsl::string d_value; MessagePropertyType::Value d_type; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -4033,192 +4000,199 @@ class MessageProperty { 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 `MessageProperty` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit MessageProperty(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'MessageProperty' 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 `MessageProperty` 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. MessageProperty(const MessageProperty& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'MessageProperty' 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 `MessageProperty` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. MessageProperty(MessageProperty&& original) noexcept; + // Create an object of type 'MessageProperty' 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 `MessageProperty` 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. MessageProperty(MessageProperty&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'MessageProperty' 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. ~MessageProperty(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. MessageProperty& operator=(const MessageProperty& 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. MessageProperty& operator=(MessageProperty&& 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 "Name" attribute of this - /// object. bsl::string& name(); + // Return a reference to the modifiable "Name" attribute of this + // object. - /// Return a reference to the modifiable "Value" attribute of this - /// object. bsl::string& value(); + // Return a reference to the modifiable "Value" attribute of this + // object. - /// Return a reference to the modifiable "Type" attribute of this - /// object. MessagePropertyType::Value& type(); + // Return a reference to the modifiable "Type" 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 "Name" attribute of this - /// object. const bsl::string& name() const; + // Return a reference offering non-modifiable access to the "Name" + // attribute of this object. - /// Return a reference to the non-modifiable "Value" attribute of this - /// object. const bsl::string& value() const; + // Return a reference offering non-modifiable access to the "Value" + // attribute of this object. - /// Return a reference to the non-modifiable "Type" attribute of this - /// object. MessagePropertyType::Value type() const; + // Return the value of the "Type" attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const MessageProperty& lhs, + const MessageProperty& 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.name() == rhs.name() && lhs.value() == rhs.value() && + lhs.type() == rhs.type(); + } + + friend bool operator!=(const MessageProperty& lhs, + const MessageProperty& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const MessageProperty& 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 MessageProperty& 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 + // 'MessageProperty'. + { + 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 MessageProperty& lhs, const MessageProperty& 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 MessageProperty& lhs, const MessageProperty& 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 MessageProperty& 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 `MessageProperty`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::MessageProperty& object); - } // close package namespace // TRAITS @@ -4242,6 +4216,12 @@ class OpenQueueCommand { int d_consumerPriority; bool d_async; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const OpenQueueCommand& rhs) const; + public: // TYPES enum { @@ -4281,225 +4261,228 @@ class OpenQueueCommand { 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 `OpenQueueCommand` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit OpenQueueCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenQueueCommand' 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 `OpenQueueCommand` 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. OpenQueueCommand(const OpenQueueCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'OpenQueueCommand' 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 `OpenQueueCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. OpenQueueCommand(OpenQueueCommand&& original) noexcept; + // Create an object of type 'OpenQueueCommand' 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 `OpenQueueCommand` 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. OpenQueueCommand(OpenQueueCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'OpenQueueCommand' 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. ~OpenQueueCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. OpenQueueCommand& operator=(const OpenQueueCommand& 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. OpenQueueCommand& operator=(OpenQueueCommand&& 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 "Flags" attribute of this - /// object. bsl::string& flags(); + // Return a reference to the modifiable "Flags" attribute of this + // object. - /// Return a reference to the modifiable "Async" attribute of this - /// object. bool& async(); + // Return a reference to the modifiable "Async" attribute of this + // object. - /// Return a reference to the modifiable "MaxUnconfirmedMessages" - /// attribute of this object. int& maxUnconfirmedMessages(); + // Return a reference to the modifiable "MaxUnconfirmedMessages" + // attribute of this object. - /// Return a reference to the modifiable "MaxUnconfirmedBytes" attribute - /// of this object. int& 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 "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 "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 "Flags" attribute of this - /// object. const bsl::string& flags() const; + // Return a reference offering non-modifiable access to the "Flags" + // attribute of this object. - /// Return a reference to the non-modifiable "Async" attribute of this - /// object. bool async() const; + // Return the value of the "Async" attribute of this object. - /// Return a reference to the non-modifiable "MaxUnconfirmedMessages" - /// attribute of this object. int maxUnconfirmedMessages() const; + // Return the value of the "MaxUnconfirmedMessages" attribute of this + // object. - /// Return a reference to the non-modifiable "MaxUnconfirmedBytes" - /// attribute of this object. int 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 "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 OpenQueueCommand& lhs, + const OpenQueueCommand& 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 OpenQueueCommand& lhs, + const OpenQueueCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const OpenQueueCommand& 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 OpenQueueCommand& 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 + // 'OpenQueueCommand'. + { + 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 OpenQueueCommand& lhs, - const OpenQueueCommand& 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 OpenQueueCommand& lhs, - const OpenQueueCommand& 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 OpenQueueCommand& 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 `OpenQueueCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::OpenQueueCommand& object); - } // close package namespace // TRAITS @@ -4532,160 +4515,141 @@ class QlistCommand { 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 `QlistCommand` having the default value. QlistCommand(); - - /// Create an object of type `QlistCommand` having the value of the - /// specified `original` object. - QlistCommand(const QlistCommand& original); - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - /// Create an object of type `QlistCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. - QlistCommand(QlistCommand&& original) = default; -#endif - - /// Destroy this object. - ~QlistCommand(); + // Create an object of type 'QlistCommand' having the default value. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. - QlistCommand& operator=(const QlistCommand& 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. - QlistCommand& operator=(QlistCommand&& 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. QlistCommandChoice& 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 QlistCommandChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const QlistCommand& lhs, const QlistCommand& 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 QlistCommand& lhs, const QlistCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QlistCommand& 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 QlistCommand& 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 + // 'QlistCommand'. + { + 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 QlistCommand& lhs, const QlistCommand& 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 QlistCommand& lhs, const QlistCommand& 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 QlistCommand& 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 `QlistCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::QlistCommand& object); - } // close package namespace // TRAITS @@ -4700,6 +4664,7 @@ namespace m_bmqtool { class CommandLineParameters { // INSTANCE DATA + bsls::Types::Int64 d_eventSize; bsl::vector d_subscriptions; bsl::vector d_messageProperties; bsl::string d_mode; @@ -4715,7 +4680,6 @@ class CommandLineParameters { bsl::string d_storage; bsl::string d_log; bsl::string d_sequentialMessagePattern; - int d_eventSize; int d_msgSize; int d_postRate; int d_postInterval; @@ -4726,6 +4690,12 @@ class CommandLineParameters { bool d_memoryDebug; bool d_noSessionEventHandler; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const CommandLineParameters& rhs) const; + public: // TYPES enum { @@ -4805,7 +4775,7 @@ class CommandLineParameters { static const bool DEFAULT_INITIALIZER_CONFIRM_MSG; - static const int DEFAULT_INITIALIZER_EVENT_SIZE; + static const bsls::Types::Int64 DEFAULT_INITIALIZER_EVENT_SIZE; static const int DEFAULT_INITIALIZER_MSG_SIZE; @@ -4839,369 +4809,365 @@ class CommandLineParameters { 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 `CommandLineParameters` having the default - /// value. Use the optionally specified `basicAllocator` to supply - /// memory. If `basicAllocator` is 0, the currently installed default - /// allocator is used. explicit CommandLineParameters(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'CommandLineParameters' 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 `CommandLineParameters` 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. CommandLineParameters(const CommandLineParameters& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'CommandLineParameters' 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 `CommandLineParameters` having the value of - /// the specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. CommandLineParameters(CommandLineParameters&& original) noexcept; + // Create an object of type 'CommandLineParameters' 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 `CommandLineParameters` 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. CommandLineParameters(CommandLineParameters&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'CommandLineParameters' 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. ~CommandLineParameters(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. CommandLineParameters& operator=(const CommandLineParameters& 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. CommandLineParameters& operator=(CommandLineParameters&& 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 "Mode" attribute of this - /// object. bsl::string& mode(); + // Return a reference to the modifiable "Mode" attribute of this + // object. - /// Return a reference to the modifiable "Broker" attribute of this - /// object. bsl::string& broker(); + // Return a reference to the modifiable "Broker" attribute of this + // object. - /// 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 "QueueFlags" attribute of this - /// object. bsl::string& queueFlags(); + // Return a reference to the modifiable "QueueFlags" attribute of this + // object. - /// Return a reference to the modifiable "Latency" attribute of this - /// object. bsl::string& latency(); + // Return a reference to the modifiable "Latency" attribute of this + // object. - /// Return a reference to the modifiable "LatencyReport" attribute of - /// this object. bsl::string& latencyReport(); + // Return a reference to the modifiable "LatencyReport" attribute of + // this object. - /// Return a reference to the modifiable "DumpMsg" attribute of this - /// object. bool& dumpMsg(); + // Return a reference to the modifiable "DumpMsg" attribute of this + // object. - /// Return a reference to the modifiable "ConfirmMsg" attribute of this - /// object. bool& confirmMsg(); + // Return a reference to the modifiable "ConfirmMsg" attribute of this + // object. - /// Return a reference to the modifiable "EventSize" attribute of this - /// object. - int& eventSize(); + bsls::Types::Int64& eventSize(); + // Return a reference to the modifiable "EventSize" attribute of this + // object. - /// Return a reference to the modifiable "MsgSize" attribute of this - /// object. int& msgSize(); + // Return a reference to the modifiable "MsgSize" attribute of this + // object. - /// Return a reference to the modifiable "PostRate" attribute of this - /// object. int& postRate(); + // Return a reference to the modifiable "PostRate" attribute of this + // object. - /// Return a reference to the modifiable "EventsCount" attribute of this - /// object. bsl::string& eventsCount(); + // Return a reference to the modifiable "EventsCount" attribute of this + // object. - /// Return a reference to the modifiable "MaxUnconfirmed" attribute of - /// this object. bsl::string& maxUnconfirmed(); + // Return a reference to the modifiable "MaxUnconfirmed" attribute of + // this object. - /// Return a reference to the modifiable "PostInterval" attribute of - /// this object. int& postInterval(); + // Return a reference to the modifiable "PostInterval" attribute of + // this object. - /// Return a reference to the modifiable "Verbosity" attribute of this - /// object. bsl::string& verbosity(); + // Return a reference to the modifiable "Verbosity" attribute of this + // object. - /// Return a reference to the modifiable "LogFormat" attribute of this - /// object. bsl::string& logFormat(); + // Return a reference to the modifiable "LogFormat" attribute of this + // object. - /// Return a reference to the modifiable "MemoryDebug" attribute of this - /// object. bool& memoryDebug(); + // Return a reference to the modifiable "MemoryDebug" attribute of this + // object. - /// Return a reference to the modifiable "Threads" attribute of this - /// object. int& threads(); + // Return a reference to the modifiable "Threads" attribute of this + // object. - /// Return a reference to the modifiable "ShutdownGrace" attribute of - /// this object. int& shutdownGrace(); + // Return a reference to the modifiable "ShutdownGrace" attribute of + // this object. - /// Return a reference to the modifiable "NoSessionEventHandler" - /// attribute of this object. bool& noSessionEventHandler(); + // Return a reference to the modifiable "NoSessionEventHandler" + // attribute of this object. - /// Return a reference to the modifiable "Storage" attribute of this - /// object. bsl::string& storage(); + // Return a reference to the modifiable "Storage" attribute of this + // object. - /// Return a reference to the modifiable "Log" attribute of this object. bsl::string& log(); + // Return a reference to the modifiable "Log" attribute of this object. - /// Return a reference to the modifiable "SequentialMessagePattern" - /// attribute of this object. bsl::string& sequentialMessagePattern(); + // Return a reference to the modifiable "SequentialMessagePattern" + // attribute of this object. - /// Return a reference to the modifiable "MessageProperties" attribute - /// of this object. bsl::vector& messageProperties(); + // Return a reference to the modifiable "MessageProperties" 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 "Mode" attribute of this - /// object. const bsl::string& mode() const; + // Return a reference offering non-modifiable access to the "Mode" + // attribute of this object. - /// Return a reference to the non-modifiable "Broker" attribute of this - /// object. const bsl::string& broker() const; + // Return a reference offering non-modifiable access to the "Broker" + // attribute of this object. - /// 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 "QueueFlags" attribute of - /// this object. const bsl::string& queueFlags() const; + // Return a reference offering non-modifiable access to the + // "QueueFlags" attribute of this object. - /// Return a reference to the non-modifiable "Latency" attribute of this - /// object. const bsl::string& latency() const; + // Return a reference offering non-modifiable access to the "Latency" + // attribute of this object. - /// Return a reference to the non-modifiable "LatencyReport" attribute - /// of this object. const bsl::string& latencyReport() const; + // Return a reference offering non-modifiable access to the + // "LatencyReport" attribute of this object. - /// Return a reference to the non-modifiable "DumpMsg" attribute of this - /// object. bool dumpMsg() const; + // Return the value of the "DumpMsg" attribute of this object. - /// Return a reference to the non-modifiable "ConfirmMsg" attribute of - /// this object. bool confirmMsg() const; + // Return the value of the "ConfirmMsg" attribute of this object. - /// Return a reference to the non-modifiable "EventSize" attribute of - /// this object. - int eventSize() const; + bsls::Types::Int64 eventSize() const; + // Return the value of the "EventSize" attribute of this object. - /// Return a reference to the non-modifiable "MsgSize" attribute of this - /// object. int msgSize() const; + // Return the value of the "MsgSize" attribute of this object. - /// Return a reference to the non-modifiable "PostRate" attribute of - /// this object. int postRate() const; + // Return the value of the "PostRate" attribute of this object. - /// Return a reference to the non-modifiable "EventsCount" attribute of - /// this object. const bsl::string& eventsCount() const; + // Return a reference offering non-modifiable access to the + // "EventsCount" attribute of this object. - /// Return a reference to the non-modifiable "MaxUnconfirmed" attribute - /// of this object. const bsl::string& maxUnconfirmed() const; + // Return a reference offering non-modifiable access to the + // "MaxUnconfirmed" attribute of this object. - /// Return a reference to the non-modifiable "PostInterval" attribute of - /// this object. int postInterval() const; + // Return the value of the "PostInterval" attribute of this object. - /// Return a reference to the non-modifiable "Verbosity" attribute of - /// this object. const bsl::string& verbosity() const; + // Return a reference offering non-modifiable access to the "Verbosity" + // attribute of this object. - /// Return a reference to the non-modifiable "LogFormat" attribute of - /// this object. const bsl::string& logFormat() const; + // Return a reference offering non-modifiable access to the "LogFormat" + // attribute of this object. - /// Return a reference to the non-modifiable "MemoryDebug" attribute of - /// this object. bool memoryDebug() const; + // Return the value of the "MemoryDebug" attribute of this object. - /// Return a reference to the non-modifiable "Threads" attribute of this - /// object. int threads() const; + // Return the value of the "Threads" attribute of this object. - /// Return a reference to the non-modifiable "ShutdownGrace" attribute - /// of this object. int shutdownGrace() const; + // Return the value of the "ShutdownGrace" attribute of this object. - /// Return a reference to the non-modifiable "NoSessionEventHandler" - /// attribute of this object. bool noSessionEventHandler() const; + // Return the value of the "NoSessionEventHandler" attribute of this + // object. - /// Return a reference to the non-modifiable "Storage" attribute of this - /// object. const bsl::string& storage() const; + // Return a reference offering non-modifiable access to the "Storage" + // attribute of this object. - /// Return a reference to the non-modifiable "Log" attribute of this - /// object. const bsl::string& log() const; + // Return a reference offering non-modifiable access to the "Log" + // attribute of this object. - /// Return a reference to the non-modifiable "SequentialMessagePattern" - /// attribute of this object. const bsl::string& sequentialMessagePattern() const; + // Return a reference offering non-modifiable access to the + // "SequentialMessagePattern" attribute of this object. - /// Return a reference to the non-modifiable "MessageProperties" - /// attribute of this object. const bsl::vector& messageProperties() const; + // Return a reference offering non-modifiable access to the + // "MessageProperties" 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 CommandLineParameters& lhs, + const CommandLineParameters& 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 CommandLineParameters& lhs, + const CommandLineParameters& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const CommandLineParameters& 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 CommandLineParameters& 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 + // 'CommandLineParameters'. + { + 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 CommandLineParameters& lhs, - const CommandLineParameters& 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 CommandLineParameters& lhs, - const CommandLineParameters& 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 CommandLineParameters& 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 `CommandLineParameters`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::CommandLineParameters& object); - } // close package namespace // TRAITS @@ -5234,176 +5200,184 @@ class JournalCommand { 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 `JournalCommand` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit JournalCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'JournalCommand' 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 `JournalCommand` 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. JournalCommand(const JournalCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'JournalCommand' 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 `JournalCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. JournalCommand(JournalCommand&& original) noexcept; + // Create an object of type 'JournalCommand' 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 `JournalCommand` 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. JournalCommand(JournalCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'JournalCommand' 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. ~JournalCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. JournalCommand& operator=(const JournalCommand& 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. JournalCommand& operator=(JournalCommand&& 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. JournalCommandChoice& 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 JournalCommandChoice& choice() const; + // Return a reference offering non-modifiable access to the "Choice" + // attribute of this object. + + // HIDDEN FRIENDS + friend bool operator==(const JournalCommand& lhs, + const JournalCommand& 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 JournalCommand& lhs, + const JournalCommand& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const JournalCommand& 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 JournalCommand& 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 + // 'JournalCommand'. + { + 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 JournalCommand& lhs, const JournalCommand& 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 JournalCommand& lhs, const JournalCommand& 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 JournalCommand& 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 `JournalCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::JournalCommand& object); - } // close package namespace // TRAITS @@ -5426,6 +5400,12 @@ class PostCommand { bsl::string d_compressionAlgorithmType; bool d_async; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const PostCommand& rhs) const; + public: // TYPES enum { @@ -5461,211 +5441,216 @@ class PostCommand { 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 `PostCommand` having the default value. - /// Use the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit PostCommand(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'PostCommand' 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 `PostCommand` 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. PostCommand(const PostCommand& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'PostCommand' 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 `PostCommand` having the value of the - /// specified `original` object. After performing this action, the - /// `original` object will be left in a valid, but unspecified state. PostCommand(PostCommand&& original) noexcept; + // Create an object of type 'PostCommand' 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 `PostCommand` 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. PostCommand(PostCommand&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'PostCommand' 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. ~PostCommand(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. PostCommand& operator=(const PostCommand& 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. PostCommand& operator=(PostCommand&& 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 "Payload" attribute of this - /// object. bsl::vector& payload(); + // Return a reference to the modifiable "Payload" attribute of this + // object. - /// Return a reference to the modifiable "Async" attribute of this - /// object. bool& async(); + // Return a reference to the modifiable "Async" attribute of this + // object. - /// Return a reference to the modifiable "Groupid" attribute of this - /// object. bsl::string& groupid(); + // Return a reference to the modifiable "Groupid" attribute of this + // object. - /// Return a reference to the modifiable "CompressionAlgorithmType" - /// attribute of this object. bsl::string& compressionAlgorithmType(); + // Return a reference to the modifiable "CompressionAlgorithmType" + // attribute of this object. - /// Return a reference to the modifiable "MessageProperties" attribute - /// of this object. bsl::vector& messageProperties(); + // Return a reference to the modifiable "MessageProperties" 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 "Payload" attribute of this - /// object. const bsl::vector& payload() const; + // Return a reference offering non-modifiable access to the "Payload" + // attribute of this object. - /// Return a reference to the non-modifiable "Async" attribute of this - /// object. bool async() const; + // Return the value of the "Async" attribute of this object. - /// Return a reference to the non-modifiable "Groupid" attribute of this - /// object. const bsl::string& groupid() const; + // Return a reference offering non-modifiable access to the "Groupid" + // attribute of this object. - /// Return a reference to the non-modifiable "CompressionAlgorithmType" - /// attribute of this object. const bsl::string& compressionAlgorithmType() const; + // Return a reference offering non-modifiable access to the + // "CompressionAlgorithmType" attribute of this object. - /// Return a reference to the non-modifiable "MessageProperties" - /// attribute of this object. const bsl::vector& messageProperties() const; -}; + // Return a reference offering non-modifiable access to the + // "MessageProperties" 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 PostCommand& lhs, const PostCommand& rhs); + // HIDDEN FRIENDS + friend bool operator==(const PostCommand& lhs, const PostCommand& 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 PostCommand& lhs, const PostCommand& rhs); + friend bool operator!=(const PostCommand& lhs, const PostCommand& 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 PostCommand& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, + const PostCommand& 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 `PostCommand`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::PostCommand& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const PostCommand& 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 'PostCommand'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -5704,6 +5689,12 @@ class Command { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Command& rhs) const; + public: // TYPES @@ -5754,77 +5745,74 @@ class Command { 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 `Command` having the default value. Use - /// the optionally specified `basicAllocator` to supply memory. If - /// `basicAllocator` is 0, the currently installed default allocator is - /// used. explicit Command(bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Command' 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 `Command` 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. Command(const Command& original, bslma::Allocator* basicAllocator = 0); + // Create an object of type 'Command' 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 `Command` having the value of the specified - /// `original` object. After performing this action, the `original` - /// object will be left in a valid, but unspecified state. Command(Command&& original) noexcept; + // Create an object of type 'Command' 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 `Command` 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. Command(Command&& original, bslma::Allocator* basicAllocator); + // Create an object of type 'Command' 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. ~Command(); + // Destroy this object. // MANIPULATORS - - /// Assign to this object the value of the specified `rhs` object. Command& operator=(const Command& 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. Command& operator=(Command&& 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). StartCommand& makeStart(); StartCommand& makeStart(const StartCommand& value); @@ -5987,298 +5975,309 @@ class Command { // specify the 'value' of the "Journal". If 'value' is not specified, // the default "Journal" 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 "Start" selection of this - /// object if "Start" is the current selection. The behavior is - /// undefined unless "Start" 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. + StartCommand& start(); + // Return a reference to the modifiable "Start" selection of this + // object if "Start" is the current selection. The behavior is + // undefined unless "Start" is the selection of this object. - /// Return a reference to the modifiable "Stop" selection of this object - /// if "Stop" is the current selection. The behavior is undefined - /// unless "Stop" is the selection of this object. StopCommand& stop(); + // Return a reference to the modifiable "Stop" selection of this object + // if "Stop" is the current selection. The behavior is undefined + // unless "Stop" 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. OpenQueueCommand& 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 "ConfigureQueue" selection of - /// this object if "ConfigureQueue" is the current selection. The - /// behavior is undefined unless "ConfigureQueue" is the selection of - /// this object. ConfigureQueueCommand& configureQueue(); + // Return a reference to the modifiable "ConfigureQueue" selection of + // this object if "ConfigureQueue" is the current selection. The + // behavior is undefined unless "ConfigureQueue" 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. CloseQueueCommand& 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 "Post" selection of this object - /// if "Post" is the current selection. The behavior is undefined - /// unless "Post" is the selection of this object. PostCommand& post(); + // Return a reference to the modifiable "Post" selection of this object + // if "Post" is the current selection. The behavior is undefined + // unless "Post" is the selection of this object. - /// Return a reference to the modifiable "List" selection of this object - /// if "List" is the current selection. The behavior is undefined - /// unless "List" is the selection of this object. ListCommand& list(); + // Return a reference to the modifiable "List" selection of this object + // if "List" is the current selection. The behavior is undefined + // unless "List" is the selection of this object. - /// Return a reference to the modifiable "Confirm" selection of this - /// object if "Confirm" is the current selection. The behavior is - /// undefined unless "Confirm" is the selection of this object. ConfirmCommand& confirm(); + // Return a reference to the modifiable "Confirm" selection of this + // object if "Confirm" is the current selection. The behavior is + // undefined unless "Confirm" is the selection of this object. - /// Return a reference to the modifiable "OpenStorage" selection of this - /// object if "OpenStorage" is the current selection. The behavior is - /// undefined unless "OpenStorage" is the selection of this object. OpenStorageCommand& openStorage(); + // Return a reference to the modifiable "OpenStorage" selection of this + // object if "OpenStorage" is the current selection. The behavior is + // undefined unless "OpenStorage" is the selection of this object. - /// Return a reference to the modifiable "CloseStorage" selection of - /// this object if "CloseStorage" is the current selection. The - /// behavior is undefined unless "CloseStorage" is the selection of this - /// object. CloseStorageCommand& closeStorage(); + // Return a reference to the modifiable "CloseStorage" selection of + // this object if "CloseStorage" is the current selection. The + // behavior is undefined unless "CloseStorage" is the selection of this + // object. - /// Return a reference to the modifiable "Metadata" selection of this - /// object if "Metadata" is the current selection. The behavior is - /// undefined unless "Metadata" is the selection of this object. MetadataCommand& metadata(); + // Return a reference to the modifiable "Metadata" selection of this + // object if "Metadata" is the current selection. The behavior is + // undefined unless "Metadata" is the selection of this object. - /// Return a reference to the modifiable "ListQueues" selection of this - /// object if "ListQueues" is the current selection. The behavior is - /// undefined unless "ListQueues" is the selection of this object. ListQueuesCommand& listQueues(); + // Return a reference to the modifiable "ListQueues" selection of this + // object if "ListQueues" is the current selection. The behavior is + // undefined unless "ListQueues" is the selection of this object. - /// Return a reference to the modifiable "DumpQueue" selection of this - /// object if "DumpQueue" is the current selection. The behavior is - /// undefined unless "DumpQueue" is the selection of this object. DumpQueueCommand& dumpQueue(); + // Return a reference to the modifiable "DumpQueue" selection of this + // object if "DumpQueue" is the current selection. The behavior is + // undefined unless "DumpQueue" is the selection of this object. - /// Return a reference to the modifiable "Data" selection of this object - /// if "Data" is the current selection. The behavior is undefined - /// unless "Data" is the selection of this object. DataCommand& data(); + // Return a reference to the modifiable "Data" selection of this object + // if "Data" is the current selection. The behavior is undefined + // unless "Data" is the selection of this object. - /// Return a reference to the modifiable "Qlist" selection of this - /// object if "Qlist" is the current selection. The behavior is - /// undefined unless "Qlist" is the selection of this object. QlistCommand& qlist(); + // Return a reference to the modifiable "Qlist" selection of this + // object if "Qlist" is the current selection. The behavior is + // undefined unless "Qlist" is the selection of this object. - /// Return a reference to the modifiable "Journal" selection of this - /// object if "Journal" is the current selection. The behavior is - /// undefined unless "Journal" is the selection of this object. JournalCommand& journal(); + // Return a reference to the modifiable "Journal" selection of this + // object if "Journal" is the current selection. The behavior is + // undefined unless "Journal" 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 "Start" selection of this - /// object if "Start" is the current selection. The behavior is - /// undefined unless "Start" is the selection of this object. const StartCommand& start() const; + // Return a reference to the non-modifiable "Start" selection of this + // object if "Start" is the current selection. The behavior is + // undefined unless "Start" is the selection of this object. - /// Return a reference to the non-modifiable "Stop" selection of this - /// object if "Stop" is the current selection. The behavior is - /// undefined unless "Stop" is the selection of this object. const StopCommand& stop() const; + // Return a reference to the non-modifiable "Stop" selection of this + // object if "Stop" is the current selection. The behavior is + // undefined unless "Stop" 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 OpenQueueCommand& 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 "ConfigureQueue" selection - /// of this object if "ConfigureQueue" is the current selection. The - /// behavior is undefined unless "ConfigureQueue" is the selection of - /// this object. const ConfigureQueueCommand& configureQueue() const; + // Return a reference to the non-modifiable "ConfigureQueue" selection + // of this object if "ConfigureQueue" is the current selection. The + // behavior is undefined unless "ConfigureQueue" 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 CloseQueueCommand& 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 "Post" selection of this - /// object if "Post" is the current selection. The behavior is - /// undefined unless "Post" is the selection of this object. const PostCommand& post() const; + // Return a reference to the non-modifiable "Post" selection of this + // object if "Post" is the current selection. The behavior is + // undefined unless "Post" is the selection of this object. - /// Return a reference to the non-modifiable "List" selection of this - /// object if "List" is the current selection. The behavior is - /// undefined unless "List" is the selection of this object. const ListCommand& list() const; + // Return a reference to the non-modifiable "List" selection of this + // object if "List" is the current selection. The behavior is + // undefined unless "List" is the selection of this object. - /// Return a reference to the non-modifiable "Confirm" selection of this - /// object if "Confirm" is the current selection. The behavior is - /// undefined unless "Confirm" is the selection of this object. const ConfirmCommand& confirm() const; + // Return a reference to the non-modifiable "Confirm" selection of this + // object if "Confirm" is the current selection. The behavior is + // undefined unless "Confirm" is the selection of this object. - /// Return a reference to the non-modifiable "OpenStorage" selection of - /// this object if "OpenStorage" is the current selection. The behavior - /// is undefined unless "OpenStorage" is the selection of this object. const OpenStorageCommand& openStorage() const; + // Return a reference to the non-modifiable "OpenStorage" selection of + // this object if "OpenStorage" is the current selection. The behavior + // is undefined unless "OpenStorage" is the selection of this object. - /// Return a reference to the non-modifiable "CloseStorage" selection of - /// this object if "CloseStorage" is the current selection. The - /// behavior is undefined unless "CloseStorage" is the selection of this - /// object. const CloseStorageCommand& closeStorage() const; + // Return a reference to the non-modifiable "CloseStorage" selection of + // this object if "CloseStorage" is the current selection. The + // behavior is undefined unless "CloseStorage" is the selection of this + // object. - /// Return a reference to the non-modifiable "Metadata" selection of - /// this object if "Metadata" is the current selection. The behavior is - /// undefined unless "Metadata" is the selection of this object. const MetadataCommand& metadata() const; + // Return a reference to the non-modifiable "Metadata" selection of + // this object if "Metadata" is the current selection. The behavior is + // undefined unless "Metadata" is the selection of this object. - /// Return a reference to the non-modifiable "ListQueues" selection of - /// this object if "ListQueues" is the current selection. The behavior - /// is undefined unless "ListQueues" is the selection of this object. const ListQueuesCommand& listQueues() const; + // Return a reference to the non-modifiable "ListQueues" selection of + // this object if "ListQueues" is the current selection. The behavior + // is undefined unless "ListQueues" is the selection of this object. - /// Return a reference to the non-modifiable "DumpQueue" selection of - /// this object if "DumpQueue" is the current selection. The behavior - /// is undefined unless "DumpQueue" is the selection of this object. const DumpQueueCommand& dumpQueue() const; + // Return a reference to the non-modifiable "DumpQueue" selection of + // this object if "DumpQueue" is the current selection. The behavior + // is undefined unless "DumpQueue" is the selection of this object. - /// Return a reference to the non-modifiable "Data" selection of this - /// object if "Data" is the current selection. The behavior is - /// undefined unless "Data" is the selection of this object. const DataCommand& data() const; + // Return a reference to the non-modifiable "Data" selection of this + // object if "Data" is the current selection. The behavior is + // undefined unless "Data" is the selection of this object. - /// Return a reference to the non-modifiable "Qlist" selection of this - /// object if "Qlist" is the current selection. The behavior is - /// undefined unless "Qlist" is the selection of this object. const QlistCommand& qlist() const; + // Return a reference to the non-modifiable "Qlist" selection of this + // object if "Qlist" is the current selection. The behavior is + // undefined unless "Qlist" is the selection of this object. - /// Return a reference to the non-modifiable "Journal" selection of this - /// object if "Journal" is the current selection. The behavior is - /// undefined unless "Journal" is the selection of this object. const JournalCommand& journal() const; + // Return a reference to the non-modifiable "Journal" selection of this + // object if "Journal" is the current selection. The behavior is + // undefined unless "Journal" is the selection of this object. - /// Return `true` if the value of this object is a "Start" value, and - /// return `false` otherwise. bool isStartValue() const; + // Return 'true' if the value of this object is a "Start" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "Stop" value, and - /// return `false` otherwise. bool isStopValue() const; + // Return 'true' if the value of this object is a "Stop" 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 "ConfigureQueue" - /// value, and return `false` otherwise. bool isConfigureQueueValue() const; + // Return 'true' if the value of this object is a "ConfigureQueue" + // 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 "Post" value, and - /// return `false` otherwise. bool isPostValue() const; + // Return 'true' if the value of this object is a "Post" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "List" value, and - /// return `false` otherwise. bool isListValue() const; + // Return 'true' if the value of this object is a "List" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "Confirm" value, and - /// return `false` otherwise. bool isConfirmValue() const; + // Return 'true' if the value of this object is a "Confirm" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "OpenStorage" value, - /// and return `false` otherwise. bool isOpenStorageValue() const; + // Return 'true' if the value of this object is a "OpenStorage" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "CloseStorage" value, - /// and return `false` otherwise. bool isCloseStorageValue() const; + // Return 'true' if the value of this object is a "CloseStorage" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "Metadata" value, and - /// return `false` otherwise. bool isMetadataValue() const; + // Return 'true' if the value of this object is a "Metadata" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "ListQueues" value, - /// and return `false` otherwise. bool isListQueuesValue() const; + // Return 'true' if the value of this object is a "ListQueues" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "DumpQueue" value, - /// and return `false` otherwise. bool isDumpQueueValue() const; + // Return 'true' if the value of this object is a "DumpQueue" value, + // and return 'false' otherwise. - /// Return `true` if the value of this object is a "Data" value, and - /// return `false` otherwise. bool isDataValue() const; + // Return 'true' if the value of this object is a "Data" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "Qlist" value, and - /// return `false` otherwise. bool isQlistValue() const; + // Return 'true' if the value of this object is a "Qlist" value, and + // return 'false' otherwise. - /// Return `true` if the value of this object is a "Journal" value, and - /// return `false` otherwise. bool isJournalValue() const; + // Return 'true' if the value of this object is a "Journal" 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. -// FREE OPERATORS - -/// Return `true` if the specified `lhs` and `rhs` objects have the same -/// value, and `false` otherwise. Two `Command` 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 Command& lhs, const Command& rhs); + // HIDDEN FRIENDS + friend bool operator==(const Command& lhs, const Command& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'Command' 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); + } -/// 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 Command& lhs, const Command& rhs); + friend bool operator!=(const Command& lhs, const Command& 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); + } -/// 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 Command& rhs); + friend bsl::ostream& operator<<(bsl::ostream& stream, const Command& 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 `Command`. -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::Command& object); + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Command& 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 'Command'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -6286,9 +6285,9 @@ void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::Command& object); BDLAT_DECL_CHOICE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(m_bmqtool::Command) -// ============================================================================ -// INLINE FUNCTION DEFINITIONS -// ============================================================================ +//============================================================================= +// INLINE DEFINITIONS +//============================================================================= namespace m_bmqtool { @@ -6298,8 +6297,8 @@ namespace m_bmqtool { // CLASS METHODS // MANIPULATORS -template -int CloseQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int CloseQueueCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -6313,11 +6312,11 @@ int CloseQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int CloseQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int CloseQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -6333,10 +6332,10 @@ int CloseQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int CloseQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int CloseQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -6360,8 +6359,8 @@ inline bool& CloseQueueCommand::async() } // ACCESSORS -template -int CloseQueueCommand::accessAttributes(ACCESSOR& accessor) const +template +int CloseQueueCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -6375,11 +6374,11 @@ int CloseQueueCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int CloseQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int CloseQueueCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -6394,8 +6393,8 @@ int CloseQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int CloseQueueCommand::accessAttribute(ACCESSOR& accessor, +template +int CloseQueueCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -6420,34 +6419,22 @@ inline bool CloseQueueCommand::async() const return d_async; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::CloseQueueCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.async()); -} - // ------------------------- // class CloseStorageCommand // ------------------------- // CLASS METHODS // MANIPULATORS -template -int CloseStorageCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int CloseStorageCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int CloseStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int CloseStorageCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -6457,10 +6444,10 @@ int CloseStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int CloseStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int CloseStorageCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -6474,17 +6461,15 @@ int CloseStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int CloseStorageCommand::accessAttributes(ACCESSOR& accessor) const +template +int CloseStorageCommand::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int CloseStorageCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int CloseStorageCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -6494,8 +6479,8 @@ int CloseStorageCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int CloseStorageCommand::accessAttribute(ACCESSOR& accessor, +template +int CloseStorageCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -6510,23 +6495,14 @@ int CloseStorageCommand::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::CloseStorageCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // -------------------- // class ConfirmCommand // -------------------- // CLASS METHODS // MANIPULATORS -template -int ConfirmCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int ConfirmCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -6540,11 +6516,11 @@ int ConfirmCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ConfirmCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ConfirmCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -6560,10 +6536,10 @@ int ConfirmCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ConfirmCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConfirmCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -6587,8 +6563,8 @@ inline bsl::string& ConfirmCommand::guid() } // ACCESSORS -template -int ConfirmCommand::accessAttributes(ACCESSOR& accessor) const +template +int ConfirmCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -6602,11 +6578,11 @@ int ConfirmCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConfirmCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int ConfirmCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -6621,8 +6597,8 @@ int ConfirmCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ConfirmCommand::accessAttribute(ACCESSOR& accessor, +template +int ConfirmCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -6647,22 +6623,62 @@ inline const bsl::string& ConfirmCommand::guid() const return d_guid; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::ConfirmCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.guid()); -} - // ----------------------- // class DataCommandChoice // ----------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void DataCommandChoice::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef DataCommandChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_N: hashAppend(hashAlgorithm, this->n()); break; + case Class::SELECTION_ID_NEXT: + hashAppend(hashAlgorithm, this->next()); + break; + case Class::SELECTION_ID_P: hashAppend(hashAlgorithm, this->p()); break; + case Class::SELECTION_ID_PREV: + hashAppend(hashAlgorithm, this->prev()); + break; + case Class::SELECTION_ID_R: hashAppend(hashAlgorithm, this->r()); break; + case Class::SELECTION_ID_RECORD: + hashAppend(hashAlgorithm, this->record()); + break; + case Class::SELECTION_ID_LIST: + hashAppend(hashAlgorithm, this->list()); + break; + case Class::SELECTION_ID_L: hashAppend(hashAlgorithm, this->l()); break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool DataCommandChoice::isEqualTo(const DataCommandChoice& rhs) const +{ + typedef DataCommandChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_N: return this->n() == rhs.n(); + case Class::SELECTION_ID_NEXT: return this->next() == rhs.next(); + case Class::SELECTION_ID_P: return this->p() == rhs.p(); + case Class::SELECTION_ID_PREV: return this->prev() == rhs.prev(); + case Class::SELECTION_ID_R: return this->r() == rhs.r(); + case Class::SELECTION_ID_RECORD: return this->record() == rhs.record(); + case Class::SELECTION_ID_LIST: return this->list() == rhs.list(); + case Class::SELECTION_ID_L: return this->l() == rhs.l(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline DataCommandChoice::DataCommandChoice() : d_selectionId(SELECTION_ID_UNDEFINED) @@ -6675,8 +6691,8 @@ inline DataCommandChoice::~DataCommandChoice() } // MANIPULATORS -template -int DataCommandChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int DataCommandChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case DataCommandChoice::SELECTION_ID_N: @@ -6764,8 +6780,8 @@ inline int DataCommandChoice::selectionId() const return d_selectionId; } -template -int DataCommandChoice::accessSelection(ACCESSOR& accessor) const +template +int DataCommandChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_N: @@ -6885,37 +6901,14 @@ inline bool DataCommandChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::DataCommandChoice& object) -{ - typedef m_bmqtool::DataCommandChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_N: hashAppend(hashAlg, object.n()); break; - case Class::SELECTION_ID_NEXT: hashAppend(hashAlg, object.next()); break; - case Class::SELECTION_ID_P: hashAppend(hashAlg, object.p()); break; - case Class::SELECTION_ID_PREV: hashAppend(hashAlg, object.prev()); break; - case Class::SELECTION_ID_R: hashAppend(hashAlg, object.r()); break; - case Class::SELECTION_ID_RECORD: - hashAppend(hashAlg, object.record()); - break; - case Class::SELECTION_ID_LIST: hashAppend(hashAlg, object.list()); break; - case Class::SELECTION_ID_L: hashAppend(hashAlg, object.l()); break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // ---------------------- // class DumpQueueCommand // ---------------------- // CLASS METHODS // MANIPULATORS -template -int DumpQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int DumpQueueCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -6929,11 +6922,11 @@ int DumpQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int DumpQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int DumpQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -6948,10 +6941,10 @@ int DumpQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int DumpQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int DumpQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -6975,8 +6968,8 @@ inline bsl::string& DumpQueueCommand::key() } // ACCESSORS -template -int DumpQueueCommand::accessAttributes(ACCESSOR& accessor) const +template +int DumpQueueCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -6990,11 +6983,11 @@ int DumpQueueCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int DumpQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int DumpQueueCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -7009,8 +7002,8 @@ int DumpQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int DumpQueueCommand::accessAttribute(ACCESSOR& accessor, +template +int DumpQueueCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7035,17 +7028,6 @@ inline const bsl::string& DumpQueueCommand::key() const return d_key; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::DumpQueueCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.key()); -} - // ------------------------------ // class JournalCommandChoiceType // ------------------------------ @@ -7072,8 +7054,8 @@ JournalCommandChoiceType::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int ListCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int ListCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -7082,11 +7064,11 @@ int ListCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ListCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ListCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -7098,10 +7080,10 @@ int ListCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ListCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ListCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -7120,8 +7102,8 @@ inline bdlb::NullableValue& ListCommand::uri() } // ACCESSORS -template -int ListCommand::accessAttributes(ACCESSOR& accessor) const +template +int ListCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -7130,11 +7112,11 @@ int ListCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ListCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int ListCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -7146,8 +7128,8 @@ int ListCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ListCommand::accessAttribute(ACCESSOR& accessor, +template +int ListCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7167,32 +7149,21 @@ inline const bdlb::NullableValue& ListCommand::uri() const return d_uri; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::ListCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); -} - // ----------------------- // class ListQueuesCommand // ----------------------- // CLASS METHODS // MANIPULATORS -template -int ListQueuesCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int ListQueuesCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int ListQueuesCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int ListQueuesCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -7202,10 +7173,10 @@ int ListQueuesCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int ListQueuesCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ListQueuesCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -7219,17 +7190,15 @@ int ListQueuesCommand::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int ListQueuesCommand::accessAttributes(ACCESSOR& accessor) const +template +int ListQueuesCommand::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int ListQueuesCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int ListQueuesCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -7239,8 +7208,8 @@ int ListQueuesCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ListQueuesCommand::accessAttribute(ACCESSOR& accessor, +template +int ListQueuesCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7255,15 +7224,6 @@ int ListQueuesCommand::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::ListQueuesCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------- // class MessagePropertyType // ------------------------- @@ -7290,17 +7250,15 @@ MessagePropertyType::print(bsl::ostream& stream, // CLASS METHODS // MANIPULATORS -template -int MetadataCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int MetadataCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { (void)manipulator; - int ret = 0; - - return ret; + return 0; } -template -int MetadataCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int MetadataCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { (void)manipulator; enum { NOT_FOUND = -1 }; @@ -7310,10 +7268,10 @@ int MetadataCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int MetadataCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int MetadataCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -7327,17 +7285,15 @@ int MetadataCommand::manipulateAttribute(MANIPULATOR& manipulator, } // ACCESSORS -template -int MetadataCommand::accessAttributes(ACCESSOR& accessor) const +template +int MetadataCommand::accessAttributes(t_ACCESSOR& accessor) const { (void)accessor; - int ret = 0; - - return ret; + return 0; } -template -int MetadataCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int MetadataCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { (void)accessor; enum { NOT_FOUND = -1 }; @@ -7347,8 +7303,8 @@ int MetadataCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int MetadataCommand::accessAttribute(ACCESSOR& accessor, +template +int MetadataCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7363,23 +7319,14 @@ int MetadataCommand::accessAttribute(ACCESSOR& accessor, return accessAttribute(accessor, attributeInfo->d_id); } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::MetadataCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; -} - // ------------------------ // class OpenStorageCommand // ------------------------ // CLASS METHODS // MANIPULATORS -template -int OpenStorageCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int OpenStorageCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -7388,11 +7335,11 @@ int OpenStorageCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int OpenStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int OpenStorageCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -7405,10 +7352,10 @@ int OpenStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int OpenStorageCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int OpenStorageCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -7427,8 +7374,8 @@ inline bsl::string& OpenStorageCommand::path() } // ACCESSORS -template -int OpenStorageCommand::accessAttributes(ACCESSOR& accessor) const +template +int OpenStorageCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -7437,11 +7384,11 @@ int OpenStorageCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int OpenStorageCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int OpenStorageCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -7453,8 +7400,8 @@ int OpenStorageCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int OpenStorageCommand::accessAttribute(ACCESSOR& accessor, +template +int OpenStorageCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7474,21 +7421,62 @@ inline const bsl::string& OpenStorageCommand::path() const return d_path; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::OpenStorageCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.path()); -} - // ------------------------ // class QlistCommandChoice // ------------------------ // CLASS METHODS +// PRIVATE ACCESSORS +template +void QlistCommandChoice::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef QlistCommandChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_N: hashAppend(hashAlgorithm, this->n()); break; + case Class::SELECTION_ID_NEXT: + hashAppend(hashAlgorithm, this->next()); + break; + case Class::SELECTION_ID_P: hashAppend(hashAlgorithm, this->p()); break; + case Class::SELECTION_ID_PREV: + hashAppend(hashAlgorithm, this->prev()); + break; + case Class::SELECTION_ID_R: hashAppend(hashAlgorithm, this->r()); break; + case Class::SELECTION_ID_RECORD: + hashAppend(hashAlgorithm, this->record()); + break; + case Class::SELECTION_ID_LIST: + hashAppend(hashAlgorithm, this->list()); + break; + case Class::SELECTION_ID_L: hashAppend(hashAlgorithm, this->l()); break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool QlistCommandChoice::isEqualTo(const QlistCommandChoice& rhs) const +{ + typedef QlistCommandChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_N: return this->n() == rhs.n(); + case Class::SELECTION_ID_NEXT: return this->next() == rhs.next(); + case Class::SELECTION_ID_P: return this->p() == rhs.p(); + case Class::SELECTION_ID_PREV: return this->prev() == rhs.prev(); + case Class::SELECTION_ID_R: return this->r() == rhs.r(); + case Class::SELECTION_ID_RECORD: return this->record() == rhs.record(); + case Class::SELECTION_ID_LIST: return this->list() == rhs.list(); + case Class::SELECTION_ID_L: return this->l() == rhs.l(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline QlistCommandChoice::QlistCommandChoice() : d_selectionId(SELECTION_ID_UNDEFINED) @@ -7501,8 +7489,8 @@ inline QlistCommandChoice::~QlistCommandChoice() } // MANIPULATORS -template -int QlistCommandChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int QlistCommandChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case QlistCommandChoice::SELECTION_ID_N: @@ -7590,8 +7578,8 @@ inline int QlistCommandChoice::selectionId() const return d_selectionId; } -template -int QlistCommandChoice::accessSelection(ACCESSOR& accessor) const +template +int QlistCommandChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_N: @@ -7711,37 +7699,14 @@ inline bool QlistCommandChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::QlistCommandChoice& object) -{ - typedef m_bmqtool::QlistCommandChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_N: hashAppend(hashAlg, object.n()); break; - case Class::SELECTION_ID_NEXT: hashAppend(hashAlg, object.next()); break; - case Class::SELECTION_ID_P: hashAppend(hashAlg, object.p()); break; - case Class::SELECTION_ID_PREV: hashAppend(hashAlg, object.prev()); break; - case Class::SELECTION_ID_R: hashAppend(hashAlg, object.r()); break; - case Class::SELECTION_ID_RECORD: - hashAppend(hashAlg, object.record()); - break; - case Class::SELECTION_ID_LIST: hashAppend(hashAlg, object.list()); break; - case Class::SELECTION_ID_L: hashAppend(hashAlg, object.l()); break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // ------------------ // class StartCommand // ------------------ // CLASS METHODS // MANIPULATORS -template -int StartCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int StartCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -7750,11 +7715,11 @@ int StartCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StartCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StartCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -7767,10 +7732,10 @@ int StartCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StartCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StartCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -7789,8 +7754,8 @@ inline bool& StartCommand::async() } // ACCESSORS -template -int StartCommand::accessAttributes(ACCESSOR& accessor) const +template +int StartCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -7799,11 +7764,11 @@ int StartCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StartCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int StartCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -7815,8 +7780,8 @@ int StartCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StartCommand::accessAttribute(ACCESSOR& accessor, +template +int StartCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7836,23 +7801,14 @@ inline bool StartCommand::async() const return d_async; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::StartCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.async()); -} - // ----------------- // class StopCommand // ----------------- // CLASS METHODS // MANIPULATORS -template -int StopCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int StopCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -7861,11 +7817,11 @@ int StopCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int StopCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int StopCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -7878,10 +7834,10 @@ int StopCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int StopCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int StopCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -7900,8 +7856,8 @@ inline bool& StopCommand::async() } // ACCESSORS -template -int StopCommand::accessAttributes(ACCESSOR& accessor) const +template +int StopCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -7910,11 +7866,11 @@ int StopCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int StopCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int StopCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -7926,8 +7882,8 @@ int StopCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int StopCommand::accessAttribute(ACCESSOR& accessor, +template +int StopCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -7947,23 +7903,35 @@ inline bool StopCommand::async() const return d_async; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::StopCommand& object) +// ------------------ +// class Subscription +// ------------------ + +// PRIVATE ACCESSORS +template +void Subscription::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.async()); + hashAppend(hashAlgorithm, this->correlationId()); + hashAppend(hashAlgorithm, this->expression()); + hashAppend(hashAlgorithm, this->maxUnconfirmedMessages()); + hashAppend(hashAlgorithm, this->maxUnconfirmedBytes()); + hashAppend(hashAlgorithm, this->consumerPriority()); } -// ------------------ -// class Subscription -// ------------------ +inline bool Subscription::isEqualTo(const Subscription& rhs) const +{ + return this->correlationId() == rhs.correlationId() && + this->expression() == rhs.expression() && + this->maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && + this->maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && + this->consumerPriority() == rhs.consumerPriority(); +} // CLASS METHODS // MANIPULATORS -template -int Subscription::manipulateAttributes(MANIPULATOR& manipulator) +template +int Subscription::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -7999,11 +7967,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 }; @@ -8036,10 +8004,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 }; @@ -8078,8 +8046,8 @@ inline bdlb::NullableValue& Subscription::consumerPriority() } // ACCESSORS -template -int Subscription::accessAttributes(ACCESSOR& accessor) const +template +int Subscription::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -8115,11 +8083,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 }; @@ -8151,8 +8119,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 { @@ -8195,27 +8163,38 @@ inline const bdlb::NullableValue& Subscription::consumerPriority() const return d_consumerPriority; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::Subscription& object) +// --------------------------- +// class ConfigureQueueCommand +// --------------------------- + +// PRIVATE ACCESSORS +template +void ConfigureQueueCommand::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.correlationId()); - hashAppend(hashAlg, object.expression()); - hashAppend(hashAlg, object.maxUnconfirmedMessages()); - hashAppend(hashAlg, object.maxUnconfirmedBytes()); - hashAppend(hashAlg, object.consumerPriority()); + hashAppend(hashAlgorithm, this->uri()); + hashAppend(hashAlgorithm, this->async()); + hashAppend(hashAlgorithm, this->maxUnconfirmedMessages()); + hashAppend(hashAlgorithm, this->maxUnconfirmedBytes()); + hashAppend(hashAlgorithm, this->consumerPriority()); + hashAppend(hashAlgorithm, this->subscriptions()); } -// --------------------------- -// class ConfigureQueueCommand -// --------------------------- +inline bool +ConfigureQueueCommand::isEqualTo(const ConfigureQueueCommand& rhs) const +{ + return this->uri() == rhs.uri() && this->async() == rhs.async() && + this->maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && + this->maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && + this->consumerPriority() == rhs.consumerPriority() && + this->subscriptions() == rhs.subscriptions(); +} // CLASS METHODS // MANIPULATORS -template -int ConfigureQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int ConfigureQueueCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -8255,12 +8234,12 @@ int ConfigureQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int ConfigureQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int ConfigureQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -8296,10 +8275,10 @@ int ConfigureQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int ConfigureQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int ConfigureQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -8343,8 +8322,8 @@ inline bsl::vector& ConfigureQueueCommand::subscriptions() } // ACCESSORS -template -int ConfigureQueueCommand::accessAttributes(ACCESSOR& accessor) const +template +int ConfigureQueueCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -8384,11 +8363,11 @@ int ConfigureQueueCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int ConfigureQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int ConfigureQueueCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -8422,8 +8401,8 @@ int ConfigureQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int ConfigureQueueCommand::accessAttribute(ACCESSOR& accessor, +template +int ConfigureQueueCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -8469,29 +8448,14 @@ ConfigureQueueCommand::subscriptions() const return d_subscriptions; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::ConfigureQueueCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.async()); - hashAppend(hashAlg, object.maxUnconfirmedMessages()); - hashAppend(hashAlg, object.maxUnconfirmedBytes()); - hashAppend(hashAlg, object.consumerPriority()); - hashAppend(hashAlg, object.subscriptions()); -} - // ----------------- // class DataCommand // ----------------- // CLASS METHODS // MANIPULATORS -template -int DataCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int DataCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -8500,11 +8464,11 @@ int DataCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int DataCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int DataCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -8517,10 +8481,10 @@ int DataCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int DataCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int DataCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -8539,8 +8503,8 @@ inline DataCommandChoice& DataCommand::choice() } // ACCESSORS -template -int DataCommand::accessAttributes(ACCESSOR& accessor) const +template +int DataCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -8549,11 +8513,11 @@ int DataCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int DataCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int DataCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -8566,8 +8530,8 @@ int DataCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int DataCommand::accessAttribute(ACCESSOR& accessor, +template +int DataCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -8587,20 +8551,72 @@ inline const DataCommandChoice& DataCommand::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::DataCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); -} - // -------------------------- // class JournalCommandChoice // -------------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void JournalCommandChoice::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef JournalCommandChoice Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_N: hashAppend(hashAlgorithm, this->n()); break; + case Class::SELECTION_ID_NEXT: + hashAppend(hashAlgorithm, this->next()); + break; + case Class::SELECTION_ID_P: hashAppend(hashAlgorithm, this->p()); break; + case Class::SELECTION_ID_PREV: + hashAppend(hashAlgorithm, this->prev()); + break; + case Class::SELECTION_ID_R: hashAppend(hashAlgorithm, this->r()); break; + case Class::SELECTION_ID_RECORD: + hashAppend(hashAlgorithm, this->record()); + break; + case Class::SELECTION_ID_LIST: + hashAppend(hashAlgorithm, this->list()); + break; + case Class::SELECTION_ID_L: hashAppend(hashAlgorithm, this->l()); break; + case Class::SELECTION_ID_DUMP: + hashAppend(hashAlgorithm, this->dump()); + break; + case Class::SELECTION_ID_TYPE: + hashAppend(hashAlgorithm, this->type()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool +JournalCommandChoice::isEqualTo(const JournalCommandChoice& rhs) const +{ + typedef JournalCommandChoice Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_N: return this->n() == rhs.n(); + case Class::SELECTION_ID_NEXT: return this->next() == rhs.next(); + case Class::SELECTION_ID_P: return this->p() == rhs.p(); + case Class::SELECTION_ID_PREV: return this->prev() == rhs.prev(); + case Class::SELECTION_ID_R: return this->r() == rhs.r(); + case Class::SELECTION_ID_RECORD: return this->record() == rhs.record(); + case Class::SELECTION_ID_LIST: return this->list() == rhs.list(); + case Class::SELECTION_ID_L: return this->l() == rhs.l(); + case Class::SELECTION_ID_DUMP: return this->dump() == rhs.dump(); + case Class::SELECTION_ID_TYPE: return this->type() == rhs.type(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline JournalCommandChoice::JournalCommandChoice( bslma::Allocator* basicAllocator) @@ -8615,8 +8631,8 @@ inline JournalCommandChoice::~JournalCommandChoice() } // MANIPULATORS -template -int JournalCommandChoice::manipulateSelection(MANIPULATOR& manipulator) +template +int JournalCommandChoice::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case JournalCommandChoice::SELECTION_ID_N: @@ -8722,8 +8738,8 @@ inline int JournalCommandChoice::selectionId() const return d_selectionId; } -template -int JournalCommandChoice::accessSelection(ACCESSOR& accessor) const +template +int JournalCommandChoice::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_N: @@ -8872,39 +8888,24 @@ inline bool JournalCommandChoice::isUndefinedValue() const return SELECTION_ID_UNDEFINED == d_selectionId; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::JournalCommandChoice& object) -{ - typedef m_bmqtool::JournalCommandChoice Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_N: hashAppend(hashAlg, object.n()); break; - case Class::SELECTION_ID_NEXT: hashAppend(hashAlg, object.next()); break; - case Class::SELECTION_ID_P: hashAppend(hashAlg, object.p()); break; - case Class::SELECTION_ID_PREV: hashAppend(hashAlg, object.prev()); break; - case Class::SELECTION_ID_R: hashAppend(hashAlg, object.r()); break; - case Class::SELECTION_ID_RECORD: - hashAppend(hashAlg, object.record()); - break; - case Class::SELECTION_ID_LIST: hashAppend(hashAlg, object.list()); break; - case Class::SELECTION_ID_L: hashAppend(hashAlg, object.l()); break; - case Class::SELECTION_ID_DUMP: hashAppend(hashAlg, object.dump()); break; - case Class::SELECTION_ID_TYPE: hashAppend(hashAlg, object.type()); break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - // --------------------- // class MessageProperty // --------------------- +// PRIVATE ACCESSORS +template +void MessageProperty::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->name()); + hashAppend(hashAlgorithm, this->value()); + hashAppend(hashAlgorithm, this->type()); +} + // CLASS METHODS // MANIPULATORS -template -int MessageProperty::manipulateAttributes(MANIPULATOR& manipulator) +template +int MessageProperty::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -8923,11 +8924,11 @@ int MessageProperty::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int MessageProperty::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int MessageProperty::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -8948,10 +8949,10 @@ int MessageProperty::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int MessageProperty::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int MessageProperty::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -8980,8 +8981,8 @@ inline MessagePropertyType::Value& MessageProperty::type() } // ACCESSORS -template -int MessageProperty::accessAttributes(ACCESSOR& accessor) const +template +int MessageProperty::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -9000,11 +9001,11 @@ int MessageProperty::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int MessageProperty::accessAttribute(ACCESSOR& accessor, int id) const +template +int MessageProperty::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -9022,8 +9023,8 @@ int MessageProperty::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int MessageProperty::accessAttribute(ACCESSOR& accessor, +template +int MessageProperty::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -9053,29 +9054,41 @@ inline MessagePropertyType::Value MessageProperty::type() const return d_type; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::MessageProperty& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.name()); - hashAppend(hashAlg, object.value()); - hashAppend(hashAlg, object.type()); -} - // ---------------------- // class OpenQueueCommand // ---------------------- -// CLASS METHODS -// MANIPULATORS -template -int OpenQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) +// PRIVATE ACCESSORS +template +void OpenQueueCommand::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - int ret; - + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->uri()); + hashAppend(hashAlgorithm, this->flags()); + hashAppend(hashAlgorithm, this->async()); + hashAppend(hashAlgorithm, this->maxUnconfirmedMessages()); + hashAppend(hashAlgorithm, this->maxUnconfirmedBytes()); + hashAppend(hashAlgorithm, this->consumerPriority()); + hashAppend(hashAlgorithm, this->subscriptions()); +} + +inline bool OpenQueueCommand::isEqualTo(const OpenQueueCommand& rhs) const +{ + return this->uri() == rhs.uri() && this->flags() == rhs.flags() && + this->async() == rhs.async() && + this->maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && + this->maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && + this->consumerPriority() == rhs.consumerPriority() && + this->subscriptions() == rhs.subscriptions(); +} + +// CLASS METHODS +// MANIPULATORS +template +int OpenQueueCommand::manipulateAttributes(t_MANIPULATOR& manipulator) +{ + int ret; + ret = manipulator(&d_uri, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_URI]); if (ret) { return ret; @@ -9117,11 +9130,11 @@ int OpenQueueCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int OpenQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int OpenQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -9161,10 +9174,10 @@ int OpenQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int OpenQueueCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int OpenQueueCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -9213,8 +9226,8 @@ inline bsl::vector& OpenQueueCommand::subscriptions() } // ACCESSORS -template -int OpenQueueCommand::accessAttributes(ACCESSOR& accessor) const +template +int OpenQueueCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -9259,11 +9272,11 @@ int OpenQueueCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int OpenQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int OpenQueueCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -9300,8 +9313,8 @@ int OpenQueueCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int OpenQueueCommand::accessAttribute(ACCESSOR& accessor, +template +int OpenQueueCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -9351,30 +9364,14 @@ inline const bsl::vector& OpenQueueCommand::subscriptions() const return d_subscriptions; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::OpenQueueCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.flags()); - hashAppend(hashAlg, object.async()); - hashAppend(hashAlg, object.maxUnconfirmedMessages()); - hashAppend(hashAlg, object.maxUnconfirmedBytes()); - hashAppend(hashAlg, object.consumerPriority()); - hashAppend(hashAlg, object.subscriptions()); -} - // ------------------ // class QlistCommand // ------------------ // CLASS METHODS // MANIPULATORS -template -int QlistCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int QlistCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -9383,11 +9380,11 @@ int QlistCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int QlistCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int QlistCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -9400,10 +9397,10 @@ int QlistCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int QlistCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int QlistCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -9422,8 +9419,8 @@ inline QlistCommandChoice& QlistCommand::choice() } // ACCESSORS -template -int QlistCommand::accessAttributes(ACCESSOR& accessor) const +template +int QlistCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -9432,11 +9429,11 @@ int QlistCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int QlistCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int QlistCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -9449,8 +9446,8 @@ int QlistCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int QlistCommand::accessAttribute(ACCESSOR& accessor, +template +int QlistCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -9470,23 +9467,76 @@ inline const QlistCommandChoice& QlistCommand::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::QlistCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); -} - // --------------------------- // class CommandLineParameters // --------------------------- +// PRIVATE ACCESSORS +template +void CommandLineParameters::hashAppendImpl( + t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->mode()); + hashAppend(hashAlgorithm, this->broker()); + hashAppend(hashAlgorithm, this->queueUri()); + hashAppend(hashAlgorithm, this->queueFlags()); + hashAppend(hashAlgorithm, this->latency()); + hashAppend(hashAlgorithm, this->latencyReport()); + hashAppend(hashAlgorithm, this->dumpMsg()); + hashAppend(hashAlgorithm, this->confirmMsg()); + hashAppend(hashAlgorithm, this->eventSize()); + hashAppend(hashAlgorithm, this->msgSize()); + hashAppend(hashAlgorithm, this->postRate()); + hashAppend(hashAlgorithm, this->eventsCount()); + hashAppend(hashAlgorithm, this->maxUnconfirmed()); + hashAppend(hashAlgorithm, this->postInterval()); + hashAppend(hashAlgorithm, this->verbosity()); + hashAppend(hashAlgorithm, this->logFormat()); + hashAppend(hashAlgorithm, this->memoryDebug()); + hashAppend(hashAlgorithm, this->threads()); + hashAppend(hashAlgorithm, this->shutdownGrace()); + hashAppend(hashAlgorithm, this->noSessionEventHandler()); + hashAppend(hashAlgorithm, this->storage()); + hashAppend(hashAlgorithm, this->log()); + hashAppend(hashAlgorithm, this->sequentialMessagePattern()); + hashAppend(hashAlgorithm, this->messageProperties()); + hashAppend(hashAlgorithm, this->subscriptions()); +} + +inline bool +CommandLineParameters::isEqualTo(const CommandLineParameters& rhs) const +{ + return this->mode() == rhs.mode() && this->broker() == rhs.broker() && + this->queueUri() == rhs.queueUri() && + this->queueFlags() == rhs.queueFlags() && + this->latency() == rhs.latency() && + this->latencyReport() == rhs.latencyReport() && + this->dumpMsg() == rhs.dumpMsg() && + this->confirmMsg() == rhs.confirmMsg() && + this->eventSize() == rhs.eventSize() && + this->msgSize() == rhs.msgSize() && + this->postRate() == rhs.postRate() && + this->eventsCount() == rhs.eventsCount() && + this->maxUnconfirmed() == rhs.maxUnconfirmed() && + this->postInterval() == rhs.postInterval() && + this->verbosity() == rhs.verbosity() && + this->logFormat() == rhs.logFormat() && + this->memoryDebug() == rhs.memoryDebug() && + this->threads() == rhs.threads() && + this->shutdownGrace() == rhs.shutdownGrace() && + this->noSessionEventHandler() == rhs.noSessionEventHandler() && + this->storage() == rhs.storage() && this->log() == rhs.log() && + this->sequentialMessagePattern() == + rhs.sequentialMessagePattern() && + this->messageProperties() == rhs.messageProperties() && + this->subscriptions() == rhs.subscriptions(); +} + // CLASS METHODS // MANIPULATORS -template -int CommandLineParameters::manipulateAttributes(MANIPULATOR& manipulator) +template +int CommandLineParameters::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -9640,12 +9690,12 @@ int CommandLineParameters::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int CommandLineParameters::manipulateAttribute(MANIPULATOR& manipulator, - int id) +template +int CommandLineParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + int id) { enum { NOT_FOUND = -1 }; @@ -9761,10 +9811,10 @@ int CommandLineParameters::manipulateAttribute(MANIPULATOR& manipulator, } } -template -int CommandLineParameters::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int CommandLineParameters::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -9817,7 +9867,7 @@ inline bool& CommandLineParameters::confirmMsg() return d_confirmMsg; } -inline int& CommandLineParameters::eventSize() +inline bsls::Types::Int64& CommandLineParameters::eventSize() { return d_eventSize; } @@ -9903,8 +9953,8 @@ inline bsl::vector& CommandLineParameters::subscriptions() } // ACCESSORS -template -int CommandLineParameters::accessAttributes(ACCESSOR& accessor) const +template +int CommandLineParameters::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -10052,11 +10102,11 @@ int CommandLineParameters::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int CommandLineParameters::accessAttribute(ACCESSOR& accessor, int id) const +template +int CommandLineParameters::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -10166,8 +10216,8 @@ int CommandLineParameters::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int CommandLineParameters::accessAttribute(ACCESSOR& accessor, +template +int CommandLineParameters::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -10222,7 +10272,7 @@ inline bool CommandLineParameters::confirmMsg() const return d_confirmMsg; } -inline int CommandLineParameters::eventSize() const +inline bsls::Types::Int64 CommandLineParameters::eventSize() const { return d_eventSize; } @@ -10310,48 +10360,14 @@ CommandLineParameters::subscriptions() const return d_subscriptions; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::CommandLineParameters& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.mode()); - hashAppend(hashAlg, object.broker()); - hashAppend(hashAlg, object.queueUri()); - hashAppend(hashAlg, object.queueFlags()); - hashAppend(hashAlg, object.latency()); - hashAppend(hashAlg, object.latencyReport()); - hashAppend(hashAlg, object.dumpMsg()); - hashAppend(hashAlg, object.confirmMsg()); - hashAppend(hashAlg, object.eventSize()); - hashAppend(hashAlg, object.msgSize()); - hashAppend(hashAlg, object.postRate()); - hashAppend(hashAlg, object.eventsCount()); - hashAppend(hashAlg, object.maxUnconfirmed()); - hashAppend(hashAlg, object.postInterval()); - hashAppend(hashAlg, object.verbosity()); - hashAppend(hashAlg, object.logFormat()); - hashAppend(hashAlg, object.memoryDebug()); - hashAppend(hashAlg, object.threads()); - hashAppend(hashAlg, object.shutdownGrace()); - hashAppend(hashAlg, object.noSessionEventHandler()); - hashAppend(hashAlg, object.storage()); - hashAppend(hashAlg, object.log()); - hashAppend(hashAlg, object.sequentialMessagePattern()); - hashAppend(hashAlg, object.messageProperties()); - hashAppend(hashAlg, object.subscriptions()); -} - // -------------------- // class JournalCommand // -------------------- // CLASS METHODS // MANIPULATORS -template -int JournalCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int JournalCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -10360,11 +10376,11 @@ int JournalCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int JournalCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int JournalCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -10377,10 +10393,10 @@ int JournalCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int JournalCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int JournalCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -10399,8 +10415,8 @@ inline JournalCommandChoice& JournalCommand::choice() } // ACCESSORS -template -int JournalCommand::accessAttributes(ACCESSOR& accessor) const +template +int JournalCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -10409,11 +10425,11 @@ int JournalCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int JournalCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int JournalCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -10426,8 +10442,8 @@ int JournalCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int JournalCommand::accessAttribute(ACCESSOR& accessor, +template +int JournalCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -10447,24 +10463,36 @@ inline const JournalCommandChoice& JournalCommand::choice() const return d_choice; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, - const m_bmqtool::JournalCommand& object) +// ----------------- +// class PostCommand +// ----------------- + +// PRIVATE ACCESSORS +template +void PostCommand::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - (void)hashAlg; - (void)object; using bslh::hashAppend; - hashAppend(hashAlg, object.choice()); + hashAppend(hashAlgorithm, this->uri()); + hashAppend(hashAlgorithm, this->payload()); + hashAppend(hashAlgorithm, this->async()); + hashAppend(hashAlgorithm, this->groupid()); + hashAppend(hashAlgorithm, this->compressionAlgorithmType()); + hashAppend(hashAlgorithm, this->messageProperties()); } -// ----------------- -// class PostCommand -// ----------------- +inline bool PostCommand::isEqualTo(const PostCommand& rhs) const +{ + return this->uri() == rhs.uri() && this->payload() == rhs.payload() && + this->async() == rhs.async() && this->groupid() == rhs.groupid() && + this->compressionAlgorithmType() == + rhs.compressionAlgorithmType() && + this->messageProperties() == rhs.messageProperties(); +} // CLASS METHODS // MANIPULATORS -template -int PostCommand::manipulateAttributes(MANIPULATOR& manipulator) +template +int PostCommand::manipulateAttributes(t_MANIPULATOR& manipulator) { int ret; @@ -10504,11 +10532,11 @@ int PostCommand::manipulateAttributes(MANIPULATOR& manipulator) return ret; } - return ret; + return 0; } -template -int PostCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) +template +int PostCommand::manipulateAttribute(t_MANIPULATOR& manipulator, int id) { enum { NOT_FOUND = -1 }; @@ -10542,10 +10570,10 @@ int PostCommand::manipulateAttribute(MANIPULATOR& manipulator, int id) } } -template -int PostCommand::manipulateAttribute(MANIPULATOR& manipulator, - const char* name, - int nameLength) +template +int PostCommand::manipulateAttribute(t_MANIPULATOR& manipulator, + const char* name, + int nameLength) { enum { NOT_FOUND = -1 }; @@ -10589,8 +10617,8 @@ inline bsl::vector& PostCommand::messageProperties() } // ACCESSORS -template -int PostCommand::accessAttributes(ACCESSOR& accessor) const +template +int PostCommand::accessAttributes(t_ACCESSOR& accessor) const { int ret; @@ -10627,11 +10655,11 @@ int PostCommand::accessAttributes(ACCESSOR& accessor) const return ret; } - return ret; + return 0; } -template -int PostCommand::accessAttribute(ACCESSOR& accessor, int id) const +template +int PostCommand::accessAttribute(t_ACCESSOR& accessor, int id) const { enum { NOT_FOUND = -1 }; @@ -10664,8 +10692,8 @@ int PostCommand::accessAttribute(ACCESSOR& accessor, int id) const } } -template -int PostCommand::accessAttribute(ACCESSOR& accessor, +template +int PostCommand::accessAttribute(t_ACCESSOR& accessor, const char* name, int nameLength) const { @@ -10711,25 +10739,112 @@ PostCommand::messageProperties() const return d_messageProperties; } -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::PostCommand& object) -{ - (void)hashAlg; - (void)object; - using bslh::hashAppend; - hashAppend(hashAlg, object.uri()); - hashAppend(hashAlg, object.payload()); - hashAppend(hashAlg, object.async()); - hashAppend(hashAlg, object.groupid()); - hashAppend(hashAlg, object.compressionAlgorithmType()); - hashAppend(hashAlg, object.messageProperties()); -} - // ------------- // class Command // ------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void Command::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef Command Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_START: + hashAppend(hashAlgorithm, this->start()); + break; + case Class::SELECTION_ID_STOP: + hashAppend(hashAlgorithm, this->stop()); + break; + case Class::SELECTION_ID_OPEN_QUEUE: + hashAppend(hashAlgorithm, this->openQueue()); + break; + case Class::SELECTION_ID_CONFIGURE_QUEUE: + hashAppend(hashAlgorithm, this->configureQueue()); + break; + case Class::SELECTION_ID_CLOSE_QUEUE: + hashAppend(hashAlgorithm, this->closeQueue()); + break; + case Class::SELECTION_ID_POST: + hashAppend(hashAlgorithm, this->post()); + break; + case Class::SELECTION_ID_LIST: + hashAppend(hashAlgorithm, this->list()); + break; + case Class::SELECTION_ID_CONFIRM: + hashAppend(hashAlgorithm, this->confirm()); + break; + case Class::SELECTION_ID_OPEN_STORAGE: + hashAppend(hashAlgorithm, this->openStorage()); + break; + case Class::SELECTION_ID_CLOSE_STORAGE: + hashAppend(hashAlgorithm, this->closeStorage()); + break; + case Class::SELECTION_ID_METADATA: + hashAppend(hashAlgorithm, this->metadata()); + break; + case Class::SELECTION_ID_LIST_QUEUES: + hashAppend(hashAlgorithm, this->listQueues()); + break; + case Class::SELECTION_ID_DUMP_QUEUE: + hashAppend(hashAlgorithm, this->dumpQueue()); + break; + case Class::SELECTION_ID_DATA: + hashAppend(hashAlgorithm, this->data()); + break; + case Class::SELECTION_ID_QLIST: + hashAppend(hashAlgorithm, this->qlist()); + break; + case Class::SELECTION_ID_JOURNAL: + hashAppend(hashAlgorithm, this->journal()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool Command::isEqualTo(const Command& rhs) const +{ + typedef Command Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_START: return this->start() == rhs.start(); + case Class::SELECTION_ID_STOP: return this->stop() == rhs.stop(); + case Class::SELECTION_ID_OPEN_QUEUE: + return this->openQueue() == rhs.openQueue(); + case Class::SELECTION_ID_CONFIGURE_QUEUE: + return this->configureQueue() == rhs.configureQueue(); + case Class::SELECTION_ID_CLOSE_QUEUE: + return this->closeQueue() == rhs.closeQueue(); + case Class::SELECTION_ID_POST: return this->post() == rhs.post(); + case Class::SELECTION_ID_LIST: return this->list() == rhs.list(); + case Class::SELECTION_ID_CONFIRM: + return this->confirm() == rhs.confirm(); + case Class::SELECTION_ID_OPEN_STORAGE: + return this->openStorage() == rhs.openStorage(); + case Class::SELECTION_ID_CLOSE_STORAGE: + return this->closeStorage() == rhs.closeStorage(); + case Class::SELECTION_ID_METADATA: + return this->metadata() == rhs.metadata(); + case Class::SELECTION_ID_LIST_QUEUES: + return this->listQueues() == rhs.listQueues(); + case Class::SELECTION_ID_DUMP_QUEUE: + return this->dumpQueue() == rhs.dumpQueue(); + case Class::SELECTION_ID_DATA: return this->data() == rhs.data(); + case Class::SELECTION_ID_QLIST: return this->qlist() == rhs.qlist(); + case Class::SELECTION_ID_JOURNAL: + return this->journal() == rhs.journal(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline Command::Command(bslma::Allocator* basicAllocator) : d_selectionId(SELECTION_ID_UNDEFINED) @@ -10743,8 +10858,8 @@ inline Command::~Command() } // MANIPULATORS -template -int Command::manipulateSelection(MANIPULATOR& manipulator) +template +int Command::manipulateSelection(t_MANIPULATOR& manipulator) { switch (d_selectionId) { case Command::SELECTION_ID_START: @@ -10905,8 +11020,8 @@ inline int Command::selectionId() const return d_selectionId; } -template -int Command::accessSelection(ACCESSOR& accessor) const +template +int Command::accessSelection(t_ACCESSOR& accessor) const { switch (d_selectionId) { case SELECTION_ID_START: @@ -11141,635 +11256,13 @@ inline bool Command::isUndefinedValue() const { return SELECTION_ID_UNDEFINED == d_selectionId; } - -template -void hashAppend(HASH_ALGORITHM& hashAlg, const m_bmqtool::Command& object) -{ - typedef m_bmqtool::Command Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_START: hashAppend(hashAlg, object.start()); break; - case Class::SELECTION_ID_STOP: hashAppend(hashAlg, object.stop()); break; - case Class::SELECTION_ID_OPEN_QUEUE: - hashAppend(hashAlg, object.openQueue()); - break; - case Class::SELECTION_ID_CONFIGURE_QUEUE: - hashAppend(hashAlg, object.configureQueue()); - break; - case Class::SELECTION_ID_CLOSE_QUEUE: - hashAppend(hashAlg, object.closeQueue()); - break; - case Class::SELECTION_ID_POST: hashAppend(hashAlg, object.post()); break; - case Class::SELECTION_ID_LIST: hashAppend(hashAlg, object.list()); break; - case Class::SELECTION_ID_CONFIRM: - hashAppend(hashAlg, object.confirm()); - break; - case Class::SELECTION_ID_OPEN_STORAGE: - hashAppend(hashAlg, object.openStorage()); - break; - case Class::SELECTION_ID_CLOSE_STORAGE: - hashAppend(hashAlg, object.closeStorage()); - break; - case Class::SELECTION_ID_METADATA: - hashAppend(hashAlg, object.metadata()); - break; - case Class::SELECTION_ID_LIST_QUEUES: - hashAppend(hashAlg, object.listQueues()); - break; - case Class::SELECTION_ID_DUMP_QUEUE: - hashAppend(hashAlg, object.dumpQueue()); - break; - case Class::SELECTION_ID_DATA: hashAppend(hashAlg, object.data()); break; - case Class::SELECTION_ID_QLIST: hashAppend(hashAlg, object.qlist()); break; - case Class::SELECTION_ID_JOURNAL: - hashAppend(hashAlg, object.journal()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} } // close package namespace // FREE FUNCTIONS -inline bool m_bmqtool::operator==(const m_bmqtool::CloseQueueCommand& lhs, - const m_bmqtool::CloseQueueCommand& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.async() == rhs.async(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::CloseQueueCommand& lhs, - const m_bmqtool::CloseQueueCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::CloseQueueCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::CloseStorageCommand&, - const m_bmqtool::CloseStorageCommand&) -{ - return true; -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::CloseStorageCommand&, - const m_bmqtool::CloseStorageCommand&) -{ - return false; -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::CloseStorageCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::ConfirmCommand& lhs, - const m_bmqtool::ConfirmCommand& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.guid() == rhs.guid(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::ConfirmCommand& lhs, - const m_bmqtool::ConfirmCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::ConfirmCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::DataCommandChoice& lhs, - const m_bmqtool::DataCommandChoice& rhs) -{ - typedef m_bmqtool::DataCommandChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_N: return lhs.n() == rhs.n(); - case Class::SELECTION_ID_NEXT: return lhs.next() == rhs.next(); - case Class::SELECTION_ID_P: return lhs.p() == rhs.p(); - case Class::SELECTION_ID_PREV: return lhs.prev() == rhs.prev(); - case Class::SELECTION_ID_R: return lhs.r() == rhs.r(); - case Class::SELECTION_ID_RECORD: return lhs.record() == rhs.record(); - case Class::SELECTION_ID_LIST: return lhs.list() == rhs.list(); - case Class::SELECTION_ID_L: return lhs.l() == rhs.l(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::DataCommandChoice& lhs, - const m_bmqtool::DataCommandChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::DataCommandChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::DumpQueueCommand& lhs, - const m_bmqtool::DumpQueueCommand& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.key() == rhs.key(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::DumpQueueCommand& lhs, - const m_bmqtool::DumpQueueCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::DumpQueueCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - m_bmqtool::JournalCommandChoiceType::Value rhs) -{ - return m_bmqtool::JournalCommandChoiceType::print(stream, rhs); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::ListCommand& lhs, - const m_bmqtool::ListCommand& rhs) -{ - return lhs.uri() == rhs.uri(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::ListCommand& lhs, - const m_bmqtool::ListCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::ListCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::ListQueuesCommand&, - const m_bmqtool::ListQueuesCommand&) -{ - return true; -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::ListQueuesCommand&, - const m_bmqtool::ListQueuesCommand&) -{ - return false; -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::ListQueuesCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - m_bmqtool::MessagePropertyType::Value rhs) -{ - return m_bmqtool::MessagePropertyType::print(stream, rhs); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::MetadataCommand&, - const m_bmqtool::MetadataCommand&) -{ - return true; -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::MetadataCommand&, - const m_bmqtool::MetadataCommand&) -{ - return false; -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::MetadataCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::OpenStorageCommand& lhs, - const m_bmqtool::OpenStorageCommand& rhs) -{ - return lhs.path() == rhs.path(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::OpenStorageCommand& lhs, - const m_bmqtool::OpenStorageCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::OpenStorageCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::QlistCommandChoice& lhs, - const m_bmqtool::QlistCommandChoice& rhs) -{ - typedef m_bmqtool::QlistCommandChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_N: return lhs.n() == rhs.n(); - case Class::SELECTION_ID_NEXT: return lhs.next() == rhs.next(); - case Class::SELECTION_ID_P: return lhs.p() == rhs.p(); - case Class::SELECTION_ID_PREV: return lhs.prev() == rhs.prev(); - case Class::SELECTION_ID_R: return lhs.r() == rhs.r(); - case Class::SELECTION_ID_RECORD: return lhs.record() == rhs.record(); - case Class::SELECTION_ID_LIST: return lhs.list() == rhs.list(); - case Class::SELECTION_ID_L: return lhs.l() == rhs.l(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::QlistCommandChoice& lhs, - const m_bmqtool::QlistCommandChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::QlistCommandChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::StartCommand& lhs, - const m_bmqtool::StartCommand& rhs) -{ - return lhs.async() == rhs.async(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::StartCommand& lhs, - const m_bmqtool::StartCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::StartCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::StopCommand& lhs, - const m_bmqtool::StopCommand& rhs) -{ - return lhs.async() == rhs.async(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::StopCommand& lhs, - const m_bmqtool::StopCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::StopCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::Subscription& lhs, - const m_bmqtool::Subscription& rhs) -{ - return lhs.correlationId() == rhs.correlationId() && - lhs.expression() == rhs.expression() && - lhs.maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && - lhs.maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && - lhs.consumerPriority() == rhs.consumerPriority(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::Subscription& lhs, - const m_bmqtool::Subscription& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::Subscription& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::ConfigureQueueCommand& lhs, - const m_bmqtool::ConfigureQueueCommand& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.async() == rhs.async() && - lhs.maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && - lhs.maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && - lhs.consumerPriority() == rhs.consumerPriority() && - lhs.subscriptions() == rhs.subscriptions(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::ConfigureQueueCommand& lhs, - const m_bmqtool::ConfigureQueueCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::ConfigureQueueCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::DataCommand& lhs, - const m_bmqtool::DataCommand& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::DataCommand& lhs, - const m_bmqtool::DataCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::DataCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::JournalCommandChoice& lhs, - const m_bmqtool::JournalCommandChoice& rhs) -{ - typedef m_bmqtool::JournalCommandChoice Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_N: return lhs.n() == rhs.n(); - case Class::SELECTION_ID_NEXT: return lhs.next() == rhs.next(); - case Class::SELECTION_ID_P: return lhs.p() == rhs.p(); - case Class::SELECTION_ID_PREV: return lhs.prev() == rhs.prev(); - case Class::SELECTION_ID_R: return lhs.r() == rhs.r(); - case Class::SELECTION_ID_RECORD: return lhs.record() == rhs.record(); - case Class::SELECTION_ID_LIST: return lhs.list() == rhs.list(); - case Class::SELECTION_ID_L: return lhs.l() == rhs.l(); - case Class::SELECTION_ID_DUMP: return lhs.dump() == rhs.dump(); - case Class::SELECTION_ID_TYPE: return lhs.type() == rhs.type(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::JournalCommandChoice& lhs, - const m_bmqtool::JournalCommandChoice& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::JournalCommandChoice& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::MessageProperty& lhs, - const m_bmqtool::MessageProperty& rhs) -{ - return lhs.name() == rhs.name() && lhs.value() == rhs.value() && - lhs.type() == rhs.type(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::MessageProperty& lhs, - const m_bmqtool::MessageProperty& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::MessageProperty& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::OpenQueueCommand& lhs, - const m_bmqtool::OpenQueueCommand& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.flags() == rhs.flags() && - lhs.async() == rhs.async() && - lhs.maxUnconfirmedMessages() == rhs.maxUnconfirmedMessages() && - lhs.maxUnconfirmedBytes() == rhs.maxUnconfirmedBytes() && - lhs.consumerPriority() == rhs.consumerPriority() && - lhs.subscriptions() == rhs.subscriptions(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::OpenQueueCommand& lhs, - const m_bmqtool::OpenQueueCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::OpenQueueCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::QlistCommand& lhs, - const m_bmqtool::QlistCommand& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::QlistCommand& lhs, - const m_bmqtool::QlistCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::QlistCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::CommandLineParameters& lhs, - const m_bmqtool::CommandLineParameters& rhs) -{ - return lhs.mode() == rhs.mode() && lhs.broker() == rhs.broker() && - lhs.queueUri() == rhs.queueUri() && - lhs.queueFlags() == rhs.queueFlags() && - lhs.latency() == rhs.latency() && - lhs.latencyReport() == rhs.latencyReport() && - lhs.dumpMsg() == rhs.dumpMsg() && - lhs.confirmMsg() == rhs.confirmMsg() && - lhs.eventSize() == rhs.eventSize() && - lhs.msgSize() == rhs.msgSize() && - lhs.postRate() == rhs.postRate() && - lhs.eventsCount() == rhs.eventsCount() && - lhs.maxUnconfirmed() == rhs.maxUnconfirmed() && - lhs.postInterval() == rhs.postInterval() && - lhs.verbosity() == rhs.verbosity() && - lhs.logFormat() == rhs.logFormat() && - lhs.memoryDebug() == rhs.memoryDebug() && - lhs.threads() == rhs.threads() && - lhs.shutdownGrace() == rhs.shutdownGrace() && - lhs.noSessionEventHandler() == rhs.noSessionEventHandler() && - lhs.storage() == rhs.storage() && lhs.log() == rhs.log() && - lhs.sequentialMessagePattern() == rhs.sequentialMessagePattern() && - lhs.messageProperties() == rhs.messageProperties() && - lhs.subscriptions() == rhs.subscriptions(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::CommandLineParameters& lhs, - const m_bmqtool::CommandLineParameters& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::CommandLineParameters& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::JournalCommand& lhs, - const m_bmqtool::JournalCommand& rhs) -{ - return lhs.choice() == rhs.choice(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::JournalCommand& lhs, - const m_bmqtool::JournalCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::JournalCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::PostCommand& lhs, - const m_bmqtool::PostCommand& rhs) -{ - return lhs.uri() == rhs.uri() && lhs.payload() == rhs.payload() && - lhs.async() == rhs.async() && lhs.groupid() == rhs.groupid() && - lhs.compressionAlgorithmType() == rhs.compressionAlgorithmType() && - lhs.messageProperties() == rhs.messageProperties(); -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::PostCommand& lhs, - const m_bmqtool::PostCommand& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::PostCommand& rhs) -{ - return rhs.print(stream, 0, -1); -} - -inline bool m_bmqtool::operator==(const m_bmqtool::Command& lhs, - const m_bmqtool::Command& rhs) -{ - typedef m_bmqtool::Command Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_START: return lhs.start() == rhs.start(); - case Class::SELECTION_ID_STOP: return lhs.stop() == rhs.stop(); - case Class::SELECTION_ID_OPEN_QUEUE: - return lhs.openQueue() == rhs.openQueue(); - case Class::SELECTION_ID_CONFIGURE_QUEUE: - return lhs.configureQueue() == rhs.configureQueue(); - case Class::SELECTION_ID_CLOSE_QUEUE: - return lhs.closeQueue() == rhs.closeQueue(); - case Class::SELECTION_ID_POST: return lhs.post() == rhs.post(); - case Class::SELECTION_ID_LIST: return lhs.list() == rhs.list(); - case Class::SELECTION_ID_CONFIRM: - return lhs.confirm() == rhs.confirm(); - case Class::SELECTION_ID_OPEN_STORAGE: - return lhs.openStorage() == rhs.openStorage(); - case Class::SELECTION_ID_CLOSE_STORAGE: - return lhs.closeStorage() == rhs.closeStorage(); - case Class::SELECTION_ID_METADATA: - return lhs.metadata() == rhs.metadata(); - case Class::SELECTION_ID_LIST_QUEUES: - return lhs.listQueues() == rhs.listQueues(); - case Class::SELECTION_ID_DUMP_QUEUE: - return lhs.dumpQueue() == rhs.dumpQueue(); - case Class::SELECTION_ID_DATA: return lhs.data() == rhs.data(); - case Class::SELECTION_ID_QLIST: return lhs.qlist() == rhs.qlist(); - case Class::SELECTION_ID_JOURNAL: - return lhs.journal() == rhs.journal(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool m_bmqtool::operator!=(const m_bmqtool::Command& lhs, - const m_bmqtool::Command& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& m_bmqtool::operator<<(bsl::ostream& stream, - const m_bmqtool::Command& rhs) -{ - return rhs.print(stream, 0, -1); -} - } // close enterprise namespace #endif -// GENERATED BY @BLP_BAS_CODEGEN_VERSION@ +// GENERATED BY BLP_BAS_CODEGEN_2024.03.30 // USING bas_codegen.pl -m msg --noAggregateConversion --noExternalization // --noIdent --package m_bmqtool --msgComponent messages bmqtoolcmd.xsd diff --git a/src/applications/bmqtool/m_bmqtool_parameters.h b/src/applications/bmqtool/m_bmqtool_parameters.h index ca3b4eaa22..079229a169 100644 --- a/src/applications/bmqtool/m_bmqtool_parameters.h +++ b/src/applications/bmqtool/m_bmqtool_parameters.h @@ -209,7 +209,7 @@ class Parameters { bool d_confirmMsg; // Confirm messages upon reception - int d_eventSize; + bsl::uint64_t d_eventSize; // Number of messages per event // Default: 1 @@ -226,7 +226,7 @@ class Parameters { // Interval to publish events (in ms) // Default: 1000 - int d_eventsCount; + bsl::uint64_t d_eventsCount; // if >= 0, number of events to post (in // producer mode) before stopping to produce; // else infinite @@ -283,11 +283,11 @@ class Parameters { Parameters& setLatencyReportPath(const bsl::string& value); Parameters& setDumpMsg(bool value); Parameters& setConfirmMsg(bool value); - Parameters& setEventSize(int value); + Parameters& setEventSize(bsl::uint64_t value); Parameters& setMsgSize(int value); Parameters& setPostRate(int value); Parameters& setPostInterval(int value); - Parameters& setEventsCount(int value); + Parameters& setEventsCount(bsl::uint64_t value); Parameters& setMaxUnconfirmedMsgs(int value); Parameters& setMaxUnconfirmedBytes(int value); Parameters& setVerbosity(ParametersVerbosity::Value value); @@ -344,11 +344,11 @@ class Parameters { const bsl::string& logFilePath() const; bool dumpMsg() const; bool confirmMsg() const; - int eventSize() const; + bsl::uint64_t eventSize() const; int msgSize() const; int postRate() const; int postInterval() const; - int eventsCount() const; + bsl::uint64_t eventsCount() const; int maxUnconfirmedMsgs() const; int maxUnconfirmedBytes() const; ParametersVerbosity::Value verbosity() const; @@ -423,7 +423,7 @@ inline Parameters& Parameters::setConfirmMsg(bool value) return *this; } -inline Parameters& Parameters::setEventSize(int value) +inline Parameters& Parameters::setEventSize(bsl::uint64_t value) { d_eventSize = value; return *this; @@ -447,7 +447,7 @@ inline Parameters& Parameters::setPostInterval(int value) return *this; } -inline Parameters& Parameters::setEventsCount(int value) +inline Parameters& Parameters::setEventsCount(bsl::uint64_t value) { d_eventsCount = value; return *this; @@ -629,7 +629,7 @@ inline bool Parameters::confirmMsg() const return d_confirmMsg; } -inline int Parameters::eventSize() const +inline bsl::uint64_t Parameters::eventSize() const { return d_eventSize; } @@ -649,7 +649,7 @@ inline int Parameters::postInterval() const return d_postInterval; } -inline int Parameters::eventsCount() const +inline bsl::uint64_t Parameters::eventsCount() const { return d_eventsCount; } From b55cfb9e964bcf150c6b7b7a869e8e0a3914b2bc Mon Sep 17 00:00:00 2001 From: Amit Dave Date: Tue, 9 Apr 2024 03:34:31 -0700 Subject: [PATCH 04/21] Changed k_DEFAULT_SUBSCRIPTION_ID to k_DEFAULT_SUBQUEUE_ID Signed-off-by: Amit Dave --- src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp b/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp index b967a37ba4..9b4001a1f2 100644 --- a/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp @@ -1645,7 +1645,7 @@ bool RelayQueueEngine::subscriptionId2upstreamSubQueueId( if (subscriptionId == bmqp::Protocol::k_DEFAULT_SUBSCRIPTION_ID) { BSLS_ASSERT_SAFE(d_apps.find(bmqp::QueueId::k_DEFAULT_SUBQUEUE_ID) != d_apps.end()); - *subQueueId = bmqp::Protocol::k_DEFAULT_SUBSCRIPTION_ID; + *subQueueId = bmqp::QueueId::k_DEFAULT_SUBQUEUE_ID; } else { const Routers::SubscriptionIds::SharedItem itId = From f278fc91171cabe62c8b3fc32e001df1c73961b1 Mon Sep 17 00:00:00 2001 From: Christopher Beard Date: Wed, 10 Apr 2024 11:56:48 -0400 Subject: [PATCH 05/21] Fix -Wextra-semi warnings Signed-off-by: Christopher Beard --- .../bmqstoragetool/m_bmqstoragetool_commandprocessor.h | 4 ++-- .../bmqstoragetool/m_bmqstoragetool_filemanager.h | 2 +- .../bmqstoragetool/m_bmqstoragetool_searchresult.h | 2 +- .../bmqprometheus/bmqprometheus_prometheusstatconsumer.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessor.h b/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessor.h index 43e35df4b8..5738968dc1 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessor.h +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessor.h @@ -43,9 +43,9 @@ class CommandProcessor { // CREATORS /// Default constructor. - CommandProcessor(){}; + CommandProcessor() {} - virtual ~CommandProcessor(){}; + virtual ~CommandProcessor() {} // MANIPULATORS diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_filemanager.h b/src/applications/bmqstoragetool/m_bmqstoragetool_filemanager.h index af3a425d9f..2268e7374d 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_filemanager.h +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_filemanager.h @@ -54,7 +54,7 @@ class FileManager { virtual mqbs::JournalFileIterator* journalFileIterator() = 0; virtual mqbs::DataFileIterator* dataFileIterator() = 0; - virtual ~FileManager(){}; + virtual ~FileManager() {} }; class FileManagerImpl : public FileManager { diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_searchresult.h b/src/applications/bmqstoragetool/m_bmqstoragetool_searchresult.h index 7df86c6575..cc46e8275c 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_searchresult.h +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_searchresult.h @@ -86,7 +86,7 @@ class SearchResult { // CREATORS /// Destructor - virtual ~SearchResult(){}; + virtual ~SearchResult() {} // MANIPULATORS diff --git a/src/plugins/bmqprometheus/bmqprometheus_prometheusstatconsumer.h b/src/plugins/bmqprometheus/bmqprometheus_prometheusstatconsumer.h index 779e91a619..ec6a9ed25c 100644 --- a/src/plugins/bmqprometheus/bmqprometheus_prometheusstatconsumer.h +++ b/src/plugins/bmqprometheus/bmqprometheus_prometheusstatconsumer.h @@ -79,7 +79,7 @@ class PrometheusStatExporter { virtual ~PrometheusStatExporter() = default; - virtual void onData(){}; + virtual void onData() {} virtual int start() = 0; virtual void stop() = 0; }; From dff008209b34f89f6db33f201879a19d32f1ecc0 Mon Sep 17 00:00:00 2001 From: Melvin He Date: Fri, 12 Apr 2024 13:46:52 -0400 Subject: [PATCH 06/21] Fix: mwcc monitoredqueue and orderedhashmap Wconv warnings (#245) Signed-off-by: Melvin He Signed-off-by: Patrick M. Niedzielski --- src/groups/mwc/mwcc/mwcc_monitoredqueue.h | 2 +- src/groups/mwc/mwcc/mwcc_orderedhashmap.h | 2 +- src/groups/mwc/mwcc/mwcc_orderedhashmap.t.cpp | 268 +++++++++--------- 3 files changed, 136 insertions(+), 136 deletions(-) diff --git a/src/groups/mwc/mwcc/mwcc_monitoredqueue.h b/src/groups/mwc/mwcc/mwcc_monitoredqueue.h index d8a92697c6..f979ecae08 100644 --- a/src/groups/mwc/mwcc/mwcc_monitoredqueue.h +++ b/src/groups/mwc/mwcc/mwcc_monitoredqueue.h @@ -590,7 +590,7 @@ template inline int MonitoredQueue::pushBack( bslmf::MovableRef value) { - const int currentQueueLen = numElements(); + const bsls::Types::Int64 currentQueueLen = numElements(); if (currentQueueLen + 1 >= capacity()) { // We've filled the queue. Alarm if (!Traits::isPushBackDisabled(d_queue) && diff --git a/src/groups/mwc/mwcc/mwcc_orderedhashmap.h b/src/groups/mwc/mwcc/mwcc_orderedhashmap.h index 10f65217fd..5bc81c5035 100644 --- a/src/groups/mwc/mwcc/mwcc_orderedhashmap.h +++ b/src/groups/mwc/mwcc/mwcc_orderedhashmap.h @@ -1386,7 +1386,7 @@ OrderedHashMap::erase(const_iterator position) iterator nextPosition(position.d_link_p->nextInList()); Node* nodeToErase = static_cast(position.d_link_p); - int count = erase(get_key(nodeToErase->value())); + size_t count = erase(get_key(nodeToErase->value())); BSLS_ASSERT(1 == count && "Invalid iterator provided"); static_cast(count); // suppress compiler warning return nextPosition; diff --git a/src/groups/mwc/mwcc/mwcc_orderedhashmap.t.cpp b/src/groups/mwc/mwcc/mwcc_orderedhashmap.t.cpp index 81be4e5f37..082102a0e0 100644 --- a/src/groups/mwc/mwcc/mwcc_orderedhashmap.t.cpp +++ b/src/groups/mwc/mwcc/mwcc_orderedhashmap.t.cpp @@ -60,23 +60,23 @@ class IdentityHasher { public: IdentityHasher() {} - size_t operator()(int x) const { return x; } + size_t operator()(size_t x) const { return x; } }; struct TestKeyType { // CLASS LEVEL DATA - static int s_numDeletions; + static size_t s_numDeletions; // DATA - int d_a; + size_t d_a; // CREATORS - TestKeyType(int a) { d_a = a; } + TestKeyType(size_t a) { d_a = a; } ~TestKeyType() { s_numDeletions += 1; } }; -int TestKeyType::s_numDeletions(0); +size_t TestKeyType::s_numDeletions(0); // FREE FUNCTIONS bool operator==(const TestKeyType& lhs, const TestKeyType& rhs) @@ -93,18 +93,18 @@ void hashAppend(HASH_ALGORITHM& hashAlgo, const TestKeyType& key) struct TestValueType { // CLASS LEVEL DATA - static int s_numDeletions; + static size_t s_numDeletions; // DATA - int d_b; + size_t d_b; // CREATORS - TestValueType(int b) { d_b = b; } + TestValueType(size_t b) { d_b = b; } ~TestValueType() { s_numDeletions += 1; } }; -int TestValueType::s_numDeletions(0); +size_t TestValueType::s_numDeletions(0); } // close unnamed namespace @@ -121,9 +121,9 @@ static void test1_breathingTest() mwctst::TestHelper::printTestName("BREATHING TEST"); // Breathing test - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef MyMapType::const_iterator ConstIterType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef MyMapType::const_iterator ConstIterType; const bsl::string s("foo", s_allocator_p); @@ -204,22 +204,22 @@ static void test3_insert() { mwctst::TestHelper::printTestName("INSERT"); - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef MyMapType::const_iterator ConstIterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef MyMapType::const_iterator ConstIterType; + typedef bsl::pair RcType; MyMapType map(s_allocator_p); #ifdef BSLS_PLATFORM_OS_LINUX - const int k_NUM_ELEMENTS = 1000 * 1000; // 1M + const size_t k_NUM_ELEMENTS = 1000 * 1000; // 1M #else // Avoid timeout on AIX and Solaris - const int k_NUM_ELEMENTS = 100 * 1000; // 100K + const size_t k_NUM_ELEMENTS = 100 * 1000; // 100K #endif // Insert 1M elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); ASSERT_EQ_D(i, true, rc.second); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -228,12 +228,12 @@ static void test3_insert() ASSERT_EQ_D(i, true, 1.5 >= map.load_factor()); } - ASSERT_EQ(map.size(), static_cast(k_NUM_ELEMENTS)); + ASSERT_EQ(map.size(), k_NUM_ELEMENTS); // Iterate and confirm { const MyMapType& cmap = map; - int i = 0; + size_t i = 0; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); ASSERT_EQ_D(i, i, cit->first); @@ -245,7 +245,7 @@ static void test3_insert() // Reverse iterate using --(end()) and confirm { const MyMapType& cmap = map; - int i = k_NUM_ELEMENTS - 1; + size_t i = k_NUM_ELEMENTS - 1; ConstIterType cit = --(cmap.end()); // last element for (; cit != cmap.begin(); --cit) { ASSERT_EQ_D(i, true, i > 0); @@ -276,13 +276,13 @@ static void test4_rinsert() #ifdef BSLS_PLATFORM_OS_AIX // Avoid timeout on AIX - const int k_NUM_ELEMENTS = 100 * 1000; // 100K + const size_t k_NUM_ELEMENTS = 100 * 1000; // 100K #else - const int k_NUM_ELEMENTS = 1000 * 1000; // 1M + const size_t k_NUM_ELEMENTS = 1000 * 1000; // 1M #endif // Insert 1M elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.rinsert(bsl::make_pair(i, i + 1)); ASSERT_EQ_D(i, true, rc.second); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -291,12 +291,12 @@ static void test4_rinsert() ASSERT_EQ_D(i, true, 1.5 >= map.load_factor()); } - ASSERT_EQ(map.size(), static_cast(k_NUM_ELEMENTS)); + ASSERT_EQ(map.size(), k_NUM_ELEMENTS); // Iterate and confirm { const MyMapType& cmap = map; - int i = k_NUM_ELEMENTS - 1; + size_t i = k_NUM_ELEMENTS - 1; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { ASSERT_EQ_D(i, i, cit->first); ASSERT_EQ_D(i, (i + 1), cit->second); @@ -307,7 +307,7 @@ static void test4_rinsert() // Reverse iterate using --(end()) and confirm { const MyMapType& cmap = map; - int i = 0; + size_t i = 0; ConstIterType cit = --(cmap.end()); // last element for (; cit != cmap.begin(); --cit) { ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); @@ -329,18 +329,18 @@ static void test5_insertEraseInsert() mwctst::TestHelper::printTestName("INSERT ERASE INSERT"); // insert/erase/insert test - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef MyMapType::const_iterator ConstIterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef MyMapType::const_iterator ConstIterType; + typedef bsl::pair RcType; MyMapType map(s_allocator_p); - const int k_NUM_ELEMENTS = 100 * 1000; // 100K - const int k_STEP = 10; + const size_t k_NUM_ELEMENTS = 100 * 1000; // 100K + const size_t k_STEP = 10; // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -351,7 +351,7 @@ static void test5_insertEraseInsert() // Iterate and confirm { const MyMapType& cmap = map; - int i = 0; + size_t i = 0; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); ASSERT_EQ_D(i, i, cit->first); @@ -361,19 +361,19 @@ static void test5_insertEraseInsert() } // Erase few elements - for (int i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { + for (size_t i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { ASSERT_EQ_D(i, 1U, map.erase(i)); } // Find erased elements - for (int i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { + for (size_t i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { ASSERT_EQ_D(i, true, map.end() == map.find(i)); } // Iterate and confirm { const MyMapType& cmap = map; - int i = 1; + size_t i = 1; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); ASSERT_EQ_D(i, i, cit->first); @@ -386,7 +386,7 @@ static void test5_insertEraseInsert() } // Insert elements which were erased earlier - for (int i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { + for (size_t i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); ASSERT_EQ_D(i, true, rc.second); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -397,7 +397,7 @@ static void test5_insertEraseInsert() // Iterate and confirm { IterType it = map.begin(); - int i = 1; + size_t i = 1; // Iterate over original elements for (; it != map.end(); ++it) { @@ -450,10 +450,10 @@ static void test6_clear() ASSERT_EQ(0U, map.size()); ASSERT_EQ(true, map.load_factor() == 0.0); - const int k_NUM_ELEMENTS = 100; + const size_t k_NUM_ELEMENTS = 100; // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -463,7 +463,7 @@ static void test6_clear() ASSERT_EQ(false, map.empty()); ASSERT_EQ(true, map.begin() != map.end()); - ASSERT_EQ(static_cast(k_NUM_ELEMENTS), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS, map.size()); map.clear(); ASSERT_EQ(true, map.empty()); @@ -485,11 +485,11 @@ static void test7_erase() typedef MyMapType::const_iterator ConstIterType; typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 100; - MyMapType map(s_allocator_p); + const size_t k_NUM_ELEMENTS = 100; + MyMapType map(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -522,18 +522,18 @@ static void test8_eraseClear() typedef MyMapType::iterator IterType; typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 100; - MyMapType map(s_allocator_p); + const size_t k_NUM_ELEMENTS = 100; + MyMapType map(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert( bsl::make_pair(TestKeyType(i), TestValueType(i))); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != map.end()); } - ASSERT_EQ(static_cast(k_NUM_ELEMENTS), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS, map.size()); // Reset static counters TestKeyType::s_numDeletions = 0; @@ -560,22 +560,22 @@ static void test9_insertFailure() mwctst::TestHelper::printTestName("INSERT FAILURE"); // insert (key, value) already present in the container - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 100000; - MyMapType map(s_allocator_p); + const size_t k_NUM_ELEMENTS = 100000; + MyMapType map(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, true, rc.second); ASSERT_EQ_D(i, true, rc.first != map.end()); } // insert same keys again - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, false); ASSERT_EQ_D(i, true, rc.first == map.find(i)); @@ -593,15 +593,15 @@ static void test10_erasureIterator() mwctst::TestHelper::printTestName("ERASURE ITERATOR"); // Use iterator returned by erase(const_iterator) - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 10000; - MyMapType map(s_allocator_p); + const size_t k_NUM_ELEMENTS = 10000; + MyMapType map(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -617,7 +617,7 @@ static void test10_erasureIterator() ASSERT_EQ(true, it != map.end()); ASSERT_EQ(true, it == map.find(9001)); - int i = 9001; + size_t i = 9001; for (; it != map.end(); ++it) { ASSERT_EQ_D(i, i, it->first); ++i; @@ -639,17 +639,17 @@ static void test11_copyConstructor() // Copy construct object 2 from object 1. // Assert that object 2 has same elements etc. - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef MyMapType::const_iterator ConstIterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef MyMapType::const_iterator ConstIterType; + typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 10000; + const size_t k_NUM_ELEMENTS = 10000; MyMapType* m1p = new (*s_allocator_p) MyMapType(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = m1p->insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != m1p->end()); @@ -658,7 +658,7 @@ static void test11_copyConstructor() MyMapType m2(*m1p, s_allocator_p); // Iterate and confirm - int i = 0; + size_t i = 0; for (ConstIterType cit = m2.begin(); cit != m2.end(); ++cit) { ASSERT_EQ_D(i, cit->first, i); ASSERT_EQ_D(i, cit->second, i); @@ -692,17 +692,17 @@ static void test12_assignmentOperator() // object 2 = object 1 // Assert that object 2 has same elements as object 1 etc. - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef MyMapType::const_iterator ConstIterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef MyMapType::const_iterator ConstIterType; + typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 10000; + const size_t k_NUM_ELEMENTS = 10000; MyMapType* m1p = new (*s_allocator_p) MyMapType(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = m1p->insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != m1p->end()); @@ -711,7 +711,7 @@ static void test12_assignmentOperator() MyMapType m2(s_allocator_p); // Insert elements - for (int i = k_NUM_ELEMENTS; i > 0; --i) { + for (size_t i = k_NUM_ELEMENTS; i > 0; --i) { RcType rc = m2.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != m2.end()); @@ -720,7 +720,7 @@ static void test12_assignmentOperator() m2 = *m1p; // Iterate and confirm - int i = 0; + size_t i = 0; for (ConstIterType cit = m2.begin(); cit != m2.end(); ++cit) { ASSERT_EQ_D(i, cit->first, i); ASSERT_EQ_D(i, cit->second, i); @@ -762,7 +762,7 @@ static void test13_previousEndIterator() IterType endIt = map.end(); ConstIterType endCit = cmap.end(); - int i = 0; + size_t i = 0; bsl::pair rc = map.insert(bsl::make_pair(i, i * i)); ASSERT_EQ(true, rc.first == endIt); @@ -817,17 +817,17 @@ static void test14_localIterator() // of the hash table, we specify such keys such that they will all map // to the same bucket in the table. - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::local_iterator LocalIterType; - typedef MyMapType::const_local_iterator ConstLocalIterType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::local_iterator LocalIterType; + typedef MyMapType::const_local_iterator ConstLocalIterType; MyMapType map(s_allocator_p); const MyMapType& cmap = map; const size_t bucketCount = map.bucket_count(); - int key = bucketCount / 2; - int originalKey = key; + size_t key = bucketCount / 2; + size_t originalKey = key; map.insert(bsl::make_pair(key, key * key)); @@ -852,7 +852,7 @@ static void test14_localIterator() // Add keys such that they all map to same bucket in the table, while // ensuring that table is not rehashed. - for (unsigned int i = 0; i < (bucketCount - 2); ++i) { + for (size_t i = 0; i < (bucketCount - 2); ++i) { key += bucketCount; map.insert(bsl::make_pair(key, key * key)); } @@ -888,16 +888,16 @@ static void test15_eraseRange() mwctst::TestHelper::printTestName("ERASE RANGE"); // erase - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef MyMapType::const_iterator ConstIterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef MyMapType::const_iterator ConstIterType; + typedef bsl::pair RcType; - const int k_NUM_ELEMENTS = 100; - MyMapType map(s_allocator_p); + const size_t k_NUM_ELEMENTS = 100; + MyMapType map(s_allocator_p); // Insert elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, rc.second, true); ASSERT_EQ_D(i, true, rc.first != map.end()); @@ -905,23 +905,23 @@ static void test15_eraseRange() ASSERT_EQ_D(i, i, rc.first->second); } - ASSERT_EQ(size_t(k_NUM_ELEMENTS), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ASSERT(map.erase(map.begin(), map.begin()) == map.begin()); - ASSERT_EQ(size_t(k_NUM_ELEMENTS), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ASSERT(map.erase(map.end(), map.end()) == map.end()); - ASSERT_EQ(size_t(k_NUM_ELEMENTS), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ConstIterType second = ++map.begin(); ASSERT(map.erase(map.begin(), second) == second); ASSERT(map.begin() == second); - ASSERT_EQ(size_t(k_NUM_ELEMENTS - 1), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS - 1, map.size()); ASSERT_EQ_D(1, 1, map.begin()->first); ASSERT_EQ_D(1, 1, map.begin()->second); ASSERT(map.erase(--map.end(), map.end()) == map.end()); - ASSERT_EQ(size_t(k_NUM_ELEMENTS - 2), map.size()); + ASSERT_EQ(k_NUM_ELEMENTS - 2, map.size()); ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, (--map.end())->first); ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, (--map.end())->second); @@ -941,17 +941,17 @@ static void testN1_insertPerformanceOrdered() mwctst::TestHelper::printTestName("INSERT PERFORMANCE"); // Performance comparison of insert() with bsl::unordered_map - const int k_NUM_ELEMENTS = 5000000; + const size_t k_NUM_ELEMENTS = 5000000; bsls::Types::Int64 ohmTime; { // OrderedHashMap - typedef mwcc::OrderedHashMap MyMapType; + typedef mwcc::OrderedHashMap MyMapType; MyMapType map(k_NUM_ELEMENTS, s_allocator_p); bsls::Types::Int64 begin = bsls::TimeUtil::getTimer(); - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { map.insert(bsl::make_pair(i, i)); } bsls::Types::Int64 end = bsls::TimeUtil::getTimer(); @@ -969,17 +969,17 @@ static void testN1_insertPerformanceUnordered() mwctst::TestHelper::printTestName("INSERT PERFORMANCE"); // Performance comparison of insert() with bsl::unordered_map - const int k_NUM_ELEMENTS = 5000000; + const size_t k_NUM_ELEMENTS = 5000000; bsls::Types::Int64 umTime; { // bsl::unordered_map - typedef bsl::unordered_map MyMapType; + typedef bsl::unordered_map MyMapType; MyMapType map(s_allocator_p); map.reserve(k_NUM_ELEMENTS); bsls::Types::Int64 begin = bsls::TimeUtil::getTimer(); - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { map.insert(bsl::make_pair(i, i)); } bsls::Types::Int64 end = bsls::TimeUtil::getTimer(); @@ -999,16 +999,16 @@ BSLA_MAYBE_UNUSED static void testN2_erasePerformanceOrdered() // Insert elements, iterate and erase while iterating - const int k_NUM_ELEMENTS = 5000000; + const size_t k_NUM_ELEMENTS = 5000000; bsls::Types::Int64 ohmTime; { - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef bsl::pair RcType; MyMapType map(s_allocator_p); // Insert 1M elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, i, rc.first->first); ASSERT_EQ_D(i, i, rc.first->second); @@ -1037,16 +1037,16 @@ BSLA_MAYBE_UNUSED static void testN2_erasePerformanceUnordered() // Insert elements, iterate and erase while iterating - const int k_NUM_ELEMENTS = 5000000; + const size_t k_NUM_ELEMENTS = 5000000; bsls::Types::Int64 umTime; { - typedef bsl::unordered_map MyMapType; - typedef MyMapType::iterator IterType; - typedef bsl::pair RcType; + typedef bsl::unordered_map MyMapType; + typedef MyMapType::iterator IterType; + typedef bsl::pair RcType; MyMapType map(s_allocator_p); // Insert 1M elements - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, i, rc.first->first); ASSERT_EQ_D(i, i, rc.first->second); @@ -1073,13 +1073,13 @@ BSLA_MAYBE_UNUSED static void testN3_profile() // A simple snippet which inserts elements in the ordered hash map. // This case can be used to profile the component. - const int k_NUM_ELEMENTS = 5000000; + const size_t k_NUM_ELEMENTS = 5000000; - typedef mwcc::OrderedHashMap MyMapType; - MyMapType map(k_NUM_ELEMENTS, s_allocator_p); + typedef mwcc::OrderedHashMap MyMapType; + MyMapType map(k_NUM_ELEMENTS, s_allocator_p); // Insert elements. - for (int i = 0; i < k_NUM_ELEMENTS; ++i) { + for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { map.insert(bsl::make_pair(i, i)); } } @@ -1095,10 +1095,10 @@ testN1_insertPerformanceUnordered_GoogleBenchmark(benchmark::State& state) // Performance comparison of insert() with bsl::unordered_map { // UnorderedMap - typedef bsl::unordered_map MyMapType; + typedef bsl::unordered_map MyMapType; MyMapType map(state.range(0), s_allocator_p); for (auto _ : state) { - for (int i = 0; i < state.range(0); ++i) { + for (size_t i = 0; i < state.range(0); ++i) { map.insert(bsl::make_pair(i, i)); } } @@ -1113,11 +1113,11 @@ testN1_insertPerformanceOrdered_GoogleBenchmark(benchmark::State& state) // Performance comparison of insert() with bsl::unordered_map { // OrderedHashMap - typedef mwcc::OrderedHashMap MyMapType; + typedef mwcc::OrderedHashMap MyMapType; MyMapType map(state.range(0), s_allocator_p); for (auto _ : state) { - for (int i = 0; i < state.range(0); ++i) { + for (size_t i = 0; i < state.range(0); ++i) { map.insert(bsl::make_pair(i, i)); } } @@ -1128,14 +1128,14 @@ static void testN2_erasePerformanceUnordered_GoogleBenchmark(benchmark::State& state) { // Unordered Map Erase Performance Test - typedef bsl::unordered_map MyMapType; - typedef MyMapType::iterator IterType; - typedef bsl::pair RcType; + typedef bsl::unordered_map MyMapType; + typedef MyMapType::iterator IterType; + typedef bsl::pair RcType; MyMapType map(s_allocator_p); for (auto _ : state) { state.PauseTiming(); - for (int i = 0; i < state.range(0); ++i) { + for (size_t i = 0; i < state.range(0); ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, i, rc.first->first); ASSERT_EQ_D(i, i, rc.first->second); @@ -1157,15 +1157,15 @@ testN2_erasePerformanceOrdered_GoogleBenchmark(benchmark::State& state) // Performance comparison of erase() with bsl::unordered_map // Insert elements, iterate and erase while iterating - typedef mwcc::OrderedHashMap MyMapType; - typedef MyMapType::iterator IterType; - typedef bsl::pair RcType; + typedef mwcc::OrderedHashMap MyMapType; + typedef MyMapType::iterator IterType; + typedef bsl::pair RcType; MyMapType map(s_allocator_p); // Insert 1M elements for (auto _ : state) { state.PauseTiming(); - for (int i = 0; i < state.range(0); ++i) { + for (size_t i = 0; i < state.range(0); ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); ASSERT_EQ_D(i, i, rc.first->first); ASSERT_EQ_D(i, i, rc.first->second); @@ -1189,12 +1189,12 @@ static void testN3_profile_GoogleBenchmark(benchmark::State& state) // A simple snippet which inserts elements in the ordered hash map. // This case can be used to profile the component. - typedef mwcc::OrderedHashMap MyMapType; - MyMapType map(state.range(0), s_allocator_p); + typedef mwcc::OrderedHashMap MyMapType; + MyMapType map(state.range(0), s_allocator_p); // Insert elements. for (auto _ : state) { - for (int i = 0; i < state.range(0); ++i) { + for (size_t i = 0; i < state.range(0); ++i) { map.insert(bsl::make_pair(i, i)); } } From 327b184cb753705c7cb8e0fa4ae2cd3e78f8d9ac Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Fri, 12 Apr 2024 17:56:11 -0400 Subject: [PATCH 07/21] sdk: Fix clang `-Wmismatched-tags` warning The `bmqa::MessageImpl` class is declared in the `bmqa_message` component as a `struct`, but is forward-declared in `bmqt_subscription` as a `class`. This is valid C++ with our desired semantics, but the clang still warns that under the Microsoft C++ ABI, this may result in linker errors. Although we do not support Windows as a target platform, this warning is pernitious: many components that use `bmqt_subscription` will see this warning; including those of users! While it would be easy to turn off this warning, this patch instead fixes the warning by changing the `class` forward declaration in `bmqt_subscription` to match the `struct` declaration in `bmqa_message`. Signed-off-by: Patrick M. Niedzielski --- src/groups/bmq/bmqt/bmqt_subscription.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/groups/bmq/bmqt/bmqt_subscription.h b/src/groups/bmq/bmqt/bmqt_subscription.h index d865ea0775..f2a36c3879 100644 --- a/src/groups/bmq/bmqt/bmqt_subscription.h +++ b/src/groups/bmq/bmqt/bmqt_subscription.h @@ -46,7 +46,7 @@ namespace BloombergLP { // FORWARD DECLARATION namespace bmqa { -class MessageImpl; +struct MessageImpl; } namespace bmqa { class MessageIterator; @@ -61,7 +61,7 @@ class QueueOptions; /// Value-semantic type for unique Subscription id. class SubscriptionHandle { - friend class bmqa::MessageImpl; + friend struct bmqa::MessageImpl; friend class bmqa::MessageIterator; public: From 17f383b7ae92f62313a80631aedfae8e06dfde54 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Fri, 12 Apr 2024 18:05:18 -0400 Subject: [PATCH 08/21] build: Do not pass `-Wlogical-ops` to clang The supported compiler on modern MacOS systems is clang; the `gcc` command forwards to `clang` underlyingly, unless a user explicitly installs GCC. Unfortunately, our build system was assuming GCC as the compiler on MacOS systems. For the most part, this had no adverse effects, as the two frontends attempt to be compatible. However, there is one warning that GCC supports that clang does not, which we were inadvertently passing: `-Wlogical-op`, which in clang is superseded by `-Wlogical-op-parentheses`. The primary issue here is that the we outsource some of our CMake configuration to BDE Tools, but we need to manually select which platform to use. This patch manually selects `clang` rather than `gcc` in the `bin/build-darwin.sh` script, which silences the above warning. Signed-off-by: Patrick M. Niedzielski --- bin/build-darwin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-darwin.sh b/bin/build-darwin.sh index 8dc0f5f0b9..3fdb9415ce 100755 --- a/bin/build-darwin.sh +++ b/bin/build-darwin.sh @@ -103,7 +103,7 @@ CMAKE_OPTIONS=(\ -DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}" \ -DCMAKE_MODULE_PATH="${DIR_THIRDPARTY}/bde-tools/cmake;${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem" \ -DCMAKE_PREFIX_PATH="${DIR_INSTALL}" \ - -DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/gcc-default.cmake" \ + -DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/clang-default.cmake" \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DFLEX_ROOT="${FLEX_ROOT}") From 266caea1e54abe399cb8fd8e996706744cb7cd8b Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Mon, 15 Apr 2024 18:14:48 -0400 Subject: [PATCH 09/21] build: Disable `-Wundef` on clang The BDE idiom for using `BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES` is by using it in the condition of a preprocessor conditional `#if`, as follows: #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES When compiling on a platform that supports C++11, this macro is undefined; the behavior in this situation is well-defined, though, and the macro is replaced with `0`, rendering the above condition true. Clang, however, warns in this situation, letting us know that we are expanding a macro that is undefined to `0`, which we may not want to do. Because of how commonly we use this idiom in our codebase, this patch turns off this warning across all files. Signed-off-by: Patrick M. Niedzielski --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66108086b0..4e30f022a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang" ) "-Wno-padded" "-Wno-global-constructors" # bmqp_protocol mask constants "-Wno-conversion" + "-Wno-undef" # BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES "-Wno-float-equal" # operator== in generated classes ) From 6466d1af4a88ede6697fae05fe4d0a0eb830c1dd Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Thu, 4 Apr 2024 15:21:22 -0400 Subject: [PATCH 10/21] docs: Exclude `.cpp` files from documentation generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running `doxygen` on our documentation right now search all header files and source files in the public packages within the `bmq` package group. We already exclude the test files for each component (`*.t.cpp`) from our search, but this still means that for each component, we generate pages for both its `*.cpp` file and its `*.h` file. For the purpose of generating documentation, though, we only need to search the header file, which contains both component-level documentation (currently in the BDE format, which Doxygen cannot process) and type/function-level documentation (which was partially converted into a format Doxygen can process). The `.cpp` source file for each component contains no documentation, and so the file documentation that is generated only contains only the implementation source code, which a user can easily look up in our GitHub repository. This patch makes the simple change of excluding the `.cpp` source files for each component from Doxygen’s search. This prevents Doxygen from generating HTML pages for each implementation source file, which contain no new or interesting information above the source file itself. This will also allow us to generate component-level documentation as documentation of the component’s header file itself, once we convert the component-level documentation into a format that Doxygen can handle. Signed-off-by: Patrick M. Niedzielski --- Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 8ced98d2a2..cfbed31aad 100644 --- a/Doxyfile +++ b/Doxyfile @@ -875,7 +875,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = *.t.cpp +EXCLUDE_PATTERNS = *.t.cpp *.cpp # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the From 53194f1001c0f968a2b78ce24bd431b0388950b5 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Thu, 4 Apr 2024 15:42:50 -0400 Subject: [PATCH 11/21] docs: Add a new Doxygen alias for referencing BlazingMQ components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All BlazingMQ components live within the namespace `BloombergLP`, under which package namespaces `bmqa`, `bmqp`, etc. live. In most places in our current documentation, though, this qualifier is elided: the class `BloombergLP::bmqa::AbstractSession` is referred to only as `bmqa::AbstractSession`. While this is usually not an issue, if we want Doxygen to generate links to the documentation for these symbols, we must prefix them with `BloombergLP::`. This gives us two options: 1. Any time we reference a symbol in our documentation, we must make sure to that we reference its fully-qualified name, including the `BloombergLP::` namespace prefix. These changes would take the form … 'bmqa::AbstractSession' … → … @ref BloombergLP::bmqa::AbstractSession …. This will make our documentation more noisy and harder to read. 2. We add our own Doxygen command alias that takes a symbol name and generates the above. We will have to make sure to use this alias whenever we modify our Doxygen documentation, or symbol references will not work correctly. Then, changes would take the form … 'bmqa::AbstractSession' … → … @bbref{bmqa::AbstractSession} …, which is only a little noisier than what we have now. This patch takes the second approach, and introduces a Doxygen command alias named `bbref`, which performs the substition described above. Signed-off-by: Patrick M. Niedzielski --- Doxyfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doxyfile b/Doxyfile index cfbed31aad..e74d451dd4 100644 --- a/Doxyfile +++ b/Doxyfile @@ -253,6 +253,8 @@ TAB_SIZE = 4 ALIASES = +ALIASES += bbref{1}="@ref BloombergLP::\1 \"\1\"" + # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. From 312919b2fa84e592313856729e272d9eda38ad64 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Fri, 5 Apr 2024 18:21:47 -0400 Subject: [PATCH 12/21] docs: Strip `src/groups/bmq` from component paths Now that component-level documentation has been conflated with header file-level documentation, the component-level documentation is buried within the `Files` section in the left-hand navigation pane of our generated Doxygen documentation. Several levels of hierarchy within this output are noise: namely, we do not need the `src/groups/bmq` directories that are incidental to the logical hierarchy of our components. This patch teaches Doxygen to strip out those directories from the names of files it searches, yielding a documentation structure that is closer to the BDE-style package and component hierarchy. Signed-off-by: Patrick M. Niedzielski --- Doxyfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doxyfile b/Doxyfile index e74d451dd4..f53d0365e2 100644 --- a/Doxyfile +++ b/Doxyfile @@ -158,7 +158,7 @@ INLINE_INHERITED_MEMB = YES # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = NO +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand @@ -170,7 +170,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = src/groups/bmq/ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which From f3ca1d24138db58b4eea57e6a74872117200bb56 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Fri, 5 Apr 2024 17:02:24 -0400 Subject: [PATCH 13/21] docs: Convert `bmqa` component documentation to Doxygen style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the open-sourcing process, we converted all class and function documentation over from the BDE documentation style to Doxygen + Markdown using an automated tool. This tool did not affect package-group-level documentation, package-level documentation, or component-level documentation, though, which is still in the previous BDE style, and which is thus not picked up when we run Doxygen. This is a big problem, since much of our SDK’s documentation, as well as examples, are given in component-level documentation rather than on the concrete classes, functions, or macros. This also means we cannot run Doxygen on our source code to produce updated versions of the documentation when we release, meaning our documentation is still stuck at where it was with our first open-source release. This patch performs the first big step towards rectifying this situation: it converts the old BDE-style component-level documentation into Doxygen + Markdown documentation, applied to the header file associated with each component. After applying this patch, Doxygen is able to pick up the component-level documentation and to produce formatted pages for each component. Documenting components in Doxygen ================================= Doxygen has no native support for BDE-style organization, with package groups, packages, and components, so we need to map these organizational concepts onto Doxygen’s more impoverished and concrete ontology. There are two rough ways of going about this, described below. The first strategy is the one that we employed before converting the documentation on classes, functions, and macros from BDE-style to Doxygen + Markdown format: use the `bdedox` tool from the [bde-tools][bde-tools] repository, which to runs a filter program over each package group, package, and component in the repository. Using the documentation embedded within a BDE-style repository, this filter produces temporary Markdown files package groups, packages, and components. Those temporary Markdown files then serve as additional input to Doxygen, rendering as separate Doxygen _pages_—free-form documentation files that Doxygen imposes no structure or hierarchy on. `bdedox`, however, expects all documentation to be in BDE-style, including class- and function-level documentation; since we converted both of these into Doxygen style, we cannot use the tool. The only way to follow this method of teaching Doxygen to treat our component-level documentation as pages is to write our own filter program. This is a larger undertaking to support a legacy documentation format, which we have already half-converted away from. The second and alternative strategy is to map package groups, packages, and components onto entities that Doxygen already natively understands. We elected to use this strategy for this patch. However, in the case of components, there is no obvious C++-level entity that uniquely corresponds to a component. Instead, in this patch, we commit the sin of conflating the header file associated with a component with the component itself. That is, we apply _component-level documentation_ to the _component header file_. After applying this patch, then, the header file within a component (say, `bmqa_component`) will have a Doxygen-style comment near its top that starts with `@file bmqa_component.h`, and which then contains the documentation for `bmqa_component`. This approach, though easier, has its downsides. 1. First, when referencing the documentation for another component in the library, we have to reference the header file name rather than the component name. So, if some documentation comment wants to point to the documentation for component `bmqa_component`, it must reference it with `@ref bmqa_component.h`. This might be confusing to users familiar with our BDE-style organization, but if we prefer, we can render it correctly with `\[bmqa_component\](@ref bmqa_component.h)`, at the cost of noisier documentation comments. 2. Second, when generated, component-level documentation will be found under the `Files` documentation in the left-hand navigation column, buried within several subdirectories. We can partially solve this by configuring Doxygen to strip the unnecessary subdirectories from file paths, but users may still not be inclined to look under `Files` for important documentation. I cannot see a way to rename this portion of the documentation from `Files` to `Components`. [bde-tools]: https://github.com/bloomberg/bde-tools Notes on Documentation Markup ============================= Doxygen understands Markdown and HTML formatting rather than BDE-style documentation, so we have manually converted BDE-style markup to Markdown and, in more advanced cases, HTML. The resulting HTML is less-readable than BDE-style markup, but produces easier-to-understand Doxygen documentation. Sections within the component-level documentation are rendered using Markdown headings, with unique IDs, constructed by prefixing the component name with a short identifier. Unfortunately, even if they are not referenced from other components, these IDs must be unique across the entire project, meaning we cannot get by with shorter identifiers. Doxygen will warn us when it encounters an identifier that is not unique, though, which is a good way to catch these issues. Within the same documentation comment, we can link to a section just using a simple Markdown link: `\[some link\](#bmqa_component_section)`. If we want to link to a section in a different component, we can use Doxygen’s referencing capability: `\[some link\](@ref #bmqa_component_section)`. The biggest benefit of Doxygen is that we do not need to list the entities that are exposed by some component manually in the documentation comment; instead, Doxygen will collect these itself and produce the list for us. As such, we have removed the `@CLASSES` section from the component-level documentation. At the moment, this is not a perfect substitution, as some private entities witehin components are not properly marked as private, and are thus included within the generated entity lists. We will fix this with a later patch. We have mapped BDE `@PURPOSE` sections to Doxygen `@brief` documentation and `@DESCRIPTION` sections to Doxygen long documentation (which isn’t explicitly marked in a Doxygen documentation comment). We have also used the Doxygen `@see` command to implement BDE `@SEE_ALSO` sections. Testing ======= The changes in this patch are simple in principle, but were performed manually. Verifying that the changes in this patch are correct was done by generating the documentation by running `doxygen` from the root directory of this repository, ensuring that no new warnings or errors are produced by it, and then manually reviewing the generated documentation for its fidelity. This last step is tedious and prone to mistakes, so we relied heavily on the warnings from Doxygen to ensure our documentation was correct. Despite this, there are still a few warnings that are produced. Doxygen’s parser seems to be confused by several BDE macros, which it cannot find the definitions of. These warnings can be fixed by predefining those macros, but this is left to a future patch. Signed-off-by: Patrick M. Niedzielski --- src/groups/bmq/bmqa/bmqa_abstractsession.h | 14 +- src/groups/bmq/bmqa/bmqa_closequeuestatus.h | 34 +- .../bmq/bmqa/bmqa_configurequeuestatus.h | 34 +- .../bmq/bmqa/bmqa_confirmeventbuilder.h | 158 +-- src/groups/bmq/bmqa/bmqa_event.h | 50 +- .../bmq/bmqa/bmqa_manualhosthealthmonitor.h | 19 +- src/groups/bmq/bmqa/bmqa_message.h | 79 +- src/groups/bmq/bmqa/bmqa_messageevent.h | 36 +- .../bmq/bmqa/bmqa_messageeventbuilder.h | 453 +++---- src/groups/bmq/bmqa/bmqa_messageiterator.h | 37 +- src/groups/bmq/bmqa/bmqa_messageproperties.h | 79 +- src/groups/bmq/bmqa/bmqa_mocksession.h | 1036 +++++++++-------- src/groups/bmq/bmqa/bmqa_openqueuestatus.h | 34 +- src/groups/bmq/bmqa/bmqa_queueid.h | 19 +- src/groups/bmq/bmqa/bmqa_session.h | 1017 ++++++++-------- src/groups/bmq/bmqa/bmqa_sessionevent.h | 56 +- src/groups/bmq/bmqpi/bmqpi_dtcontext.h | 39 +- src/groups/bmq/bmqpi/bmqpi_dtspan.h | 23 +- src/groups/bmq/bmqpi/bmqpi_dttracer.h | 14 +- .../bmq/bmqpi/bmqpi_hosthealthmonitor.h | 16 +- .../bmq/bmqt/bmqt_compressionalgorithmtype.h | 19 +- src/groups/bmq/bmqt/bmqt_correlationid.h | 297 ++--- src/groups/bmq/bmqt/bmqt_encodingtype.h | 31 +- src/groups/bmq/bmqt/bmqt_hosthealthstate.h | 21 +- src/groups/bmq/bmqt/bmqt_messageeventtype.h | 24 +- src/groups/bmq/bmqt/bmqt_messageguid.h | 105 +- src/groups/bmq/bmqt/bmqt_propertytype.h | 57 +- src/groups/bmq/bmqt/bmqt_queueflags.h | 18 +- src/groups/bmq/bmqt/bmqt_queueoptions.h | 47 +- src/groups/bmq/bmqt/bmqt_resultcode.h | 56 +- src/groups/bmq/bmqt/bmqt_sessioneventtype.h | 154 +-- src/groups/bmq/bmqt/bmqt_sessionoptions.h | 203 ++-- src/groups/bmq/bmqt/bmqt_subscription.h | 20 +- src/groups/bmq/bmqt/bmqt_uri.h | 208 ++-- src/groups/bmq/bmqt/bmqt_version.h | 48 +- 35 files changed, 2316 insertions(+), 2239 deletions(-) diff --git a/src/groups/bmq/bmqa/bmqa_abstractsession.h b/src/groups/bmq/bmqa/bmqa_abstractsession.h index 06c61cb901..9c3c768885 100644 --- a/src/groups/bmq/bmqa/bmqa_abstractsession.h +++ b/src/groups/bmq/bmqa/bmqa_abstractsession.h @@ -17,15 +17,11 @@ #ifndef INCLUDED_BMQA_ABSTRACTSESSION #define INCLUDED_BMQA_ABSTRACTSESSION -//@PURPOSE: Provide a pure protocol for a BlazingMQ session. -// -//@CLASSES: -// bmqa::AbstractSession: Interface for a BlazingMQ session. -// -//@DESCRIPTION: -// 'bmqa::AbstractSession' is a pure protocol for a BlazingMQ session. - -// BMQ +/// @file bmqa_abstractsession.h +/// +/// @brief Provide a pure protocol for a BlazingMQ session. +/// +/// @bbref{bmqa::AbstractSession} is a pure protocol for a BlazingMQ session. #include #include diff --git a/src/groups/bmq/bmqa/bmqa_closequeuestatus.h b/src/groups/bmq/bmqa/bmqa_closequeuestatus.h index c9700919a9..dad7cbe8a4 100644 --- a/src/groups/bmq/bmqa/bmqa_closequeuestatus.h +++ b/src/groups/bmq/bmqa/bmqa_closequeuestatus.h @@ -17,22 +17,24 @@ #ifndef INCLUDED_BMQA_CLOSEQUEUESTATUS #define INCLUDED_BMQA_CLOSEQUEUESTATUS -//@PURPOSE: Provide Value-Semantic Type for a close queue operation status -// -//@CLASSES: -// bmqa::CloseQueueStatus: value-semantic type for a closeQueue result -// -//@DESCRIPTION: This component provides a specific value-semantic type for the -// result of a close queue operation with the BlazingMQ broker, providing -// applications with the result and context of the requested operation. -// -// A 'bmqa::CloseQueueStatus' type is composed of 3 attributes: -//: o !result!: indicates the status of the operation (success, -//: failure, etc.) as specified in the corresponding -//: result code enum, 'bmqt::CloseQueueResult::Enum' -//: o !queueId!: queueId associated with the close queue operation -//: o !errorDescription!: optional string with a human readable description of -//: the error, if any +/// @file bmqa_closequeuestatus.h +/// +/// @brief Provide Value-Semantic Type for a close queue operation status +/// +/// This component provides a specific value-semantic type for the result of a +/// close queue operation with the BlazingMQ broker, providing applications +/// with the result and context of the requested operation. +/// +/// A @bbref{bmqa::CloseQueueStatus} type is composed of 3 attributes: +/// +/// 1. **result**: indicates the status of the operation (success, failure, +/// etc.) as specified in the corresponding result code enum, +/// @bbref{bmqt::CloseQueueResult::Enum}. +/// +/// 2. **queueId**: queueId associated with the close queue operation. +/// +/// 3. **errorDescription**: optional string with a human readable +/// description of the error, if any. // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_configurequeuestatus.h b/src/groups/bmq/bmqa/bmqa_configurequeuestatus.h index 834faf16ac..f236fe8844 100644 --- a/src/groups/bmq/bmqa/bmqa_configurequeuestatus.h +++ b/src/groups/bmq/bmqa/bmqa_configurequeuestatus.h @@ -17,22 +17,24 @@ #ifndef INCLUDED_BMQA_CONFIGUREQUEUESTATUS #define INCLUDED_BMQA_CONFIGUREQUEUESTATUS -//@PURPOSE: Provide Value-Semantic Type for a configure queue operation status -// -//@CLASSES: -// bmqa::ConfigureQueueStatus: value-semantic type for a configureQueue result -// -//@DESCRIPTION: This component provides a specific value-semantic type for the -// result of a configure queue operation with the BlazingMQ broker, providing -// applications with the result and context of the requested operation. -// -// A 'bmqa::ConfigureQueueStatus' type is composed of 3 attributes: -//: o !result!: indicates the status of the operation (success, -//: failure, etc.) as specified in the corresponding -//: result code enum, 'bmqt::ConfigureQueueResult::Enum' -//: o !queueId!: queueId associated with the configure queue operation -//: o !errorDescription!: optional string with a human readable description of -//: the error, if any +/// @file bmqa_configurequeuestatus.h +/// +/// @brief Provide Value-Semantic Type for a configure queue operation status +/// +/// This component provides a specific value-semantic type for the result of a +/// configure queue operation with the BlazingMQ broker, providing applications +/// with the result and context of the requested operation. +/// +/// A @bbref{bmqa::ConfigureQueueStatus} type is composed of 3 attributes: +/// +/// 1. **result**: indicates the status of the operation (success, failure, +/// etc.) as specified in the corresponding result code enum, +/// @bbref{bmqt::ConfigureQueueResult::Enum}. +/// +/// 2. **queueId**: queueId associated with the configure queue operation. +/// +/// 3. **errorDescription**: optional string with a human readable +/// description of the error, if any // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h b/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h index d0bd2440f0..ca2f14db82 100644 --- a/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h +++ b/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h @@ -17,83 +17,87 @@ #ifndef INCLUDED_BMQA_CONFIRMEVENTBUILDER #define INCLUDED_BMQA_CONFIRMEVENTBUILDER -//@PURPOSE: Provide a builder for batching confirmation messages. -// -//@CLASSES: -// bmqa::ConfirmEventBuilder: builder for batching confirmation messages. -// -//@DESCRIPTION: This component implements a mechanism, -// 'bmqa::ConfirmEventBuilder', that can be used for batching CONFIRM messages. -// The resulting batch can be sent to the BlazingMQ broker using the -// 'bmqa::Session' (refer to 'bmqa_session' for details). Wherever possible, a -// BlazingMQ consumer should try to send a batch of CONFIRM messages, which is -// more efficient than confirming messages individually. -// -// The builder holds a batch of CONFIRM messages under construction, and -// provides two flavors of 'addMessageConfirmation' method to add a CONFIRM -// message to the batch. It also provides a routine to retrieve number of -// CONFIRM messages added to the batch. Once application is done creating the -// batch, it can retrieve the blob (wire-representation) of the batch and send -// it via 'bmqa::Session'. See 'Usage' section for more details. -// -/// Usage -///----- -//: o An instance of bmqa::ConfirmEventBuilder (the builder) can be used to -//: create multiple batches of CONFIRM messages. The recommended approach is -//: to create one instance of the builder and use it throughout the lifetime -//: of the task (if the task is multi-threaded, an instance per thread must -//: be created and maintained). See usage example #1 for an illustration. -//: -//: o The lifetime of an instance of the builder is bound by the bmqa::Session -//: from which it was created. In other words, bmqa::Session instance must -//: outlive the builder instance. -// -/// Example 1 - Basic Usage -///----------------------- -//.. -// // In this snippet, we will send a batch of CONFIRMs for all the -// // 'bmqa::Message' messages received in a 'bmqa::MessageEvent'. -// -// // Note that error handling is omitted from the snippet for the sake of -// // brevity. -// -// bmqa::Session session; -// // Session start up logic elided. -// -// // Create and load an instance of the ConfirmEventBuilder. Note that in -// // this example, we are creating the builder on the stack everytime a -// // message event is received. Another approach can be to maintain the -// // builder as a data member and use it everytime. -// -// bmqa::ConfirmEventBuilder builder; -// session.loadConfirmEventBuilder(&builder); -// -// // Assuming that a 'bmqa::MessageEvent' is received. -// -// bmqa::MessageIterator iter = messageEvent.messageIterator(); -// while (iter.nextMessage()) { -// const bmqa::Message& msg = iter.message(); -// -// // Business logic for processing 'msg' elided. -// -// int rc = builder.addMessageConfirmation(msg); -// // Error handling elided. -// } -// -// // All messages in the event have been processed and their corresponding -// // CONFIRM messages have been batched. Now its time to send the batch to -// // the BlazingMQ broker. -// -// int rc = session.confirmMessages(&builder); -// // Error handling elided. Note that in case of success, above method -// // will also reset the 'builder'. -//.. -// -/// Thread Safety -///------------- -// This component is *NOT* thread safe. If it is desired to create a batch of -// CONFIRM messages from multiple threads, an instance of the builder must be -// created and maintained *per* *thread*. +/// @file bmqa_confirmeventbuilder.h +/// +/// @brief Provide a builder for batching confirmation messages. +/// +/// This component implements a mechanism, @bbref{bmqa::ConfirmEventBuilder}, +/// that can be used for batching CONFIRM messages. The resulting batch can be +/// sent to the BlazingMQ broker using the @bbref{bmqa::Session} (refer to @ref +/// bmqa_session.h for details). Wherever possible, a BlazingMQ consumer +/// should try to send a batch of CONFIRM messages, which is more efficient +/// than confirming messages individually. +/// +/// The builder holds a batch of CONFIRM messages under construction, and +/// provides two flavors of addMessageConfirmation method to add a CONFIRM +/// message to the batch. It also provides a routine to retrieve number of +/// CONFIRM messages added to the batch. Once application is done creating the +/// batch, it can retrieve the blob (wire-representation) of the batch and send +/// it via @bbref{bmqa::Session}. See [the usage +/// section](#bmqa_confirmeventbuilder_usage) for more details. +/// +/// Usage {#bmqa_confirmeventbuilder_usage} +/// ===== +/// +/// - An instance of @bbref{bmqa::ConfirmEventBuilder} (the builder) can be +/// used to create multiple batches of CONFIRM messages. The recommended +/// approach is to create one instance of the builder and use it throughout +/// the lifetime of the task (if the task is multi-threaded, an instance +/// per thread must be created and maintained). See [usage example +/// 1](#bmqa_confirmeventbuilder_ex1) for an illustration. +/// +/// - The lifetime of an instance of the builder is bound by the +/// @bbref{bmqa::Session} from which it was created. In other words, +/// @bbref{bmqa::Session} instance must outlive the builder instance. +/// +/// Example 1 - Basic Usage {#bmqa_confirmeventbuilder_ex1} +/// ----------------------- +/// +/// ``` +/// // In this snippet, we will send a batch of CONFIRMs for all the +/// // 'bmqa::Message' messages received in a 'bmqa::MessageEvent'. +/// +/// // Note that error handling is omitted from the snippet for the sake of +/// // brevity. +/// +/// bmqa::Session session; +/// // Session start up logic elided. +/// +/// // Create and load an instance of the ConfirmEventBuilder. Note that in +/// // this example, we are creating the builder on the stack everytime a +/// // message event is received. Another approach can be to maintain the +/// // builder as a data member and use it everytime. +/// +/// bmqa::ConfirmEventBuilder builder; +/// session.loadConfirmEventBuilder(&builder); +/// +/// // Assuming that a 'bmqa::MessageEvent' is received. +/// +/// bmqa::MessageIterator iter = messageEvent.messageIterator(); +/// while (iter.nextMessage()) { +/// const bmqa::Message& msg = iter.message(); +/// +/// // Business logic for processing 'msg' elided. +/// +/// int rc = builder.addMessageConfirmation(msg); +/// // Error handling elided. +/// } +/// +/// // All messages in the event have been processed and their corresponding +/// // CONFIRM messages have been batched. Now its time to send the batch to +/// // the BlazingMQ broker. +/// +/// int rc = session.confirmMessages(&builder); +/// // Error handling elided. Note that in case of success, above method +/// // will also reset the 'builder'. +/// ``` +/// +/// Thread Safety {#bmqa_confirmeventbuilder_thread} +/// ============= +/// +/// This component is *NOT* thread safe. If it is desired to create a batch of +/// CONFIRM messages from multiple threads, an instance of the builder must be +/// created and maintained *per* *thread*. // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_event.h b/src/groups/bmq/bmqa/bmqa_event.h index 3b18e0469b..e0ad5308ea 100644 --- a/src/groups/bmq/bmqa/bmqa_event.h +++ b/src/groups/bmq/bmqa/bmqa_event.h @@ -17,31 +17,31 @@ #ifndef INCLUDED_BMQA_EVENT #define INCLUDED_BMQA_EVENT -//@PURPOSE: Provide a generic variant encompassing all types of events. -// -//@CLASSES: -// bmqa::Event: variant encompassing all types of events. -// -//@SEE_ALSO: -// bmqa::MessageEvent : Data event notification. -// bmqa::SessionEvent : Session and queue status event notification. -// -//@DESCRIPTION: This component provides a generic 'bmqa::Event' notification -// object used by the 'bmqa::Session' to provide BlazingMQ applications with -// information regarding the status of the session or data coming from queues. -// This 'bmqa::Event' object is only used when user wants to process messages -// from the EventQueue using its own thread, by calling the -// bmqa::Session::nextEvent method. -// -// A 'bmqa::Event' can either be a 'bmqa::SessionEvent' or a -// 'bmqa::MessageEvent'. The former describes notifications such as the result -// of a session start or the opening of a queue. The latter carries -// application messages retrieved from a queue. -// -// Note that event is implemented using the pimpl idiom, so copying an event is -// very cheap (a pointer copy). All copies of this 'bmqa::Event', as well as -// any 'SessionEvent' or 'MessageEvent' extracted from it will share the same -// underlying implementation. +/// @file bmqa_event.h +/// +/// @brief Provide a generic variant encompassing all types of events. +/// +/// This component provides a generic @bbref{bmqa::Event} notification object +/// used by the @bbref{bmqa::Session} to provide BlazingMQ applications with +/// information regarding the status of the session or data coming from queues. +/// This @bbref{bmqa::Event} object is only used when user wants to process +/// messages from the EventQueue using its own thread, by calling the +/// @bbref{bmqa::Session::nextEvent} method. +/// +/// A @bbref{bmqa::Event} can either be a @bbref{bmqa::SessionEvent} or a +/// @bbref{bmqa::MessageEvent}. The former describes notifications such as the +/// result of a session start or the opening of a queue. The latter carries +/// application messages retrieved from a queue. +/// +/// Note that event is implemented using the pimpl idiom, so copying an event +/// is very cheap (a pointer copy). All copies of this @bbref{bmqa::Event}, as +/// well as any @bbref{bmqa::SessionEvent} or @bbref{bmqa::MessageEvent} +/// extracted from it will share the same underlying implementation. +/// +/// @see @bbref{bmqa::MessageEvent}: +/// Data event notification. +/// @see @bbref{bmqa::SessionEvent}: +/// Session and queue status event notification. // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_manualhosthealthmonitor.h b/src/groups/bmq/bmqa/bmqa_manualhosthealthmonitor.h index 310eb79174..cfef7a6aeb 100644 --- a/src/groups/bmq/bmqa/bmqa_manualhosthealthmonitor.h +++ b/src/groups/bmq/bmqa/bmqa_manualhosthealthmonitor.h @@ -17,16 +17,15 @@ #ifndef INCLUDED_BMQA_MANUALHOSTHEALTHMONITOR #define INCLUDED_BMQA_MANUALHOSTHEALTHMONITOR -//@PURPOSE: Provide a minimal implementation of 'bmqpi::HostHealthMonitor'. -// -//@CLASSES: -// bmqa::ManualHostHealthMonitor: A 'HostHealthMonitor' that derives its host -// health state from a value explicitly set through a setter method. -// -//@DESCRIPTION: -// 'bmqa::ManualHostHealthMonitor' is a minimal implementation of -// 'bmqpi::HostHealthMonitor', which is primarily useful for unit-testing, and -// for integrating with other systems for determining host health. +/// @file bmqa_manualhosthealthmonitor.h +/// +/// @brief Provide a minimal implementation of +/// @bbref{bmqpi::HostHealthMonitor}. +/// +/// @bbref{bmqa::ManualHostHealthMonitor} is a minimal implementation of +/// @bbref{bmqpi::HostHealthMonitor}, which is primarily useful for +/// unit-testing, and for integrating with other systems for determining host +/// health. // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_message.h b/src/groups/bmq/bmqa/bmqa_message.h index 9d643eee04..e208352c0c 100644 --- a/src/groups/bmq/bmqa/bmqa_message.h +++ b/src/groups/bmq/bmqa/bmqa_message.h @@ -17,46 +17,45 @@ #ifndef INCLUDED_BMQA_MESSAGE #define INCLUDED_BMQA_MESSAGE -//@PURPOSE: Provide the application with a message data object. -// -//@CLASSES: -// bmqa::Message: message received from/sent to a queue -// bmqa::MessageConfirmationCookie: cookie for async message confirmation -// -//@SEE_ALSO: -// bmqa::MessageEvent : Mechanism for data event notification. -// bmqa::MessageEventBuilder: Builder for 'bmqa::MessageEvent' -// -//@DESCRIPTION: A 'bmqa::Message' represents the data message to put on a -// queue, or retrieved from a queue. It is composed of the following fields: -// -//: o A message GUID, which is a printable string generated by the broker to -//: uniquely identify this message. -//: -//: o A correlation Id, which is a user-provided identifier for the message. -//: -//: o A queue Id, to map with the queue this message is associated with. -//: -//: o The payload, which is opaque to the framework. At some point, framework -//: may provide utilities to encode and decode schema messages using various -//: CODECs. For example, a JavaScript publisher may publish a message into -//: a queue using a JSON object as payload, and the consumer may be receiving -//: that payload as a BER-encoded schema object. -//: -//: o At some point, system properties such as version, encoding, timestamp, -//: priority, message group and "reply-to" will be supported. System -//: properties will be used by the broker; for example to deliver -//: high-priority messages first or to filter based on a minimum version. -//: -//: o At some point, application-defined message properties will also be -//: supported, where properties are a list of name-value pairs. -// -// A 'bmqa::MessageConfirmationCookie' is a small object which allows to -// confirm a 'bmqa::Message' asynchronously without having to hold on to the -// entire message. This can be useful when, for example, the message is -// decoded in the event handler, and the resulting object is enqueued for -// asynchronous processing, along with that small cookie object for confirming -// the message once successfully processed. +/// @file bmqa_message.h +/// +/// @brief Provide the application with a message data object. +/// +/// A @bbref{bmqa::Message} represents the data message to put on a queue, or +/// retrieved from a queue. It is composed of the following fields: +/// +/// - A message GUID, which is a printable string generated by the broker to +/// uniquely identify this message. +/// +/// - A correlation Id, which is a user-provided identifier for the message. +/// +/// - A queue Id, to map with the queue this message is associated with. +/// +/// - The payload, which is opaque to the framework. At some point, framework +/// may provide utilities to encode and decode schema messages using +/// various CODECs. For example, a JavaScript publisher may publish a +/// message into a queue using a JSON object as payload, and the consumer +/// may be receiving that payload as a BER-encoded schema object. +/// +/// - At some point, system properties such as version, encoding, timestamp, +/// priority, message group and "reply-to" will be supported. System +/// properties will be used by the broker; for example to deliver +/// high-priority messages first or to filter based on a minimum version. +/// +/// - At some point, application-defined message properties will also be +/// supported, where properties are a list of name-value pairs. +/// +/// A @bbref{bmqa::MessageConfirmationCookie} is a small object which allows to +/// confirm a @bbref{bmqa::Message} asynchronously without having to hold on to +/// the entire message. This can be useful when, for example, the message is +/// decoded in the event handler, and the resulting object is enqueued for +/// asynchronous processing, along with that small cookie object for confirming +/// the message once successfully processed. +/// +/// @see @bbref{bmqa::MessageEvent}: +/// Mechanism for data event notification. +/// @see @bbref{bmqa::MessageEventBuilder}: +/// Builder for @bbref{bmqa::MessageEvent}. // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_messageevent.h b/src/groups/bmq/bmqa/bmqa_messageevent.h index 484c446e0d..b3b58fda04 100644 --- a/src/groups/bmq/bmqa/bmqa_messageevent.h +++ b/src/groups/bmq/bmqa/bmqa_messageevent.h @@ -17,23 +17,25 @@ #ifndef INCLUDED_BMQA_MESSAGEEVENT #define INCLUDED_BMQA_MESSAGEEVENT -//@PURPOSE: Provide the application with data event notifications. -// -//@CLASSES: -// bmqa::MessageEvent: Mechanism for data event notification. -// -//@SEE_ALSO: -// bmqa::MessageIterator: iterator over the messages in this event -// bmqa::Message: type of the Message -// -//@DESCRIPTION: This component provides a 'bmqa::MessageEvent' notification -// object used by the 'bmqa::Session' to provide BlazingMQ applications with -// data messages received from the broker. The application can consume the -// messages by asking this 'MessageEvent' for a 'MessageIterator'. -// -// Note that 'MessageEvent' is implemented using the pimpl idiom, so copying a -// 'MessageEvent' is very cheap (a pointer copy). All copies of this -// 'MessageEvent' will share the same underlying implementation. +/// @file bmqa_messageevent.h +/// +/// @brief Provide the application with data event notifications. +/// +/// This component provides a @bbref{bmqa::MessageEvent} notification object +/// used by the @bbref{bmqa::Session} to provide BlazingMQ applications with +/// data messages received from the broker. The application can consume the +/// messages by asking this @bbref{bmqa::MessageEvent} for a +/// @bbref{bmqa::MessageIterator}. +/// +/// Note that @bbref{bmqa::MessageEvent} is implemented using the pimpl idiom, +/// so copying a @bbref{bmqa::MessageEvent} is very cheap (a pointer copy). +/// All copies of this @bbref{bmqa::MessageEvent} will share the same +/// underlying implementation. +/// +/// @see @bbref{bmqa::MessageIterator}: +/// iterator over the messages in this event +/// @see @bbref{bmqa::Message}: +/// type of the Message // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h index b774e0cb47..1fc2a56ecf 100644 --- a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h +++ b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h @@ -17,225 +17,240 @@ #ifndef INCLUDED_BMQA_MESSAGEEVENTBUILDER #define INCLUDED_BMQA_MESSAGEEVENTBUILDER -//@PURPOSE: Provide a builder for 'MessageEvent' objects. -// -//@CLASSES: -// bmqa::MessageEventBuilder: a builder for 'MessageEvent'. -// -//@DESCRIPTION: This component implements a mechanism, -// 'bmqa::MessageEventBuilder', that can be used for creating message events -// containing one or multiple messages. The resulting MessageEvent can be sent -// to the BlazingMQ broker using the 'bmqa::Session' (refer to 'bmqa_session' -// for details). -// -// The builder holds a 'MessageEvent' under construction, and provides methods -// to return a reference to the current message (in order to set its various -// members), as well as to append a new message. Once the application is done, -// the builder provides a method to get the message event that has been -// constructed. See 'Usage' section for more details. -// -// Note that publishing events containing multiple messages may be more -// efficient than events limited to a single message for applications that send -// large volume of small messages. -// -/// Usage -///----- -//: o An instance of bmqa::MessageEventBuilder (the builder) can be used to -//: create multiple bmqa::MessageEvent's, as long as the instance is reset in -//: between. This reset is preferably to do right after sending the event to -//: guarantee that all user resources bound to the bmqa::MessageEvent (e.g. -//: CorrelationIds with user's shared_ptr) are kept no longer than expected -//: (e.g. until related ACK event is received). The recommended approach is -//: to create one instance of the builder and use that throughout the -//: lifetime of the task (if the task is multi-threaded, an instance per -//: thread must be created and maintained). -//: See usage example #1 for an illustration. -//: -//: o The lifetime of an instance of the builder is bound by the bmqa::Session -//: from which it was created. In other words, bmqa::Session instance must -//: outlive the builder instance. -//: -//: o If it is desired to post the same bmqa::Message to different queues, -//: 'packMessage' can be called multiple times in a row with different queue -//: IDs. The builder will append the previously packed message with the new -//: queue ID to the underlying message event. Note that after calling -//: 'packMessage', the message keeps all the attributes (payload, properties, -//: etc) that were previously set (except for the 'correlationId' which must -//: be set explicitly for each individual message). If desired, any -//: attribute can be tweaked before being packing the message again. Refer -//: to usage example #2 for an illustration. -// -/// Example 1 - Basic Usage -///----------------------- -//.. -// // Note that error handling is omitted below for the sake of brevity -// -// bmqa::Session session; -// // Session start up logic omitted for brevity. -// -// // Obtain a valid instance of message properties. -// bmqt::MessageProperties properties; -// session.loadMessageProperties(&properties); -// -// // Set common properties that will be applicable to all messages sent by -// // this application. -// int rc = properties.setPropertyAsChar( -// "encoding", -// static_cast(MyEncodingEnum::e_BER)); -// -// rc = properties.setPropertyAsString("producerId", "MyUniqueId"); -// -// // Obtain a valid instance of message event builder. -// bmqa::MessageEventBuilder builder; -// session.loadMessageEventBuilder(&builder); -// -// // Create and post a message event containing 1 message. Associate -// // properties with this message. -// bmqa::Message& msg = builder.startMessage(); -// -// msg.setCorrelationId(myCorrelationId); -// -// // Set payload (where 'myPayload' is of type 'bdlbb::Blob') -// msg.setDataRef(&myPayload); -// -// // Set current timestamp as one of the properties. -// rc = properties.setPropertyAsInt64( -// "timestamp", -// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); -// -// // Set properties. -// msg.setPropertiesRef(&properties); -// -// // Pack the message. -// rc = builder.packMessage(myQueueId); -// -// // Post message event -// rc = session.post(builder.messageEvent()); -// -// -// // Create and post another message event containing 1 message. -// -// // bmqa::MessageEventBuilder must be reset before reuse. -// builder.reset(); -// -// // Start a new message. -// bmqa::Message& msg = builder.startMessage(); -// -// msg.setCorrelationId(myAnotherCorrelationId); -// msg.setDataRef(&myAnotherPayload); -// -// // It's okay (and recommended) to use same properties instance. -// rc = properties.setPropertyAsInt64( -// "timestamp", -// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); -// -// msg.setPropertiesRef(&properties); -// rc = builder.packMessage(myAnotherQueueId); -// -// // Post second message event -// rc = session.post(builder.messageEvent()); -// -// // Reset the builder to free resources earlier. -// builder.reset(); -//.. -// -/// Example 2 - Packing multiple messages in a message event -///-------------------------------------------------------- -//.. -// // Note that error handling is omitted below for the sake of brevity -// -// bmqa::Session session; -// // Session start up logic omitted for brevity. -// -// // Obtain a valid instance of message properties. -// bmqt::MessageProperties properties; -// session.loadMessageProperties(&properties); -// -// // Set common properties that will be applicable to all messages sent by -// // this application. -// int rc = properties.setPropertyAsChar( -// "encoding", -// static_cast(MyEncodingEnum::e_BER)); -// -// rc = properties.setPropertyAsString("producerId", "MyUniqueId"); -// -// // Obtain a valid instance of message event builder. -// bmqa::MessageEventBuilder builder; -// session.loadMessageEventBuilder(&builder); -// -// // Create and post a message event containing 4 messages. -// bmqa::Message& msg = builder.startMessage(); -// -// // Pack message #1 -// msg.setCorrelationId(correlationId1); -// msg.setDataRef(&payload1); // where 'payload1' is of type 'bdlbb::Blob' -// -// // Set current timestamp as one of the properties. -// int rc = properties.setPropertyAsInt64( -// "timestamp", -// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); -// -// // Pack the message. -// rc = builder.packMessage(queueId1); -// -// // Pack message #2 -// // We want to send message #1 to another queue. In order to do so, we -// // just update the correlation ID of message #1. There is no need to set -// // the payload or properties again. Because 'payload1' and 'properties' -// // objects are being reused for the second message, they should not be -// // destroyed before packing the second message. -// -// msg.setCorrelationId(correlationId2); -// -// // Also note that the "timestamp" property for the second message will be -// // updated for this message. There is no need to invoke -// // 'setPropertiesRef' on the message though. -// rc = properties.setPropertyAsInt64( -// "timestamp", -// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); -// -// rc = builder.packMessage(queueId2); -// -// // 'payload1' can be safely destroyed at this point if it will not be -// // reused again for another message. -// -// // Pack message #3 -// // Message #3 has a different payload, no properties and destined to -// // 'queueId1'. -// msg.setCorrelationId(correlationId3); -// msg.setDataRef(&payload2); // where 'payload2' is of type 'bdlbb::Blob' -// -// // We need to explicitly clear out the associated properties. -// msg.clearProperties(); -// -// rc = builder.packMessage(queueId1); -// -// // Pack message #4 -// // Message #4 has different payload and destined to 'queueId3'. -// msg.setCorrelationId(correlationId4); -// msg.setDataRef(&payload3); // where 'payload3' is of type 'bdlbb::Blob' -// -// // Update "timestamp" property. -// rc = properties.setPropertyAsInt64( -// "timestamp", -// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); -// -// // Need to associate properties with the message, since they were cleared -// // out while packing message #3 above. -// msg.setPropertiesRef(&properties); -// -// rc = builder.packMessage(queueId3); -// -// // Post second message event -// rc = session.post(builder.messageEvent()); -// -// // Reset the builder to free resources earlier. -// builder.reset(); -//.. -// -/// Thread Safety -///------------- -// This component is *NOT* thread safe. +// Clang-format warns about an overlong line in this comment, which gives a +// Markdown anchor to a header. Unfortunately, by Markdown syntax rules, this +// has to on the same line as the header, meaning we cannot introduce a +// line-break here. + +// clang-format off + +/// @file bmqa_messageeventbuilder.h +/// +/// @brief Provide a builder for @bbref{bmqa::MessageEvent} objects. +/// +/// This component implements a mechanism, @bbref{bmqa::MessageEventBuilder}, +/// that can be used for creating message events containing one or multiple +/// messages. The resulting MessageEvent can be sent to the BlazingMQ broker +/// using the @bbref{bmqa::Session} (refer to @ref bmqa_session.h for details). +/// +/// The builder holds a @bbref{bmqa::MessageEvent} under construction, and +/// provides methods to return a reference to the current message (in order to +/// set its various members), as well as to append a new message. Once the +/// application is done, the builder provides a method to get the message event +/// that has been constructed. See @ref bmqa_messageeventbuilder_usage section +/// for more details. +/// +/// Note that publishing events containing multiple messages may be more +/// efficient than events limited to a single message for applications that +/// send large volume of small messages. +/// +/// Usage {#bmqa_messageeventbuilder_usage} +/// ===== +/// +/// - An instance of @bbref{bmqa::MessageEventBuilder} (the builder) can be +/// used to create multiple @bbref{bmqa::MessageEvent}'s, as long as the +/// instance is reset in between. This reset is preferably to do right +/// after sending the event to guarantee that all user resources bound to +/// the @bbref{bmqa::MessageEvent} (e.g. CorrelationIds with user's +/// shared_ptr) are kept no longer than expected (e.g. until related ACK +/// event is received). The recommended approach is to create one instance +/// of the builder and use that throughout the lifetime of the task (if the +/// task is multi-threaded, an instance per thread must be created and +/// maintained). See [usage example 1](#bmqa_messageeventbuilder_ex1) for +/// an illustration. +/// +/// - The lifetime of an instance of the builder is bound by the +/// @bbref{bmqa::Session} from which it was created. In other words, +/// @bbref{bmqa::Session} instance must outlive the builder instance. +/// +/// - If it is desired to post the same @bbref{bmqa::Message} to different +/// queues, @bbref{bmqa::MessageEventBuilder::packMessage} can be called +/// multiple times in a row with different queue IDs. The builder will +/// append the previously packed message with the new queue ID to the +/// underlying message event. Note that after calling +/// @bbref{bmqa::MessageEventBuilder::packMessage}, the message keeps all +/// the attributes (payload, properties, etc) that were previously set +/// (except for the `correlationId` which must be set explicitly for each +/// individual message). If desired, any attribute can be tweaked before +/// being packing the message again. Refer to [usage example +/// 2](#bmqa_messageeventbuilder_ex2) for an illustration. +/// +/// Example 1 - Basic Usage {#bmqa_messageeventbuilder_ex1} +/// ----------------------- +/// +/// ``` +/// // Note that error handling is omitted below for the sake of brevity +/// +/// bmqa::Session session; +/// // Session start up logic omitted for brevity. +/// +/// // Obtain a valid instance of message properties. +/// bmqt::MessageProperties properties; +/// session.loadMessageProperties(&properties); +/// +/// // Set common properties that will be applicable to all messages sent by +/// // this application. +/// int rc = properties.setPropertyAsChar( +/// "encoding", +/// static_cast(MyEncodingEnum::e_BER)); +/// +/// rc = properties.setPropertyAsString("producerId", "MyUniqueId"); +/// +/// // Obtain a valid instance of message event builder. +/// bmqa::MessageEventBuilder builder; +/// session.loadMessageEventBuilder(&builder); +/// +/// // Create and post a message event containing 1 message. Associate +/// // properties with this message. +/// bmqa::Message& msg = builder.startMessage(); +/// +/// msg.setCorrelationId(myCorrelationId); +/// +/// // Set payload (where 'myPayload' is of type 'bdlbb::Blob') +/// msg.setDataRef(&myPayload); +/// +/// // Set current timestamp as one of the properties. +/// rc = properties.setPropertyAsInt64( +/// "timestamp", +/// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); +/// +/// // Set properties. +/// msg.setPropertiesRef(&properties); +/// +/// // Pack the message. +/// rc = builder.packMessage(myQueueId); +/// +/// // Post message event +/// rc = session.post(builder.messageEvent()); +/// +/// +/// // Create and post another message event containing 1 message. +/// +/// // bmqa::MessageEventBuilder must be reset before reuse. +/// builder.reset(); +/// +/// // Start a new message. +/// bmqa::Message& msg = builder.startMessage(); +/// +/// msg.setCorrelationId(myAnotherCorrelationId); +/// msg.setDataRef(&myAnotherPayload); +/// +/// // It's okay (and recommended) to use same properties instance. +/// rc = properties.setPropertyAsInt64( +/// "timestamp", +/// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); +/// +/// msg.setPropertiesRef(&properties); +/// rc = builder.packMessage(myAnotherQueueId); +/// +/// // Post second message event +/// rc = session.post(builder.messageEvent()); +/// +/// // Reset the builder to free resources earlier. +/// builder.reset(); +/// ``` +/// +/// Example 2 - Packing multiple messages in a message event {#bmqa_messageeventbuilder_ex2} +/// -------------------------------------------------------- +/// +/// ``` +/// // Note that error handling is omitted below for the sake of brevity +/// +/// bmqa::Session session; +/// // Session start up logic omitted for brevity. +/// +/// // Obtain a valid instance of message properties. +/// bmqt::MessageProperties properties; +/// session.loadMessageProperties(&properties); +/// +/// // Set common properties that will be applicable to all messages sent by +/// // this application. +/// int rc = properties.setPropertyAsChar( +/// "encoding", +/// static_cast(MyEncodingEnum::e_BER)); +/// +/// rc = properties.setPropertyAsString("producerId", "MyUniqueId"); +/// +/// // Obtain a valid instance of message event builder. +/// bmqa::MessageEventBuilder builder; +/// session.loadMessageEventBuilder(&builder); +/// +/// // Create and post a message event containing 4 messages. +/// bmqa::Message& msg = builder.startMessage(); +/// +/// // Pack message #1 +/// msg.setCorrelationId(correlationId1); +/// msg.setDataRef(&payload1); // where 'payload1' is of type 'bdlbb::Blob' +/// +/// // Set current timestamp as one of the properties. +/// int rc = properties.setPropertyAsInt64( +/// "timestamp", +/// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); +/// +/// // Pack the message. +/// rc = builder.packMessage(queueId1); +/// +/// // Pack message #2 +/// // We want to send message #1 to another queue. In order to do so, we +/// // just update the correlation ID of message #1. There is no need to set +/// // the payload or properties again. Because 'payload1' and 'properties' +/// // objects are being reused for the second message, they should not be +/// // destroyed before packing the second message. +/// +/// msg.setCorrelationId(correlationId2); +/// +/// // Also note that the "timestamp" property for the second message will be +/// // updated for this message. There is no need to invoke +/// // 'setPropertiesRef' on the message though. +/// rc = properties.setPropertyAsInt64( +/// "timestamp", +/// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); +/// +/// rc = builder.packMessage(queueId2); +/// +/// // 'payload1' can be safely destroyed at this point if it will not be +/// // reused again for another message. +/// +/// // Pack message #3 +/// // Message #3 has a different payload, no properties and destined to +/// // 'queueId1'. +/// msg.setCorrelationId(correlationId3); +/// msg.setDataRef(&payload2); // where 'payload2' is of type 'bdlbb::Blob' +/// +/// // We need to explicitly clear out the associated properties. +/// msg.clearProperties(); +/// +/// rc = builder.packMessage(queueId1); +/// +/// // Pack message #4 +/// // Message #4 has different payload and destined to 'queueId3'. +/// msg.setCorrelationId(correlationId4); +/// msg.setDataRef(&payload3); // where 'payload3' is of type 'bdlbb::Blob' +/// +/// // Update "timestamp" property. +/// rc = properties.setPropertyAsInt64( +/// "timestamp", +/// bdlt::EpochUtil::convertToTimeT64(bdlt::CurrentTime::now())); +/// +/// // Need to associate properties with the message, since they were cleared +/// // out while packing message #3 above. +/// msg.setPropertiesRef(&properties); +/// +/// rc = builder.packMessage(queueId3); +/// +/// // Post second message event +/// rc = session.post(builder.messageEvent()); +/// +/// // Reset the builder to free resources earlier. +/// builder.reset(); +/// ``` +/// +/// Thread Safety {#bmqa_messageeventbuilder_thread} +/// ============= +/// +/// This component is *NOT* thread safe. + +// clang-format on // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_messageiterator.h b/src/groups/bmq/bmqa/bmqa_messageiterator.h index 0434e938bf..98e06e959e 100644 --- a/src/groups/bmq/bmqa/bmqa_messageiterator.h +++ b/src/groups/bmq/bmqa/bmqa_messageiterator.h @@ -17,23 +17,26 @@ #ifndef INCLUDED_BMQA_MESSAGEITERATOR #define INCLUDED_BMQA_MESSAGEITERATOR -//@PURPOSE: Provide a mechanism to iterate over the messages of a MessageEvent. -// -//@CLASSES: -// bmqa::MessageIterator: read-only sequential iterator on 'Message' objects -// -//@DESCRIPTION: 'bmqa::MessageIterator' is an iterator-like mechanism providing -// read-only sequential access to messages contained into a MessageEvent. -// -/// Usage -///----- -// Typical usage of this iterator should follow the following pattern: -//.. -// while (messageIterator.nextMessage()) { -// const Message& message = messageIterator.message(); -// // Do something with message -// } -//.. +/// @file bmqa_messageiterator.h +/// +/// @brief Provide a mechanism to iterate over the messages of a +/// @bbref{bmqa::MessageEvent}. +/// +/// +/// @bbref{bmqa::MessageIterator} is an iterator-like mechanism providing +/// read-only sequential access to messages contained into a +/// @bbref{bmqa::MessageEvent}. +/// +/// Usage {#bmqa_messageiterator_usage} +/// ===== +/// +/// Typical usage of this iterator should follow the following pattern: +/// ``` +/// while (messageIterator.nextMessage()) { +/// const Message& message = messageIterator.message(); +/// // Do something with message +/// } +/// ``` // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_messageproperties.h b/src/groups/bmq/bmqa/bmqa_messageproperties.h index 9745adbb86..e61c929dcb 100644 --- a/src/groups/bmq/bmqa/bmqa_messageproperties.h +++ b/src/groups/bmq/bmqa/bmqa_messageproperties.h @@ -17,46 +17,45 @@ #ifndef INCLUDED_BMQA_MESSAGEPROPERTIES #define INCLUDED_BMQA_MESSAGEPROPERTIES -//@PURPOSE: Provide a VST representing message properties. -// -//@CLASSES: -// bmqa::MessageProperties: VST representing message properties. -// bmqa::MessagePropertiesIterator: Mechanism to iterate over properties. -// -//@SEE ALSO: bmqt::PropertyType -// -//@DESCRIPTION: 'bmqa::MessageProperties' provides a VST representing message -// properties. Message properties are a collection of name-value pairs that -// producer can associate with a message, and consumer can retrieve from the -// corresponding message. In order to keep their usage flexible, no schema is -// enforced for the message properties, and their format (names and data types) -// should be negotiated by producers and consumers. Message properties can be -// used for routing, pipelining or filtering messages within the application. -// It can be efficient to specify such message attributes in the properties -// instead of the message payload, because application does not have to decode -// entire payload to retrieve these attributes. -// 'bmqa::MessagePropertiesIterator' provides a mechanism to iterate over all -// the properties of a 'bmqa::MessageProperties' object. -// -/// Restrictions on Property Names -///------------------------------ -// -//: o Length of a property name must be greater than zero and must *not* exceed -//: 'bmqa::MessageProperties::k_MAX_PROPERTY_NAME_LENGTH' -// -//: o First character of the property name must be alpha-numeric. -// -/// Restrictions on Property Values -///------------------------------- -// -//: o Length of a property value must be non-negative (ie, can be zero) and -//: must *not* exceed 'bmqa::MessageProperties::k_MAX_PROPERTY_VALUE_LENGTH'. -//: Note that this restriction is obviously applicable to property values -//: with types 'bmqt::PropertyType::e_STRING' and -//: 'bmqt::PropertyType::e_BINARY', because for all other property value -//: types, size is implicitly applicable based on the type (see 'Data Types -//: and Size' section in 'bmqt::PropertyType' component). -// +/// @file bmqa_messageproperties.h +/// +/// @brief Provide a VST representing message properties. +/// +/// @bbref{bmqa::MessageProperties} provides a VST representing message +/// properties. Message properties are a collection of name-value pairs that +/// producer can associate with a message, and consumer can retrieve from the +/// corresponding message. In order to keep their usage flexible, no schema is +/// enforced for the message properties, and their format (names and data +/// types) should be negotiated by producers and consumers. Message properties +/// can be used for routing, pipelining or filtering messages within the +/// application. It can be efficient to specify such message attributes in the +/// properties instead of the message payload, because application does not +/// have to decode entire payload to retrieve these attributes. +/// @bbref{bmqa::MessagePropertiesIterator} provides a mechanism to iterate +/// over all the properties of a @bbref{bmqa::MessageProperties} object. +/// +/// Restrictions on Property Names {#bmqa_messageproperties_namerestrictions} +/// ============================== +/// +/// - Length of a property name must be greater than zero and must *not* +/// exceed @bbref{bmqa::MessageProperties::k_MAX_PROPERTY_NAME_LENGTH}. +/// +/// - First character of the property name must be alpha-numeric. +/// +/// Restrictions on Property Values {#bmqa_messageproperties_valuerestrictions} +/// =============================== +/// +/// - Length of a property value must be non-negative (ie, can be zero) and +/// must *not* exceed +/// @bbref{bmqa::MessageProperties::k_MAX_PROPERTY_VALUE_LENGTH}. Note +/// that this restriction is obviously applicable to property values with +/// types @bbref{bmqt::PropertyType::e_STRING} and +/// @bbref{bmqt::PropertyType::e_BINARY}, because for all other property +/// value types, size is implicitly applicable based on the type (see @ref +/// bmqt_propertytype_types section in @bbref{bmqt::PropertyType} +/// component). +/// +/// @see @bbref{bmqt::PropertyType} // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_mocksession.h b/src/groups/bmq/bmqa/bmqa_mocksession.h index 1e50f8b223..ca11b53d4d 100644 --- a/src/groups/bmq/bmqa/bmqa_mocksession.h +++ b/src/groups/bmq/bmqa/bmqa_mocksession.h @@ -17,520 +17,528 @@ #ifndef INCLUDED_BMQA_MOCKSESSION #define INCLUDED_BMQA_MOCKSESSION -//@PURPOSE: Provide a mock session, implementing 'bmqa::AbstractSession'. -// -//@CLASSES: -// bmqa::MockSession: mechanism to mock a 'bmqa::Session' -// bmqa::MockSessionUtil: utility methods to create 'bmqa' events -// -//@DESCRIPTION: This component provides a mechanism implementing the -// 'bmqa::AbstractSession' protocol, for mocking a 'bmqa::Session' and can be -// used to write a test for an application that uses BMQ. The -// 'bmqa::MockSession' provides all the methods that 'Session' provides, with -// added methods to specify return codes and emitted events and expected calls. -// This can be used to test BlazingMQ application code without a connection to -// the broker. 'bmqa::MockSessionUtil' is a utility namespace providing useful -// methods to build 'bmqa::Event' objects that are typically only emitted from -// the broker. -// -// The following documentation elucidates the API that this component provides -// and some simple use cases to get you started. -// -// -/// Disclaimer -///---------- -// THIS COMPONENT SHOULD ONLY BE USED IN TEST DRIVERS. IT WILL NOT WORK WITH -// PRODUCTION CODE. -// -// -/// Usable Components -///----------------- -//: o !BMQA_EXPECT_CALL!: Macro to specify an expected call to a -//: 'bmqa::MockSession' object. This macro is used to -//: specify which is the next expected call on the -//: 'bmqa::MockSession'. If an incorrect call is invoked -//: or incorrect parameters are used, an assert will be -//: invoked. -// -//: o !returning! : Specify a return value for the expected call. This -//: is the value that will be returned when the method on -//: 'bmqa::MockSession' is invoked. -// -//: o !emitting! : Specify an event to be 'emitted' when the expected -//: call is invoked. The events specified are enqueued -//: to the internal event queue and are delivered to the -//: application when 'emitEvent' is invoked. -// -/// Static Helper Methods -///--------------------- -//: o !createAckEvent! : Create an acknowledgment message event for -//: messages posted to BMQ. -// -//: o !createPushEvent! : Create a push message event for messages to -//: be consumed from BMQ. -// -//: o !createOpenQueueStatus! : Create an openQueue result (relating to an -//: async open queue operation) -// -//: o !createConfigureQueueStatus!: Create a configureQueue result (relating to -//: an async configure queue operation) -// -//: o !createCloseQueueStatus! : Create a closeQueue result (relating to an -//: async close queue operation) -// -//: o !createSessionEvent! : Create a specified type of session event -//: except for events related to open, close -//: and configure queue. -// -// The static event builder specified above are typically built inside the -// broker but are now available to be built in the SDK. The expected use of -// such events is to build them and specify them to either the -// 'BMQA_EXPECT_CALL' macro in the 'emitting' parameter, or enqueued to the -// 'bmqa::MockSession' directly through the 'enqueueEvent' method. They can -// then be emitted by invoking the 'emitEvent' method, which in turn would be -// processed through the application-provided 'bmqa::SessionEventHandler'. -// -/// Additional Note -///--------------- -// 'MockSession' does not check if methods have been invoked in the correct -// order. The user is responsible for ensuring that the methods are invoked -// and events enqueued in the correct order. -// -// The following methods do not emit events: -//: o 'getQueueId' -//: o 'loadMessageEventBuilder' -//: o 'loadConfirmEventBuilder' -//: o 'loadMessageProperties' -//: o 'confirmMessage' -//: o 'confirmMessages' -// -// Calls to the following methods do not require an expect: -//: o 'getQueueId' -//: o 'loadMessageEventBuilder' -//: o 'loadConfirmEventBuilder' -//: o 'loadMessageProperties' -// -// -/// Creating a mock session in asynchronous mode -///-------------------------------------------- -// The 'MockSession' is created in asynchronous mode when a -// 'SessionEventHandler' is provided to it. If it is not provided a handler, -// the 'MockSession' is started in synchronous mode, requiring the application -// to call 'nextEvent' to access enqueued events. A sample handler could look -// like this: -// -//.. -// class MyEventHandler : public bmqa::SessionEventHandler { -// -// private: -// // DATA -// bsl::deque d_sessionEventsQueue; -// bsl::deque d_messageEventsQueue; -// bsl::deque d_openQueueResultsQueue; -// ... -// -// public: -// // MANIPULATORS -// virtual void onSessionEvent(const bmqa::SessionEvent& event) -// { -// bsl::cout << "Received session event " << event << "\n"; -// // some business logic, typically a switch case on -// // 'bmqt::SessionEventType' -// d_sessionEventsQueue.push_back(event); -// } -// -// virtual void onMessageEvent(const bmqa::MessageEvent& event) -// { -// bsl::cout << "Received message event " << event << "\n"; -// // some business logic, typically a switch case on -// // 'bmqt::MessageEventType' -// d_messageEventsQueue.push_back(event); -// } -// -// void onOpenQueueStatus(const bmqa::OpenQueueStatus& result) -// { -// bsl::cout << "Received open queue result: " << result << "\n"; -// // Some business logic -// d_openQueueResultsQueue.push_back(result); -// } -// ... -// -// bmqa::SessionEvent popSessionEvent() -// { -// BSLS_ASSERT(d_sessionEventsQueue.size() > 0); -// bmqa::SessionEvent ret(d_receivedSessionEvents.front()); -// d_receivedSessionEvents.pop_front(); -// return ret; -// } -// -// bmqa::MessageEvent popMessageEvent() -// { -// BSLS_ASSERT(d_messageEventsSize.size() > 0); -// bmqa::MessageEvent ret(d_receivedMessageEvents.front()); -// d_receivedMessageEvents.erase(d_receivedMessageEvents.begin()); -// return ret; -// } -// -// bmqa::OpenQueueStatus popOpenQueueStatus() -// { -// BSLS_ASSERT(d_openQueueResultsQueue.size() > 0); -// bmqa::OpenQueueStatus ret(d_openQueueResultsQueue.front()); -// d_openQueueResultsQueue.erase(d_openQueueResultsQueue.begin()); -// return ret; -// } -// ... -// }; -//.. -// -/// Usage -///----- -// This section illustrates intended use of this component. -// -/// Example 1 -///- - - - - -// The folowing example shows a simple producer in asynchronous mode, which -// will start the session, open a queue, post a message to the queue, generate -// an ack for that message and finally stop the session (skipping over close -// queue because it is analogous to opening a queue). In theory, you can use -// 'emitting' on the 'BMQA_EXPECT_CALL' macro and 'enqueueEvent' -// interchangeably, but in practice it is important to note that events from -// the broker are generated asynchronously, which means that they are not -// emitted as you call the method. You can control emission of events, -// however, by delaying the call to 'emitEvent'. -// -// NOTE: As with 'bmqa::Session', calling 'nextEvent' is meaningless in -// asynchronous mode. -// -//.. -// void unitTest() -// { -// // Create an event handler -// EventHandler eventHandler(d_allocator_p); -// -// // The following static initializer method calls all the appropriate -// // static initializers of the underlying components needed for the -// // 'MockSession'. The constructor of 'MockSession' will call it in -// // any case but if events need to be built outside the scope of the -// // creation of 'MockSession' you will need to explicitly invoke this -// // static initializer method. -// // bmqa::MockSession::initialize(s_allocator_p); -// -// bslma::ManagedPtr handlerMp; -// handlerMp.load(&eventHandler, 0, bslma::ManagedPtrUtil::noOpDeleter); -// -// bmqa::MockSession mockSession(handlerMp, -// bmqt::SessionOptions(d_allocator_p), -// d_allocator_p); -// -// bmqa::QueueId queueId(bmqt::CorrelationId(1), d_allocator_p); -// bmqt::CorrelationId corrId(1); -// -// // Expect a call to start and the call emits an 'e_CONNECTED' event. -// BMQA_EXPECT_CALL(mockSession, startAsync()) -// .returning(0) -// .emitting(bmqa::MockSessionUtil::createSessionEvent( -// bmqt::SessionEventType::e_CONNECTED, -// 0, // statusCode -// "", // errorDescription -// d_allocator_p)); -// -// // Make a call to startAsync and emit the event that is enqueued from -// // that call. -// ASSERT_EQ(mockSession.startAsync(), 0); -// -// // Emit our enqueued event. This fully sets up the session which is -// // now ready to use. Typically you would have some business logic on -// // 'e_CONNECTED' that makes your application ready to use. -// ASSERT_EQ(mockSession.emitEvent(), true); -// -// // Our event handler internally just stores the event emitted, so pop -// // it out and examine. -// bmqa::SessionEvent startEvent(eventHandler.popSessionEvent()); -// -// ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); -// ASSERT_EQ(startEvent.statusCode(), 0); -// -// // Create the uri to your queue as you would in your application. -// const bmqt::Uri uri("bmq://my.domain/queue"); -// -// // Initialize the queue flags for a producer with acks enabled -// bsls::Types::Uint64 flags = 0; -// bmqt::QueueFlagsUtil::setWriter(&flags); -// bmqt::QueueFlagsUtil::setAck(&flags); -// -// // We use the macro to expect a call to 'openQueueAsync', binding the -// // 'uri' and 'queueId' objects as well as the 'flags' that we created. -// bmqa::MockSession::OpenQueueCallback openQueueCallback = -// bdlf::BindUtil::bind(&EventHandler::onOpenQueueStatus, -// &eventHandler, -// bdlf::PlaceHolders::_1); // result -// -// BMQA_EXPECT_CALL(mockSession, -// openQueueAsync(uri1, -// flags, -// openQueueCallback)); -// BMQA_EXPECT_CALL(mockSession, -// openQueueAsync(uri, flags, openQueueCallback)); -// -// // Now that we have set our expectations we can try to open the queue. -// mockSession.openQueueAsync(uri1, flags, openQueueCallback); -// -// // Since the application may not have direct access to the queue, we -// // need to get the 'queueId' from the session. We can then bind this -// // retrieved 'queueId' to the 'e_QUEUE_OPEN_RESULT' session event and -// // enqueue it to the 'MockSession'. -// // Note: You can only get the 'queueId' after 'openQueue' or -// // 'openQueueAsync' has been invoked on the session. -// bmqa::QueueId queueId1(corrId1); -// bmqa::OpenQueueStatus openQueueResult = -// bmqa::MockSessionUtil::createOpenQueueStatus( -// queueId1, -// bmqt::OpenQueueResult::e_TIMEOUT, // statusCode -// "Local Timeout", // errorDescription -// d_allocator_p); -// mockSession.enqueueEvent(openQueueResult); -// -// // We just enqueued a 'bmqa::OpenQueueStatus' to be emitted. We can -// // emit it using 'emitEvent'. -// ASSERT_EQ(mockSession.emitEvent(), true); -// -// // Pop out this event from the handler and examine it. -// bmqa::OpenQueueStatus result = eventHandler.popOpenQueueStatus(); -// ASSERT_EQ(result, openQueueResult); -// -// // On emission of 'bmqa::OpenQueueStatus', the queue is fully open and -// // we can now post to it. -// bmqa::MessageEventBuilder builder; -// mockSession.loadMessageEventBuilder(&builder); -// -// BMQA_EXPECT_CALL(mockSession, post(builder.messageEvent())) -// .returning(0); -// -// // Use the builder to build a mesage event and pack it for the queue -// // that has been opened. If you try to pack the message for an -// // invalid or closed queue, packing the message will fail. This has -// // been elided for brevity. -// -// // Now that the event has been built we can 'post' it to BMQ. -// ASSERT_EQ(mockSession.post(builder.messageEvent()), 0); -// -// // Simply creating a blob buffer factory on the stack to be used by -// // 'createAckEvent'. Typically you would have one for the component. -// bdlbb::PooledBlobBufferFactory bufferFactory(4 * 1024, d_allocator_p); -// -// // The method 'createAckEvent' takes a vector of 'AckParams' to -// // specify multiple acks per event, but here we are only acknowledging -// // 1 message. Specify a positive ack with 'e_SUCCESS' here but you -// // can specify any from 'bmqt::AckResult::Enum'. -// bsl::vector acks(d_allocator_p); -// acks.emplace_back(bmqt::AckResult::e_SUCCESS, -// bmqt::CorrelationId(1), -// bmqt::MessageGUID(), // Real GUID needed if you want -// // to record ack messages. -// bmqa::QueueId(1)); -// -// // Enqueuing ack event to be emitted. We use the helper function -// // 'createAckEvent' to generate this event. -// mockSession.enqueueEvent(bmqa::MockSessionUtil::createAckEvent( -// acks, -// &bufferFactory, -// d_allocator_p)); -// -// // Emit the enqueued ack event. -// ASSERT_EQ(mockSession.emitEvent(), true); -// -// // As we did earlier, pop it out and examine. -// bmqa::MessageEvent ackEvent(eventHandler.popMessageEvent()); -// ASSERT_EQ(ackEvent.type(), bmqt::MessageEventType::e_ACK); -// bmqa::MessageIterator mIter = ackEvent.messageIterator(); -// mIter.nextMessage(); -// ASSERT_EQ(mIter.message().ackStatus(), bmqt::AckResult::e_SUCCESS); -// -// // This is a simple test. After posting our message and receiving the -// // ack, we are now shutting down our application. Therefore we expect -// // a 'stopAsync' call. -// BMQA_EXPECT_CALL(mockSession, stopAsync()); -// -// // Now make a call to 'stopAsync' to stop our session. -// mockSession.stopAsync(); -// -// // Here we are enqueuing an 'e_DISCONNECTED' event as you would -// // receive from the broker on a successful shutdown. -// mockSession.enqueueEvent(bmqa::MockSessionUtil::createSessionEvent( -// bmqt::SessionEventType::e_DISCONNECTED, -// 0, // statusCode -// "", // errorDescription -// d_allocator_p)); -// ASSERT_EQ(mockSession.emitEvent(), true); -// -// // Our event handler internally just stores the event emitted, so pop -// // it out and examine. -// bmqa::SessionEvent stopEvent(eventHandler.popSessionEvent()); -// ASSERT_EQ(stopEvent.type(), bmqt::SessionEventType::e_DISCONNECTED); -// ASSERT_EQ(stopEvent.statusCode(), 0); -// -// // The corresponding pendant operation of the 'initialize' which would -// // need to be called only if 'initialize' was explicitly called. -// // bmqa::MockSession::shutdown(); -// } -//.. -// -/// Example 2 -///- - - - - -// The folowing example shows a consumer in synchronous mode, which will start -// the session, generate a push message (simulating the broker), confirm the -// message and then stop the session. Additionally, this test case also sets -// all expectations up front before running the code, as this is the alternate -// way of writing your test driver. -// -// NOTE: Using 'enqueue' or 'emitEvent' on 'bmqa::MockSession' or 'emitting' on -// the 'BMQA_EXPECT_CALL' macro in synchronous mode is meaningless. -// -//.. -// void unitTest() -// { -// // MockSession created without an eventHandler. -// bmqa::MockSession mockSession(bmqt::SessionOptions(d_allocator_p), -// d_allocator_p); -// -// // The following static initializer method calls all the appropriate -// // static initializers of the underlying components needed for the -// // 'MockSession'. The constructor of 'MockSession' will call it in -// // any case but if events need to be built outside the scope of the -// // creation of 'MockSession' you will need to explicitly invoke this -// // static initializer method. -// // bmqa::MockSession::initialize(s_allocator_p); -// -// // Create simple queueIds and corrIds -// bmqa::QueueId queueId(1); -// bmqt::CorrelationId corrId(1); -// -// // Create the uri to your queue as you would in your application. -// bmqt::Uri uri("bmq://my.domain/queue"); -// -// // Expecting that 'startAsync' will be called on the MockSession. -// BMQA_EXPECT_CALL(mockSession, startAsync()) -// .returning(0); -// -// // Simply creating a blob buffer factory on the stack to be used by -// // 'createAckEvent'. Typically you would have one for the component. -// bdlbb::PooledBlobBufferFactory bufferFactory(4 * 1024, d_allocator_p); -// -// // We then expect that 'nextEvent' will be called to return the -// // 'e_CONNECTED' event from the broker -// BMQA_EXPECT_CALL(mockSession, nextEvent(bsls::TimeInterval())) -// .returning(bmqa::MockSessionUtil::createSessionEvent( -// bmqt::SessionEventType::e_CONNECTED, -// bmqt::CorrelationId::autoValue(), -// 0, // errorCode -// "", // errorDescription -// d_allocator_p)); -// // Note that we use an 'autoValue' for correlationId because it's -// // irrelevant for a 'CONNECTED' event. -// -// // Initialize the queue flags for a consumer -// bsls::Types::Uint64 flags = 0; -// bmqt::QueueFlagsUtil::setReader(&flags); -// -// // We use the macro to expect a call to 'openQueueSync', binding the -// // 'uri' and 'queueId' objects as well as the flags that we created. -// // Note that the 'queueId' object will be modified as 'openQueueSync' -// // takes it as an output parameter. -// bmqa::OpenQueueStatus expectedResult = -// bmqa::MockSessionUtil::createOpenQueueStatus( -// queueId, -// bmqt::OpenQueueResult::e_SUCCESS, // statusCode -// "", // errorDescription -// d_allocator_p); -// BMQA_EXPECT_CALL(mockSession, openQueueSync(&queueId, uri, flags)) -// .returning(expectedResult); -// -// // Build our incoming message event. -// bsl::vector pushMsgs( -// d_allocator_p); -// bdlbb::Blob payload(&bufferFactory, d_allocator_p); -// bdlbb::BlobUtil::append(&payload, "hello", 6); -// -// const char guidHex[] = "00000000000000000000000000000001"; -// bmqt::MessageGUID guid; -// guid.fromHex(guidHex); -// -// bmqa::MessageProperties properties; -// mockSession.loadMessageProperties(&properties); -// -// // For each message that we are supposed to receive from the broker, -// // we need to specify the payload, the queueId, a guid (the hex is -// // random but unique within your test driver) and properties which -// // could be empty. -// pushMsgs.emplace_back(payload, queueId, guid, properties); -// bmqa::Event pushMsgEvent = bmqa::MockSessionUtil::createPushEvent( -// pushMsgs, -// &bufferFactory, -// d_allocator_p); -// BMQA_EXPECT_CALL(mockSession, nextEvent(bsls::TimeInterval())) -// .returning(pushMsgEvent); -// -// // Next we expect a call to 'confirmMessages', to confirm the 1 message -// // that we received from the broker. -// bmqa::ConfirmEventBuilder confirmBuilder; -// mockSession.loadConfirmEventBuilder(&confirmBuilder); -// BMQA_EXPECT_CALL(mockSession, confirmMessages(&confirmBuilder)) -// .returning(0); -// -// // Expectations have been set up. Now we run the code. -// // 'startAsync' is the first call. We expect it to return 0 and we -// // expect 'nextEvent' to return the 'e_CONNECTED' session event. -// int rc = mockSession.startAsync(); -// ASSERT_EQ(rc, 0); -// bmqa::SessionEvent startEvent = mockSession.nextEvent( -// bsls::TimeInterval()) -// .sessionEvent(); -// ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); -// ASSERT_EQ(startEvent.statusCode(), 0); -// ASSERT_EQ(startEvent.errorDescription(), ""); -// -// // Next we expect a call to 'openQueue' to open the queue. -// bmqa::OpenQueueStatus result = mockSession.openQueueSync(&queueId, -// uri, -// flags); -// ASSERT_EQ(result, expectedResult); -// -// // Now our call to 'nextEvent' will generate a push message from the -// // broker, which we will then go on to confirm. -// bmqa::MessageEvent pushMsgEvt(mockSession.nextEvent( -// bsls::TimeInterval()) -// .messageEvent()); -// ASSERT_EQ(pushMsgEvt.type(), bmqt::MessageEventType::e_PUSH); -// -// // Now that we have received a push message which has yet to be -// // confirmed, we can confirm that 1 unconfirmed message exists. -// ASSERT_EQ(mockSession.unconfirmedMessages(), 1U); -// -// // Since there is only 1 message in our message event, we dont have to -// // iterate over the event but in reality you will want to iterate over -// // each message and add it to the confirm builder. -// bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); -// mIter.nextMessage(); -// confirmBuilder.addMessageConfirmation(mIter.message()); -// ASSERT_EQ(confirmBuilder.messageCount(), 1); -// -// // Confirm the messages using the builder that has been populated. -// rc = mockSession.confirmMessages(&confirmBuilder); -// ASSERT_EQ(rc, 0); -// -// // Voila! We now have no unconfirmed messages. -// ASSERT_EQ(mockSession.unconfirmedMessages(), 0u); -// // 'stop' has been elided for brevity and is analogous to 'start' -// -// // The corresponding pendant operation of the 'initialize' which would -// // need to be called only if 'initialize' was explicitly called. -// // bmqa::MockSession::shutdown(); -// } -//.. -// -/// Thread Safety -///------------- -// THREAD SAFE. +/// @file bmqa_mocksession.h +/// +/// @brief Provide a mock session, implementing @bbref{bmqa::AbstractSession}. +/// +/// This component provides a mechanism implementing the +/// @bbref{bmqa::AbstractSession} protocol, for mocking a @bbref{bmqa::Session} +/// and can be used to write a test for an application that uses BMQ. The +/// @bbref{bmqa::MockSession} provides all the methods that +/// @bbref{bmqa::Session} provides, with added methods to specify return codes +/// and emitted events and expected calls. This can be used to test BlazingMQ +/// application code without a connection to the broker. +/// @bbref{bmqa::MockSessionUtil} is a utility namespace providing useful +/// methods to build @bbref{bmqa::Event} objects that are typically only +/// emitted from the broker. +/// +/// The following documentation elucidates the API that this component provides +/// and some simple use cases to get you started. +/// +/// +/// Disclaimer {#bmqa_mocksession_disclaimer} +/// ========== +/// +/// @warning THIS COMPONENT SHOULD ONLY BE USED IN TEST DRIVERS. IT WILL NOT +/// WORK WITH PRODUCTION CODE. +/// +/// Usable Components {#bmqa_mocksession_usable} +/// ================= +/// +/// - **BMQA_EXPECT_CALL**: Macro to specify an expected call to a +/// @bbref{bmqa::MockSession} object. This macro is used to specify which +/// is the next expected call on the @bbref{bmqa::MockSession}. If an +/// incorrect call is invoked or incorrect parameters are used, an assert +/// will be invoked. +/// +/// - **returning**: Specify a return value for the expected call. This is +/// the value that will be returned when the method on +/// @bbref{bmqa::MockSession} is invoked. +/// +/// - **emitting**: Specify an event to be `emitted` when the expected call +/// is invoked. The events specified are enqueued to the internal event +/// queue and are delivered to the application when `emitEvent` is invoked. +/// +/// Static Helper Methods {#bmqa_mocksession_helper} +/// ===================== +/// +/// - **createAckEvent**: Create an acknowledgment message event for messages +/// posted to BMQ. +/// +/// - **createPushEvent**: Create a push message event for messages to be +/// consumed from BMQ. +/// +/// - **createOpenQueueStatus**: Create an openQueue result (relating to an +/// async open queue operation) +/// +/// - **createConfigureQueueStatus**: Create a configureQueue result +/// (relating to an async configure queue operation) +/// +/// - **createCloseQueueStatus**: Create a closeQueue result (relating to an +/// async close queue operation) +/// +/// - **createSessionEvent**: Create a specified type of session event except +/// for events related to open, close and configure queue. +/// +/// The static event builder specified above are typically built inside the +/// broker but are now available to be built in the SDK. The expected use of +/// such events is to build them and specify them to either the @ref +/// BMQA_EXPECT_CALL macro in the `emitting` parameter, or enqueued to the +/// @bbref{bmqa::MockSession} directly through the `enqueueEvent` method. They +/// can then be emitted by invoking the `emitEvent` method, which in turn would +/// be processed through the application-provided +/// @bbref{bmqa::SessionEventHandler}. +/// +/// Additional Note {#bmqa_mocksession_additional} +/// =============== +/// +/// @bbref{bmqa::MockSession} does not check if methods have been invoked +/// in the correct order. The user is responsible for ensuring that the +/// methods are invoked and events enqueued in the correct order. +/// +/// The following methods do not emit events: +/// +/// - `getQueueId` +/// - `loadMessageEventBuilder` +/// - `loadConfirmEventBuilder` +/// - `loadMessageProperties` +/// - `confirmMessage` +/// - `confirmMessages` +/// +/// Calls to the following methods do not require an expect: +/// +/// - `getQueueId` +/// - `loadMessageEventBuilder` +/// - `loadConfirmEventBuilder` +/// - `loadMessageProperties` +/// +/// +/// Creating a mock session in asynchronous mode {#bmqa_mocksession_creating} +/// ============================================ +/// +/// The @bbref{bmqa::MockSession} is created in asynchronous mode when a +/// @bbref{bmqa::SessionEventHandler} is provided to it. If it is not provided +/// a handler, the @bbref{bmqa::MockSession} is started in synchronous mode, +/// requiring the application to call `nextEvent` to access enqueued events. A +/// sample handler could look like this: +/// +/// ``` +/// class MyEventHandler : public bmqa::SessionEventHandler { +/// +/// private: +/// // DATA +/// bsl::deque d_sessionEventsQueue; +/// bsl::deque d_messageEventsQueue; +/// bsl::deque d_openQueueResultsQueue; +/// ... +/// +/// public: +/// // MANIPULATORS +/// virtual void onSessionEvent(const bmqa::SessionEvent& event) +/// { +/// bsl::cout << "Received session event " << event << "\n"; +/// // some business logic, typically a switch case on +/// // 'bmqt::SessionEventType' +/// d_sessionEventsQueue.push_back(event); +/// } +/// +/// virtual void onMessageEvent(const bmqa::MessageEvent& event) +/// { +/// bsl::cout << "Received message event " << event << "\n"; +/// // some business logic, typically a switch case on +/// // 'bmqt::MessageEventType' +/// d_messageEventsQueue.push_back(event); +/// } +/// +/// void onOpenQueueStatus(const bmqa::OpenQueueStatus& result) +/// { +/// bsl::cout << "Received open queue result: " << result << "\n"; +/// // Some business logic +/// d_openQueueResultsQueue.push_back(result); +/// } +/// ... +/// +/// bmqa::SessionEvent popSessionEvent() +/// { +/// BSLS_ASSERT(d_sessionEventsQueue.size() > 0); +/// bmqa::SessionEvent ret(d_receivedSessionEvents.front()); +/// d_receivedSessionEvents.pop_front(); +/// return ret; +/// } +/// +/// bmqa::MessageEvent popMessageEvent() +/// { +/// BSLS_ASSERT(d_messageEventsSize.size() > 0); +/// bmqa::MessageEvent ret(d_receivedMessageEvents.front()); +/// d_receivedMessageEvents.erase(d_receivedMessageEvents.begin()); +/// return ret; +/// } +/// +/// bmqa::OpenQueueStatus popOpenQueueStatus() +/// { +/// BSLS_ASSERT(d_openQueueResultsQueue.size() > 0); +/// bmqa::OpenQueueStatus ret(d_openQueueResultsQueue.front()); +/// d_openQueueResultsQueue.erase(d_openQueueResultsQueue.begin()); +/// return ret; +/// } +/// ... +/// }; +/// ``` +/// +/// Usage {#bmqa_mocksession_usage} +/// ===== +/// +/// This section illustrates intended use of this component. +/// +/// Example 1 {#bmqa_mocksession_ex1} +/// --------- +/// +/// The folowing example shows a simple producer in asynchronous mode, which +/// will start the session, open a queue, post a message to the queue, generate +/// an ack for that message and finally stop the session (skipping over close +/// queue because it is analogous to opening a queue). In theory, you can use +/// `emitting` on the @ref BMQA_EXPECT_CALL macro and `enqueueEvent` +/// interchangeably, but in practice it is important to note that events from +/// the broker are generated asynchronously, which means that they are not +/// emitted as you call the method. You can control emission of events, +/// however, by delaying the call to `emitEvent`. +/// +/// @note As with @bbref{bmqa::Session}, calling `nextEvent` is meaningless in +/// asynchronous mode. +/// +/// ``` +/// void unitTest() +/// { +/// // Create an event handler +/// EventHandler eventHandler(d_allocator_p); +/// +/// // The following static initializer method calls all the appropriate +/// // static initializers of the underlying components needed for the +/// // 'MockSession'. The constructor of 'MockSession' will call it in +/// // any case but if events need to be built outside the scope of the +/// // creation of 'MockSession' you will need to explicitly invoke this +/// // static initializer method. +/// // bmqa::MockSession::initialize(s_allocator_p); +/// +/// bslma::ManagedPtr handlerMp; +/// handlerMp.load(&eventHandler, 0, bslma::ManagedPtrUtil::noOpDeleter); +/// +/// bmqa::MockSession mockSession(handlerMp, +/// bmqt::SessionOptions(d_allocator_p), +/// d_allocator_p); +/// +/// bmqa::QueueId queueId(bmqt::CorrelationId(1), d_allocator_p); +/// bmqt::CorrelationId corrId(1); +/// +/// // Expect a call to start and the call emits an 'e_CONNECTED' event. +/// BMQA_EXPECT_CALL(mockSession, startAsync()) +/// .returning(0) +/// .emitting(bmqa::MockSessionUtil::createSessionEvent( +/// bmqt::SessionEventType::e_CONNECTED, +/// 0, // statusCode +/// "", // errorDescription +/// d_allocator_p)); +/// +/// // Make a call to startAsync and emit the event that is enqueued from +/// // that call. +/// ASSERT_EQ(mockSession.startAsync(), 0); +/// +/// // Emit our enqueued event. This fully sets up the session which is +/// // now ready to use. Typically you would have some business logic on +/// // 'e_CONNECTED' that makes your application ready to use. +/// ASSERT_EQ(mockSession.emitEvent(), true); +/// +/// // Our event handler internally just stores the event emitted, so pop +/// // it out and examine. +/// bmqa::SessionEvent startEvent(eventHandler.popSessionEvent()); +/// +/// ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); +/// ASSERT_EQ(startEvent.status Code(), 0); +/// +/// // Create the uri to your queue as you would in your application. +/// const bmqt::Uri uri("bmq://my.domain/queue"); +/// +/// // Initialize the queue flags for a producer with acks enabled +/// bsls::Types::Uint64 flags = 0; +/// bmqt::QueueFlagsUtil::setWriter(&flags); +/// bmqt::QueueFlagsUtil::setAck(&flags); +/// +/// // We use the macro to expect a call to 'openQueueAsync', binding the +/// // 'uri' and 'queueId' objects as well as the 'flags' that we created. +/// bmqa::MockSession::OpenQueueCallback openQueueCallback = +/// bdlf::BindUtil::bind(&EventHandler::onOpenQueueStatus, +/// &eventHandler, +/// bdlf::PlaceHolders::_1); // result +/// +/// BMQA_EXPECT_CALL(mockSession, +/// openQueueAsync(uri1, +/// flags, +/// openQueueCallback)); +/// BMQA_EXPECT_CALL(mockSession, +/// openQueueAsync(uri, flags, openQueueCallback)); +/// +/// // Now that we have set our expectations we can try to open the queue. +/// mockSession.openQueueAsync(uri1, flags, openQueueCallback); +/// +/// // Since the application may not have direct access to the queue, we +/// // need to get the 'queueId' from the session. We can then bind this +/// // retrieved 'queueId' to the 'e_QUEUE_OPEN_RESULT' session event and +/// // enqueue it to the 'MockSession'. +/// // Note: You can only get the 'queueId' after 'openQueue' or +/// // 'openQueueAsync' has been invoked on the session. +/// bmqa::QueueId queueId1(corrId1); +/// bmqa::OpenQueueStatus openQueueResult = +/// bmqa::MockSessionUtil::createOpenQueueStatus( +/// queueId1, +/// bmqt::OpenQueueResult::e_TIMEOUT, // statusCode +/// "Local Timeout", // errorDescription +/// d_allocator_p); +/// mockSession.enqueueEvent(openQueueResult); +/// +/// // We just enqueued a 'bmqa::OpenQueueStatus' to be emitted. We can +/// // emit it using 'emitEvent'. +/// ASSERT_EQ(mockSession.emitEvent(), true); +/// +/// // Pop out this event from the handler and examine it. +/// bmqa::OpenQueueStatus result = eventHandler.popOpenQueueStatus(); +/// ASSERT_EQ(result, openQueueResult); +/// +/// // On emission of 'bmqa::OpenQueueStatus', the queue is fully open and +/// // we can now post to it. +/// bmqa::MessageEventBuilder builder; +/// mockSession.loadMessageEventBuilder(&builder); +/// +/// BMQA_EXPECT_CALL(mockSession, post(builder.messageEvent())) +/// .returning(0); +/// +/// // Use the builder to build a mesage event and pack it for the queue +/// // that has been opened. If you try to pack the message for an +/// // invalid or closed queue, packing the message will fail. This has +/// // been elided for brevity. +/// +/// // Now that the event has been built we can 'post' it to BMQ. +/// ASSERT_EQ(mockSession.post(builder.messageEvent()), 0); +/// +/// // Simply creating a blob buffer factory on the stack to be used by +/// // 'createAckEvent'. Typically you would have one for the component. +/// bdlbb::PooledBlobBufferFactory bufferFactory(4 * 1024, d_allocator_p); +/// +/// // The method 'createAckEvent' takes a vector of 'AckParams' to +/// // specify multiple acks per event, but here we are only acknowledging +/// // 1 message. Specify a positive ack with 'e_SUCCESS' here but you +/// // can specify any from 'bmqt::AckResult::Enum'. +/// bsl::vector acks(d_allocator_p); +/// acks.emplace_back(bmqt::AckResult::e_SUCCESS, +/// bmqt::CorrelationId(1), +/// bmqt::MessageGUID(), // Real GUID needed if you want +/// // to record ack messages. +/// bmqa::QueueId(1)); +/// +/// // Enqueuing ack event to be emitted. We use the helper function +/// // 'createAckEvent' to generate this event. +/// mockSession.enqueueEvent(bmqa::MockSessionUtil::createAckEvent( +/// acks, +/// &bufferFactory, +/// d_allocator_p)); +/// +/// // Emit the enqueued ack event. +/// ASSERT_EQ(mockSession.emitEvent(), true); +/// +/// // As we did earlier, pop it out and examine. +/// bmqa::MessageEvent ackEvent(eventHandler.popMessageEvent()); +/// ASSERT_EQ(ackEvent.type(), bmqt::MessageEventType::e_ACK); +/// bmqa::MessageIterator mIter = ackEvent.messageIterator(); +/// mIter.nextMessage(); +/// ASSERT_EQ(mIter.message().ackStatus(), bmqt::AckResult::e_SUCCESS); +/// +/// // This is a simple test. After posting our message and receiving the +/// // ack, we are now shutting down our application. Therefore we expect +/// // a 'stopAsync' call. +/// BMQA_EXPECT_CALL(mockSession, stopAsync()); +/// +/// // Now make a call to 'stopAsync' to stop our session. +/// mockSession.stopAsync(); +/// +/// // Here we are enqueuing an 'e_DISCONNECTED' event as you would +/// // receive from the broker on a successful shutdown. +/// mockSession.enqueueEvent(bmqa::MockSessionUtil::createSessionEvent( +/// bmqt::SessionEventType::e_DISCONNECTED, +/// 0, // statusCode +/// "", // errorDescription +/// d_allocator_p)); +/// ASSERT_EQ(mockSession.emitEvent(), true); +/// +/// // Our event handler internally just stores the event emitted, so pop +/// // it out and examine. +/// bmqa::SessionEvent stopEvent(eventHandler.popSessionEvent()); +/// ASSERT_EQ(stopEvent.type(), bmqt::SessionEventType::e_DISCONNECTED); +/// ASSERT_EQ(stopEvent.statusCode(), 0); +/// +/// // The corresponding pendant operation of the 'initialize' which would +/// // need to be called only if 'initialize' was explicitly called. +/// // bmqa::MockSession::shutdown(); +/// } +/// ``` +/// +/// Example 2 {#bmqa_mocksession_ex2} +/// --------- +/// +/// The folowing example shows a consumer in synchronous mode, which will start +/// the session, generate a push message (simulating the broker), confirm the +/// message and then stop the session. Additionally, this test case also sets +/// all expectations up front before running the code, as this is the alternate +/// way of writing your test driver. +/// +/// @note Using `enqueue` or `emitEvent` on @bbref{bmqa::MockSession} or +/// `emitting` on the @ref BMQA_EXPECT_CALL macro in synchronous mode is +/// meaningless. +/// +///``` +/// void unitTest() +/// { +/// // MockSession created without an eventHandler. +/// bmqa::MockSession mockSession(bmqt::SessionOptions(d_allocator_p), +/// d_allocator_p); +/// +/// // The following static initializer method calls all the appropriate +/// // static initializers of the underlying components needed for the +/// // 'MockSession'. The constructor of 'MockSession' will call it in +/// // any case but if events need to be built outside the scope of the +/// // creation of 'MockSession' you will need to explicitly invoke this +/// // static initializer method. +/// // bmqa::MockSession::initialize(s_allocator_p); +/// +/// // Create simple queueIds and corrIds +/// bmqa::QueueId queueId(1); +/// bmqt::CorrelationId corrId(1); +/// +/// // Create the uri to your queue as you would in your application. +/// bmqt::Uri uri("bmq://my.domain/queue"); +/// +/// // Expecting that 'startAsync' will be called on the MockSession. +/// BMQA_EXPECT_CALL(mockSession, startAsync()) +/// .returning(0); +/// +/// // Simply creating a blob buffer factory on the stack to be used by +/// // 'createAckEvent'. Typically you would have one for the component. +/// bdlbb::PooledBlobBufferFactory bufferFactory(4 * 1024, d_allocator_p); +/// +/// // We then expect that 'nextEvent' will be called to return the +/// // 'e_CONNECTED' event from the broker +/// BMQA_EXPECT_CALL(mockSession, nextEvent(bsls::TimeInterval())) +/// .returning(bmqa::MockSessionUtil::createSessionEvent( +/// bmqt::SessionEventType::e_CONNECTED, +/// bmqt::CorrelationId::autoValue(), +/// 0, // errorCode +/// "", // errorDescription +/// d_allocator_p)); +/// // Note that we use an 'autoValue' for correlationId because it's +/// // irrelevant for a 'CONNECTED' event. +/// +/// // Initialize the queue flags for a consumer +/// bsls::Types::Uint64 flags = 0; +/// bmqt::QueueFlagsUtil::setReader(&flags); +/// +/// // We use the macro to expect a call to 'openQueueSync', binding the +/// // 'uri' and 'queueId' objects as well as the flags that we created. +/// // Note that the 'queueId' object will be modified as 'openQueueSync' +/// // takes it as an output parameter. +/// bmqa::OpenQueueStatus expectedResult = +/// bmqa::MockSessionUtil::createOpenQueueStatus( +/// queueId, +/// bmqt::OpenQueueResult::e_SUCCESS, // statusCode +/// "", // errorDescription +/// d_allocator_p); +/// BMQA_EXPECT_CALL(mockSession, openQueueSync(&queueId, uri, flags)) +/// .returning(expectedResult); +/// +/// // Build our incoming message event. +/// bsl::vector pushMsgs( +/// d_allocator_p); +/// bdlbb::Blob payload(&bufferFactory, d_allocator_p); +/// bdlbb::BlobUtil::append(&payload, "hello", 6); +/// +/// const char guidHex[] = "00000000000000000000000000000001"; +/// bmqt::MessageGUID guid; +/// guid.fromHex(guidHex); +/// +/// bmqa::MessageProperties properties; +/// mockSession.loadMessageProperties(&properties); +/// +/// // For each message that we are supposed to receive from the broker, +/// // we need to specify the payload, the queueId, a guid (the hex is +/// // random but unique within your test driver) and properties which +/// // could be empty. +/// pushMsgs.emplace_back(payload, queueId, guid, properties); +/// bmqa::Event pushMsgEvent = bmqa::MockSessionUtil::createPushEvent( +/// pushMsgs, +/// &bufferFactory, +/// d_allocator_p); +/// BMQA_EXPECT_CALL(mockSession, nextEvent(bsls::TimeInterval())) +/// .returning(pushMsgEvent); +/// +/// // Next we expect a call to 'confirmMessages', to confirm the 1 message +/// // that we received from the broker. +/// bmqa::ConfirmEventBuilder confirmBuilder; +/// mockSession.loadConfirmEventBuilder(&confirmBuilder); +/// BMQA_EXPECT_CALL(mockSession, confirmMessages(&confirmBuilder)) +/// .returning(0); +/// +/// // Expectations have been set up. Now we run the code. +/// // 'startAsync' is the first call. We expect it to return 0 and we +/// // expect 'nextEvent' to return the 'e_CONNECTED' session event. +/// int rc = mockSession.startAsync(); +/// ASSERT_EQ(rc, 0); +/// bmqa::SessionEvent startEvent = mockSession.nextEvent( +/// bsls::TimeInterval()) +/// .sessionEvent(); +/// ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); +/// ASSERT_EQ(startEvent.statusCode(), 0); +/// ASSERT_EQ(startEvent.errorDescription(), ""); +/// +/// // Next we expect a call to 'openQueue' to open the queue. +/// bmqa::OpenQueueStatus result = mockSession.openQueueSync(&queueId, +/// uri, +/// flags); +/// ASSERT_EQ(result, expectedResult); +/// +/// // Now our call to 'nextEvent' will generate a push message from the +/// // broker, which we will then go on to confirm. +/// bmqa::MessageEvent pushMsgEvt(mockSession.nextEvent( +/// bsls::TimeInterval()) +/// .messageEvent()); +/// ASSERT_EQ(pushMsgEvt.type(), bmqt::MessageEventType::e_PUSH); +/// +/// // Now that we have received a push message which has yet to be +/// // confirmed, we can confirm that 1 unconfirmed message exists. +/// ASSERT_EQ(mockSession.unconfirmedMessages(), 1U); +/// +/// // Since there is only 1 message in our message event, we dont have to +/// // iterate over the event but in reality you will want to iterate over +/// // each message and add it to the confirm builder. +/// bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); +/// mIter.nextMessage(); +/// confirmBuilder.addMessageConfirmation(mIter.message()); +/// ASSERT_EQ(confirmBuilder.messageCount(), 1); +/// +/// // Confirm the messages using the builder that has been populated. +/// rc = mockSession.confirmMessages(&confirmBuilder); +/// ASSERT_EQ(rc, 0); +/// +/// // Voila! We now have no unconfirmed messages. +/// ASSERT_EQ(mockSession.unconfirmedMessages(), 0u); +/// // 'stop' has been elided for brevity and is analogous to 'start' +/// +/// // The corresponding pendant operation of the 'initialize' which would +/// // need to be called only if 'initialize' was explicitly called. +/// // bmqa::MockSession::shutdown(); +/// } +/// ``` +/// +/// Thread Safety {#bmqa_mocksession_thread} +/// ------------- +/// +/// THREAD SAFE. // BMQ #include diff --git a/src/groups/bmq/bmqa/bmqa_openqueuestatus.h b/src/groups/bmq/bmqa/bmqa_openqueuestatus.h index 58bc69aefe..70c8eeba5e 100644 --- a/src/groups/bmq/bmqa/bmqa_openqueuestatus.h +++ b/src/groups/bmq/bmqa/bmqa_openqueuestatus.h @@ -17,22 +17,24 @@ #ifndef INCLUDED_BMQA_OPENQUEUESTATUS #define INCLUDED_BMQA_OPENQUEUESTATUS -//@PURPOSE: Provide Value-Semantic Type for an open queue operation status -// -//@CLASSES: -// bmqa::OpenQueueStatus: value-semantic type for an openQueue result -// -//@DESCRIPTION: This component provides a specific value-semantic type for the -// result of an open queue operation with the BlazingMQ broker, providing -// applications with the result and context of the requested operation. -// -// A 'bmqa::OpenQueueStatus' type is composed of 3 attributes: -//: o !result!: indicates the status of the operation (success, -//: failure, etc.) as specified in the corresponding -//: result code enum, 'bmqt::OpenQueueResult::Enum' -//: o !queueId!: queueId associated with the open queue operation -//: o !errorDescription!: optional string with a human readable description of -//: the error, if any +/// @file bmqa_openqueuestatus.h +/// +/// @brief Provide Value-Semantic Type for an open queue operation status +/// +/// This component provides a specific value-semantic type for the result of an +/// open queue operation with the BlazingMQ broker, providing applications with +/// the result and context of the requested operation. +/// +/// A @bbref{bmqa::OpenQueueStatus} type is composed of 3 attributes: +/// +/// 1. **result**: indicates the status of the operation (success, failure, +/// etc.) as specified in the corresponding result code enum, +/// @bbref{bmqt::OpenQueueResult::Enum}. +/// +/// 2. **queueId**: queueId associated with the open queue operation +/// +/// 3. **errorDescription**: optional string with a human readable +/// description of the error, if any // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_queueid.h b/src/groups/bmq/bmqa/bmqa_queueid.h index b1b986dc5e..328682a482 100644 --- a/src/groups/bmq/bmqa/bmqa_queueid.h +++ b/src/groups/bmq/bmqa/bmqa_queueid.h @@ -17,16 +17,15 @@ #ifndef INCLUDED_BMQA_QUEUEID #define INCLUDED_BMQA_QUEUEID -//@PURPOSE: Provide a value-semantic efficient identifier for a queue. -// -//@CLASSES: -// bmqa::QueueId: Value-semantic efficient identifier for a queue. -// -//@DESCRIPTION: This component implements a value-semantic class, -// 'bmqa::QueueId', which can be used to efficiently identify the queue -// associated with a message event. A 'bmqa::QueueId' instance can be created -// with a 64-bit integer, raw pointer, shared pointer, or -// 'bmqt::CorrelationId'. +/// @file bmqa_queueid.h +/// +/// @brief Provide a value-semantic efficient identifier for a queue. +/// +/// This component implements a value-semantic class, @bbref{bmqa::QueueId}, +/// which can be used to efficiently identify the queue associated with a +/// message event. A @bbref{bmqa::QueueId} instance can be created with a +/// 64-bit integer, raw pointer, shared pointer, or +/// @bbref{bmqt::CorrelationId}. // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_session.h b/src/groups/bmq/bmqa/bmqa_session.h index 77a555e76a..745f5f002e 100644 --- a/src/groups/bmq/bmqa/bmqa_session.h +++ b/src/groups/bmq/bmqa/bmqa_session.h @@ -17,490 +17,539 @@ #ifndef INCLUDED_BMQA_SESSION #define INCLUDED_BMQA_SESSION -//@PURPOSE: Provide access to the BlazingMQ broker. -// -//@CLASSES: -// bmqa::SessionEventHandler: interface for receiving events asynchronously. -// bmqa::Session : mechanism for access to the BlazingMQ broker. -// -//@DESCRIPTION: This component provides a mechanism, 'bmqa::Session', that -// provides access to a message queue broker and an interface, -// 'bmqa::SessionEventHandler' for asynchronous notification of events. The -// broker manages named, persistent queues of messages. This broker allows a -// client to open queues, post messages to them, or retrieve messages from -// them. All of these operations take place within the context of the session -// opened by the client application. -// -// Messages received from a broker are communicated to the application by the -// session associated with that broker in the form of events (see -// 'bmqa_event'). Events can be of two different types: (1) Messages and -// message status events ('bmqa::MessageEvent'), or (2) Session or queue -// status events ('bmqa::SessionEvent'). -// -// A 'Session' can dispatch events to the application in either a synchronous -// or asynchronous mode. In synchronous mode, the application must call the -// 'nextEvent' method in order to obtain events from the 'Session'. In -// asynchronous mode, the application must supply a concrete -// 'SessionEventHandler' object at construction time. The concrete -// 'SessionEventHandler' provided by the application must implement the -// 'onSessionEvent' and 'onMessageEvent' methods, which will be called by the -// 'Session' every time a session event or a message event is received. Note -// that by default, a session created in asynchronous mode creates only one -// internal thread to dispatch events, but a different value for number of -// threads can be specified in 'bmqt::SessionOptions'. -// -// A 'Session' is created either in synchronous or in asynchronous mode, and it -// will remain in that mode until destruction. Allowing a mix between -// synchronous or asynchronous would make the SDK complicated. The only -// exceptions are the "start" and "open" operations that must be available in -// synchronous or asynchronous version for the convenience of the programmer. -// -// By default a 'Session' connects to the local broker, which in turn may -// connect to a remote cluster based on configuration. -// -// After a 'bmqa::Session' is started, the application has to open one or -// several queues in read and/or write mode. -// -/// Disclaimer -///---------- -// A 'Session' object is a heavy object representing the negotiated TCP session -// with the broker, and the entire associated state (opened queues, statistics, -// ...). Therefore, sessions should be always reused if possible, preferably -// with only *one* session per lifetime of a component/library/task. -// Note that at the time of this writing multiplexing of different logical -// sessions over the same physical connection is not supported, so in certain -// circumstances reuse of the same session across the whole of a single -// application will not be possible. For example, if an application uses two -// unrelated libraries both of which use BlazingMQ under the hood, they won't -// be able to share a session as it stands. -// An example of an extreme inefficiency and an abuse of resources is to -// create a session ad-hoc every time a message needs to be posted by the same -// component. -// -/// Thread-safety -///------------- -// This session object is *thread* *enabled*, meaning that two threads can -// safely call any methods on the *same* *instance* without external -// synchronization. -// -/// Connecting to the Broker -///------------------------ -// A 'Session' establishes a communication with a broker service using TCP/IP. -// Each 'Session' object must be constructed with a 'bmqa::SessionOptions' -// object, which provides the necessary information to connect to the broker. -// In particular, the 'SessionOptions' object must specify the IP address and -// port needed to connect to the broker. The 'SessionOptions' object may also -// provide extra parameters for tuning the TCP connection behavior (see -// 'bmqa_sessionoptions' for details). -// -// Note that in most cases the user does not need to explicitly construct a -// 'SessionOptions' object: the default constructor for 'SessionOptions' -// creates an instance that will connect to the broker service on the local -// machine using the standard port. -// -// Some options can also be provided using environment variables. -//: o !BMQ_BROKER_URI!: Corresponds to 'SessionOptions::brokerUri'. -//: If this environment variable is set, its value will override the one -//: specified in the 'SessionOptions'. -// -// A 'Session' object is created in an unconnected state. The 'start' or -// 'startAsync' method must be called to connect to the broker. Note that -// 'start' method is blocking, and returns either after connection to broker -// has been established (success), or after specified timeout (failure). -// 'startAsync' method, as the name suggests, connects to the broker -// asynchronously (i.e., it returns immediately), and the result of the -// operation is notified via 'bmqt::SessionEventType::CONNECTED' session event. -// -// When the 'Session' is no longer needed, the application should call the -// 'stop' (blocking) or 'stopAsync' (non-blocking) method to shut down the -// 'Session' and disconnect from the broker. Note that destroying a Session -// automatically stops it. The session can be restarted with a call to 'start' -// or 'startAsync' once it has been fully stopped. -// -/// Connection loss and reconnection -///-------------------------------- -// If the connection between the application and the broker is lost, the -// 'Session' will automatically try to reconnect periodically. The 'Session' -// will also notify the application of the event of losing the connection via -// 'bmqt::SessionEventType::CONNECTION_LOST' session event. -// -// Once the connection has been re-established with the broker (as a result of -// one of the periodic reconnection attempts), the 'Session' will notify the -// application via 'bmqt::SessionEventType::RECONNECTED' session event. After -// the connection re-establishment, the 'Session' will attempt to reopen the -// queues that were in 'OPEN' state prior to connection loss. The 'Session' -// will notify the application of the result of reopen operation via -// 'bmqt::SessionEventType::QUEUE_REOPEN_RESULT' for each queue. Note that a -// reopen operation on a queue may fail (due to broker issue, machine issue, -// etc), so the application must keep track on these session events, and stop -// posting on a queue that failed to reopen. -// -// After all reopen operations are complete and application has been notified -// with all 'bmqt::SessionEventType::QUEUE_REOPEN_RESULT' events, the 'Session' -// delivers a 'bmqt::SessionEventType::STATE_RESTORED' session event to the -// application. -// -/// Example 1 -///- - - - - -// The following example illustrates how to create a 'Session' in synchronous -// mode, start it, and stop it. -//.. -// void runSession() -// { -// bmqt::SessionOptions options; -// options.setBrokerUri("tcp://localhost:30114"); -// -// bmqa::Session session(options); -// int res = session.start(); -// if (0 != res) { -// bsl::cout << "Failed to start session (" << res << ")" -// << bsl::endl; -// return; -// } -// bsl::cout << "Session started." << bsl::endl; -// -// // Open queue in READ or WRITE or READ/WRITE mode, and receive or -// // post messages, etc. -// // ... -// -// session.stop(); -// } -//.. -// This example can be simplified because the constructor for 'Session' uses a -// default 'SessionOptions' object that will connect to the local broker -// service. The example may be rewritten as follow: -//.. -// void runSession() -// { -// bmqa::Session session; // using default 'SessionOptions' -// int res = session.start(); -// if (0 != res) { -// bsl::cout << "Failed to start session (" << res << ")" -// << bsl::endl; -// return; -// } -// bsl::cout << "Session started." << bsl::endl; -// -// // Open queue in READ or WRITE or READ/WRITE mode, and receive or -// // post messages, etc. -// // ... -// -// session.stop(); -// } -//.. -// -/// Processing session events - synchronous mode -///-------------------------------------------- -// If the 'Session' is created in synchronous mode, the application needs to -// call the 'nextEvent' method on a regular basis in order to receive events. -// This method takes an optional wait timeout as a parameter, and it will -// return the next available 'Event' from the session's internal event queue or -// it will block the calling thread execution until new 'Event' arrives or -// until the specified timeout expires. It is safe to call the 'nextEvent' -// method from different threads simultaneously: the 'Session' class provides -// proper synchronization logic to protect the internal event queue from -// corruption in this scenario. -// -/// Example 2 -///- - - - - -// The following example demonstrates how to write a function that queries and -// processes events synchronously. In this example the switch form checks the -// type of the 'Event' and performs the necessary actions. -// -// We first define two functions to process 'SessionEvent' and 'MessageEvent'. -// These functions return 'true' if we should keep processing events and -// 'false' otherwise (i.e., no more events are expected from the 'Session'). -//.. -// bool processSessionEvent(const bmqa::SessionEvent& event) -// { -// bool result = true; -// switch (event.type()) { -// -// case bmqt::SessionEventType::e_CONNECTED: -// // The connection to the broker is established (as a result -// // of a call to the 'start' method). -// openQueues(); -// startPostingToQueues(); -// break; -// -// case bmqt::SessionEventType::e_DISCONNECTED: -// // The connection to the broker is terminated (as a result -// // of a call to the 'stop' method). -// result = false; -// break; -// -// case bmqt::SessionEventType::e_CONNECTION_LOST: -// // The connection to the broker dropped. Stop posting to the queue. -// stopPostingToQueues(); -// break; -// -// case bmqt::SessionEventType::e_STATE_RESTORED: -// // The connection to the broker has been restored (i.e., all queues -// // have been re-opened. Resume posting to the queue. -// resumePostingToQueues(); -// break; -// -// case bmqt::SessionEventType::e_CONNECTION_TIMEOUT: -// // The connection to the broker has timed out. -// result = false; -// break; -// -// case bmqt::SessionEventType::e_ERROR: -// // Internal error -// bsl::cout << "Unexpected session error: " -// << event.errorDescription() << bsl::endl; -// break; -// -// } // end switch -// -// return result; -// } -// -// bool processMessageEvent(const bmqa::MessageEvent& event) -// { -// bool result = true; -// switch (event.type()) { -// -// case bmqt::MessageEventType::e_PUSH: { -// // Received a 'PUSH' event from the broker. -// bmqa::MessageIterator msgIter = event.messageIterator(); -// while (msgIter.nextMessage()) { -// const bmqa::Message& msg = msgIter.message(); -// // Process 'PUSH' msg here (omitted for brevity) -// // ... -// } -// } break; -// -// case bmqt::MessageEventType::e_ACK: { -// // Received an 'ACK' event from the broker. -// bmqa::MessageIterator msgIter = event.messageIterator(); -// while (msgIter.nextMessage()) { -// const bmqa::Message& msg = msgIter.message(); -// // Process 'ACK' msg here (omitted for brevity) -// // ... -// } -// } break; -// -// } // end switch -// -// return result; -// } -//.. -// -// Next, we define a function that handles events synchronously using the -// 'processSessionEvent' and 'processMessageEvent' functions. -//.. -// void handleEventsSynchronously(bmqa::Session *startedSession) -// { -// bool more = true; -// while (more) { -// bmqa::Event event = -// startedSession->nextEvent(bsls::TimeInterval(2.0)); -// if (event.isSessionEvent()) { -// more = processSessionEvent(event.sessionEvent()); -// } -// else { -// more = processMessageEvent(event.messageEvent()); -// } -// } -// } -//.. -// -/// Processing session events - asynchronous mode -///--------------------------------------------- -// If application wishes to use 'Session' in asynchronous mode, it must pass a -// managed pointer to an event handler implementing the 'SessionEventHandler'. -// In this case, when 'Session' is started, a thread pool owned by the -// 'Session' is also started for processing events asynchronously. The -// 'Session' will call event handler's 'onSessionEvent' or 'onMessageEvent' -// method every time a session event or a message event is available. -// -// Note that after the 'Session' is associated with some event handler, this -// association cannot be changed or canceled. The event handler will be used -// for processing events until the 'Session' object is destroyed. -// -/// Example 3 -///- - - - - -// The following example demonstrates how to implement an event handler and how -// to make the 'Session' use an instance of this event handler for processing -// events. -// -// First, we define a concrete implementation of 'SessionEventHandler'. -// -//.. -// class MyHandler: public bmqa::SessionEventHandler { -// public: -// MyHandler() { } -// virtual ~MyHandler() { } -// virtual void onSessionEvent(const bmqa::SessionEvent& event); -// virtual void onMessageEvent(const bmqa::MessageEvent& event); -// }; -// -// void MyHandler::onSessionEvent(const bmqa::SessionEvent& event) -// { -// // The implementation is similar to our 'processSessionEvent' function -// // defined in the previous example. -// processSessionEvent(event); -// } -// -// void MyHandler::onMessageEvent(const bmqa::MessageEvent& event) -// { -// // The implementation is similar to our 'processMessageEvent' function -// // defined in the previous example. -// processMessageEvent(event); -// } -//.. -// Next, we define a function that creates a 'Session' using our implementation -// of 'SessionEventHandler'. -//.. -// void runAsyncSession() -// { -// bslma::ManagedPtr handlerMp(new MyHandler()); -// -// bmqa::Session session(handlerMp); // using default 'SessionOptions' -// int res = session.start(); -// if (0 != res) { -// bsl::cout << "Failed to start session (" << res << ")" -// << bsl::endl; -// return; -// } -// -// // ... -// -// session.stop(); -// } -//.. -// -/// Opening queues -///-------------- -// Once the 'Session' has been created and started, the application can use it -// to open queues for producing and/or consuming messages. A queue is -// associated with a domain. Domain metadata must be deployed in the BlazingMQ -// infrastructure prior to opening queues under that domain, because opening a -// queue actually loads the metadata deployed for the associated domain. -// -// The metadata associated with a domain defines various parameters like -// maximum queue size and capacity, persistent policy, routing policy, etc. -// -// Queue are identified by URIs (Unified Resource Identifiers) that must -// follow the BlazingMQsyntax, manipulated as 'bmqt::Uri' objects. A queue URI -// is typically formatted as follows: -//.. -// bmq://my.domain/my.queue -//.. -// Note that domain names are unique in BlazingMQ infrastructure, which makes a -// fully qualified queue URI unique too. -// -// Queues in BlazingMQ infrastructure are created by applications on demand. -// Broke creates a queue when it receives an open-queue request from an -// application for a queue that does not exist currently. -// -// Application can open a queue by calling 'openQueue' or 'openQueueAsync' -// method on a started session. Application must pass appropriate flags to -// indicate if it wants to post messages to queue, consume messages from the -// queue, or both. -// -// Note that 'openQueue' is a blocking method, and returns after specified -// queue has been successfully opened (success) or after specified timeout has -// expired (failure). 'openQueueAsync' method, as the name suggests, is non -// blocking, and the result of the operation is notified via -// 'bmqt::SessionEventType::QUEUE_OPEN_RESULT' session event. -// -/// Example 4 -///- - - - - -// The following example demonstrates how to open a queue for posting messages. -// The code first opens the queue with appropriate flags, and then uses -// 'bmqa::MessageEventBuilder' to build a message event and post to the queue. -//.. -// // Session creation and startup logic elided for brevity -// const char *queueUri = "bmq://my.domain/my.queue"; -// bmqa::QueueId myQueueId(1); // ID for the queue -// int rc = session.openQueue( -// &myQueueId, -// queueUri, -// bmqt::QueueFlags::e_WRITE | bmqt::QueueFlags::e_ACK, -// bsls::TimeInterval(30, 0)); -// -// if (rc != 0) { -// bsl::cerr << "Failed to open queue, rc: " -// << bmqt::OpenQueueResult::Enum(rc) -// << bsl::endl; -// return; -// } -//.. -// Note that apart from 'WRITE' flag, 'ACK' flag has been passed to -// 'openQueue' method above. This indicates that application is interested in -// receiving 'ACK' notification for each message it posts to the queue, -// irrespective of whether or not the message was successfully received by the -// broker and posted to the queue. -// -// Once the queue has been successfully opened for writing, messages can be -// posted to the queue for consumption by interested applications. We will use -// 'bmqa::MessageEventBuilder' to build a message event. -//.. -// // Create a message event builder -// bmqa::MessageEventBuilder builder; -// session.loadMessageEventBuilder(&builder); -// -// // Create and post a message event containing 1 message -// bmqa::Message& msg = builder.startMessage(); -// -// msg.setCorrelationId(myCorrelationId); -// msg.setDataRef(&myPayload); // where 'myPayload' is of type 'bdlbb::Blob' -// rc = builder.packMessage(myQueueId); -// if (rc != 0) { -// bsl::cerr << "Failed to pack message, rc: " -// << bmqt::EventBuilderResult::Enum(rc) -// << bsl::endl; -// return; -// } -// -// // Post message event -// rc = session.post(builder.messageEvent()); -// if (rc != 0) { -// bsl::cerr << "Failed to post message event to the queue, rc: " -// << bmqt::PostResult::Enum(rc) -// << bsl::endl; -// return; -// } -// -// // ... post more messages -//.. -// -/// Closing queues -///-------------- -// After an application no longer needs to produce or consume messages from a -// queue, it can be closed by 'closeQueue' or 'closeQueueAsync' method. Note -// that closing a queue closes an application's "view" on the queue, and may -// not lead to queue deletion in the broker. A 'Session' does not expose any -// method to explicitly delete a queue. -// -// Note that 'closeQueue' is a blocking method and returns after the specified -// queue has been successfully closed (success) or after specified timeout has -// expired (failure). 'closeQueueAsync', as the name suggests, is a -// non-blocking method, and result of the operation is notified via -// 'bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT' session event. -// -// There are 3 flavors which behave differently with regard to thread blocking -// and callback execution: -///---------------------------------------------------------------------------- -// | openQueue | openQueueSync | openQueueAsync -// | configureQueue | configureQueueSync | configureQueueAsync -// | closeQueue | closeQueueSync | closeQueueAsync -// | (deprecated Sync) | (Synchronous) | (Asynchronous) -//-----------|-------------------|----------------------|---------------------- -// event | unblocks in | unblocks in event | executes callback in -// handler | internal thread | handler thread (*) | event handler thread -// | | | -// nextEvent | unblocks in | unblocks in | executes callback -// | internal thread | internal thread | in nextEvent thread -//----------------------------------------------------------------------------- -// -// (*) - guarantees unblocking after all previously enqueued events have been -// emitted to the eventHandler, allowing the user to have proper serialization -// of events for the given queue (for example no more PUSH messages will be -// delivered through the eventHandler for the queue after -// configureQueueSync(maxUnconfirmed = 0) returns). +/// @file bmqa_session.h +/// +/// @brief Provide access to the BlazingMQ broker. +/// +/// This component provides a mechanism, @bbref{bmqa::Session}, that provides +/// access to a message queue broker and an interface, +/// @bbref{bmqa::SessionEventHandler} for asynchronous notification of events. +/// The broker manages named, persistent queues of messages. This broker +/// allows a client to open queues, post messages to them, or retrieve messages +/// from them. All of these operations take place within the context of the +/// session opened by the client application. +/// +/// Messages received from a broker are communicated to the application by the +/// session associated with that broker in the form of events (see @ref +/// bmqa_event.h). Events can be of two different types: (1) Messages and +/// message status events (@bbref{bmqa::MessageEvent}), or (2) Session or queue +/// status events (@bbref{bmqa::SessionEvent}). +/// +/// A @bbref{bmqa::Session} can dispatch events to the application in either a +/// synchronous or asynchronous mode. In synchronous mode, the application +/// must call the `nextEvent` method in order to obtain events from the +/// @bbref{bmqa::Session}. In asynchronous mode, the application must supply a +/// concrete @bbref{bmqa::SessionEventHandler} object at construction time. +/// The concrete @bbref{bmqa::SessionEventHandler} provided by the application +/// must implement the `onSessionEvent` and `onMessageEvent` methods, which +/// will be called by the @bbref{bmqa::Session} every time a session event or a +/// message event is received. Note that by default, a session created in +/// asynchronous mode creates only one internal thread to dispatch events, but +/// a different value for number of threads can be specified in +/// @bbref{bmqt::SessionOptions}. +/// +/// A @bbref{bmqa::Session} is created either in synchronous or in asynchronous +/// mode, and it will remain in that mode until destruction. Allowing a mix +/// between synchronous or asynchronous would make the SDK complicated. The +/// only exceptions are the "start" and "open" operations that must be +/// available in synchronous or asynchronous version for the convenience of the +/// programmer. +/// +/// By default a @bbref{bmqa::Session} connects to the local broker, which in +/// turn may connect to a remote cluster based on configuration. +/// +/// After a @bbref{bmqa::Session} is started, the application has to open one +/// or several queues in read and/or write mode. +/// +/// Disclaimer {#bmqa_session_disclaimer} +/// ========== +/// +/// A @bbref{bmqa::Session} object is a heavy object representing the +/// negotiated TCP session with the broker, and the entire associated state +/// (opened queues, statistics, ...). Therefore, sessions should be always +/// reused if possible, preferably with only *one* session per lifetime of a +/// component/library/task. Note that at the time of this writing multiplexing +/// of different logical sessions over the same physical connection is not +/// supported, so in certain circumstances reuse of the same session across the +/// whole of a single application will not be possible. For example, if an +/// application uses two unrelated libraries both of which use BlazingMQ under +/// the hood, they won't be able to share a session as it stands. An example +/// of an extreme inefficiency and an abuse of resources is to create a session +/// ad-hoc every time a message needs to be posted by the same component. +/// +/// Thread-safety {#bmqa_session_thread} +/// ============= +/// +/// This session object is *thread* *enabled*, meaning that two threads can +/// safely call any methods on the *same* *instance* without external +/// synchronization. +/// +/// Connecting to the Broker {#bmqa_session_connecting} +/// ======================== +/// +/// A @bbref{bmqa::Session} establishes a communication with a broker service +/// using TCP/IP. Each @bbref{bmqa::Session} object must be constructed with a +/// @bbref{bmqt::SessionOptions} object, which provides the necessary +/// information to connect to the broker. In particular, the +/// @bbref{bmqt::SessionOptions} object must specify the IP address and port +/// needed to connect to the broker. The @bbref{bmqt::SessionOptions} object +/// may also provide extra parameters for tuning the TCP connection behavior +/// (see @ref bmqt_sessionoptions.h for details). +/// +/// Note that in most cases the user does not need to explicitly construct a +/// @bbref{bmqt::SessionOptions} object: the default constructor for +/// @bbref{bmqt::SessionOptions} creates an instance that will connect to the +/// broker service on the local machine using the standard port. +/// +/// Some options can also be provided using environment variables. +/// +/// - **BMQ_BROKER_URI**: Corresponds to +/// @bbref{bmqt::SessionOptions::brokerUri}. If this environment variable +/// is set, its value will override the one specified in the +/// @bbref{bmqt::SessionOptions}. +/// +/// A @bbref{bmqa::Session} object is created in an unconnected state. The +/// `start` or `startAsync` method must be called to connect to the broker. +/// Note that `start` method is blocking, and returns either after connection +/// to broker has been established (success), or after specified timeout +/// (failure). `startAsync` method, as the name suggests, connects to the +/// broker asynchronously (i.e., it returns immediately), and the result of the +/// operation is notified via @bbref{bmqt::SessionEventType::e_CONNECTED} +/// session event. +/// +/// When the @bbref{bmqa::Session} is no longer needed, the application should +/// call the `stop` (blocking) or `stopAsync` (non-blocking) method to shut +/// down the @bbref{bmqa::Session} and disconnect from the broker. Note that +/// destroying a Session automatically stops it. The session can be restarted +/// with a call to `start` or `startAsync` once it has been fully stopped. +/// +/// Connection loss and reconnection {#bmqa_session_reconnection} +/// ================================ +/// +/// If the connection between the application and the broker is lost, the +/// @bbref{bmqa::Session} will automatically try to reconnect periodically. +/// The @bbref{bmqa::Session} will also notify the application of the event of +/// losing the connection via @bbref{bmqt::SessionEventType::e_CONNECTION_LOST} +/// session event. +/// +/// Once the connection has been re-established with the broker (as a result of +/// one of the periodic reconnection attempts), the @bbref{bmqa::Session} will +/// notify the application via @bbref{bmqt::SessionEventType::e_RECONNECTED} +/// session event. After the connection re-establishment, the +/// @bbref{bmqa::Session} will attempt to reopen the queues that were in `OPEN` +/// state prior to connection loss. The @bbref{bmqa::Session} will notify the +/// application of the result of reopen operation via +/// @bbref{bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT} for each queue. Note +/// that a reopen operation on a queue may fail (due to broker issue, machine +/// issue, etc), so the application must keep track on these session events, +/// and stop posting on a queue that failed to reopen. +/// +/// After all reopen operations are complete and application has been notified +/// with all @bbref{bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT} events, the +/// @bbref{bmqa::Session} delivers a +/// @bbref{bmqt::SessionEventType::e_STATE_RESTORED} session event to the +/// application. +/// +/// Example 1 {#bmqa_session_ex1} +/// --------- +/// +/// The following example illustrates how to create a @bbref{bmqa::Session} in +/// synchronous mode, start it, and stop it. +/// +/// ``` +/// void runSession() +/// { +/// bmqt::SessionOptions options; +/// options.setBrokerUri("tcp://localhost:30114"); +/// +/// bmqa::Session session(options); +/// int res = session.start(); +/// if (0 != res) { +/// bsl::cout << "Failed to start session (" << res << ")" +/// << bsl::endl; +/// return; +/// } +/// bsl::cout << "Session started." << bsl::endl; +/// +/// // Open queue in READ or WRITE or READ/WRITE mode, and receive or +/// // post messages, etc. +/// // ... +/// +/// session.stop(); +/// } +/// ``` +/// +/// This example can be simplified because the constructor for +/// @bbref{bmqa::Session} uses a default @bbref{bmqt::SessionOptions} object +/// that will connect to the local broker service. The example may be +/// rewritten as follow: +/// +/// ``` +/// void runSession() +/// { +/// bmqa::Session session; // using default 'SessionOptions' +/// int res = session.start(); +/// if (0 != res) { +/// bsl::cout << "Failed to start session (" << res << ")" +/// << bsl::endl; +/// return; +/// } +/// bsl::cout << "Session started." << bsl::endl; +/// +/// // Open queue in READ or WRITE or READ/WRITE mode, and receive or +/// // post messages, etc. +/// // ... +/// +/// session.stop(); +/// } +/// ``` +/// +/// Processing session events - synchronous mode {#bmqa_session_synchronous} +/// ============================================ +/// +/// If the @bbref{bmqa::Session} is created in synchronous mode, the +/// application needs to call the `nextEvent` method on a regular basis in +/// order to receive events. This method takes an optional wait timeout as a +/// parameter, and it will return the next available @bbref{bmqa::Event} from +/// the session's internal event queue or it will block the calling thread +/// execution until new @bbref{bmqa::Event} arrives or until the specified +/// timeout expires. It is safe to call the `nextEvent` method from different +/// threads simultaneously: the @bbref{bmqa::Session} class provides proper +/// synchronization logic to protect the internal event queue from corruption +/// in this scenario. +/// +/// Example 2 {#bmqa_session_ex2} +/// --------- +/// +/// The following example demonstrates how to write a function that queries and +/// processes events synchronously. In this example the switch form checks the +/// type of the @bbref{bmqa::Event} and performs the necessary actions. +/// +/// We first define two functions to process @bbref{bmqa::SessionEvent} and +/// @bbref{bmqa::MessageEvent}. These functions return `true` if we should +/// keep processing events and `false` otherwise (i.e., no more events are +/// expected from the @bbref{bmqa::Session}). +/// +/// ``` +/// bool processSessionEvent(const bmqa::SessionEvent& event) +/// { +/// bool result = true; +/// switch (event.type()) { +/// +/// case bmqt::SessionEventType::e_CONNECTED: +/// // The connection to the broker is established (as a result +/// // of a call to the 'start' method). +/// openQueues(); +/// startPostingToQueues(); +/// break; +/// +/// case bmqt::SessionEventType::e_DISCONNECTED: +/// // The connection to the broker is terminated (as a result +/// // of a call to the 'stop' method). +/// result = false; +/// break; +/// +/// case bmqt::SessionEventType::e_CONNECTION_LOST: +/// // The connection to the broker dropped. Stop posting to the queue. +/// stopPostingToQueues(); +/// break; +/// +/// case bmqt::SessionEventType::e_STATE_RESTORED: +/// // The connection to the broker has been restored (i.e., all queues +/// // have been re-opened. Resume posting to the queue. +/// resumePostingToQueues(); +/// break; +/// +/// case bmqt::SessionEventType::e_CONNECTION_TIMEOUT: +/// // The connection to the broker has timed out. +/// result = false; +/// break; +/// +/// case bmqt::SessionEventType::e_ERROR: +/// // Internal error +/// bsl::cout << "Unexpected session error: " +/// << event.errorDescription() << bsl::endl; +/// break; +/// +/// } // end switch +/// +/// return result; +/// } +/// +/// bool processMessageEvent(const bmqa::MessageEvent& event) +/// { +/// bool result = true; +/// switch (event.type()) { +/// +/// case bmqt::MessageEventType::e_PUSH: { +/// // Received a 'PUSH' event from the broker. +/// bmqa::MessageIterator msgIter = event.messageIterator(); +/// while (msgIter.nextMessage()) { +/// const bmqa::Message& msg = msgIter.message(); +/// // Process 'PUSH' msg here (omitted for brevity) +/// // ... +/// } +/// } break; +/// +/// case bmqt::MessageEventType::e_ACK: { +/// // Received an 'ACK' event from the broker. +/// bmqa::MessageIterator msgIter = event.messageIterator(); +/// while (msgIter.nextMessage()) { +/// const bmqa::Message& msg = msgIter.message(); +/// // Process 'ACK' msg here (omitted for brevity) +/// // ... +/// } +/// } break; +/// +/// } // end switch +/// +/// return result; +/// } +/// ``` +/// +/// Next, we define a function that handles events synchronously using the +/// `processSessionEvent` and `processMessageEvent` functions. +/// +/// ``` +/// void handleEventsSynchronously(bmqa::Session *startedSession) +/// { +/// bool more = true; +/// while (more) { +/// bmqa::Event event = +/// startedSession->nextEvent(bsls::TimeInterval(2.0)); +/// if (event.isSessionEvent()) { +/// more = processSessionEvent(event.sessionEvent()); +/// } +/// else { +/// more = processMessageEvent(event.messageEvent()); +/// } +/// } +/// } +/// ``` +/// +/// Processing session events - asynchronous mode {#bmqa_session_asynchronous} +/// ============================================= +/// +/// If application wishes to use @bbref{bmqa::Session} in asynchronous mode, it +/// must pass a managed pointer to an event handler implementing the +/// @bbref{bmqa::SessionEventHandler}. In this case, when +/// @bbref{bmqa::Session} is started, a thread pool owned by the +/// @bbref{bmqa::Session} is also started for processing events asynchronously. +/// The @bbref{bmqa::Session} will call event handler's `onSessionEvent` or +/// `onMessageEvent` method every time a session event or a message event is +/// available. +/// +/// Note that after the @bbref{bmqa::Session} is associated with some event +/// handler, this association cannot be changed or canceled. The event handler +/// will be used for processing events until the @bbref{bmqa::Session} object +/// is destroyed. +/// +/// Example 3 {#bmqa_session_ex3} +/// --------- +/// +/// The following example demonstrates how to implement an event handler and +/// how to make the @bbref{bmqa::Session} use an instance of this event handler +/// for processing events. +/// +/// First, we define a concrete implementation of +/// @bbref{bmqa::SessionEventHandler}. +/// +/// ``` +/// class MyHandler: public bmqa::SessionEventHandler { +/// public: +/// MyHandler() { } +/// virtual ~MyHandler() { } +/// virtual void onSessionEvent(const bmqa::SessionEvent& event); +/// virtual void onMessageEvent(const bmqa::MessageEvent& event); +/// }; +/// +/// void MyHandler::onSessionEvent(const bmqa::SessionEvent& event) +/// { +/// // The implementation is similar to our 'processSessionEvent' function +/// // defined in the previous example. +/// processSessionEvent(event); +/// } +/// +/// void MyHandler::onMessageEvent(const bmqa::MessageEvent& event) +/// { +/// // The implementation is similar to our 'processMessageEvent' function +/// // defined in the previous example. +/// processMessageEvent(event); +/// } +/// ``` +/// +/// Next, we define a function that creates a @bbref{bmqa::Session} using our +/// implementation of @bbref{bmqa::SessionEventHandler}. +/// +/// ``` +/// void runAsyncSession() +/// { +/// bslma::ManagedPtr handlerMp(new MyHandler()); +/// +/// bmqa::Session session(handlerMp); // using default 'SessionOptions' +/// int res = session.start(); +/// if (0 != res) { +/// bsl::cout << "Failed to start session (" << res << ")" +/// << bsl::endl; +/// return; +/// } +/// +/// // ... +/// +/// session.stop(); +/// } +/// ``` +/// +/// Opening queues {#bmqa_session_opening} +/// ============== +/// +/// Once the @bbref{bmqa::Session} has been created and started, the +/// application can use it to open queues for producing and/or consuming +/// messages. A queue is associated with a domain. Domain metadata must be +/// deployed in the BlazingMQ infrastructure prior to opening queues under that +/// domain, because opening a queue actually loads the metadata deployed for +/// the associated domain. +/// +/// The metadata associated with a domain defines various parameters like +/// maximum queue size and capacity, persistent policy, routing policy, etc. +/// +/// Queue are identified by URIs (Unified Resource Identifiers) that must +/// follow the BlazingMQ syntax, manipulated as @bbref{bmqt::Uri} objects. A +/// queue URI is typically formatted as follows: +/// +/// ``` +/// bmq://my.domain/my.queue +/// ``` +/// +/// Note that domain names are unique in BlazingMQ infrastructure, which makes +/// a fully qualified queue URI unique too. +/// +/// Queues in BlazingMQ infrastructure are created by applications on demand. +/// Broke creates a queue when it receives an open-queue request from an +/// application for a queue that does not exist currently. +/// +/// Application can open a queue by calling `openQueue` or `openQueueAsync` +/// method on a started session. Application must pass appropriate flags to +/// indicate if it wants to post messages to queue, consume messages from the +/// queue, or both. +/// +/// Note that `openQueue` is a blocking method, and returns after specified +/// queue has been successfully opened (success) or after specified timeout has +/// expired (failure). `openQueueAsync` method, as the name suggests, is non +/// blocking, and the result of the operation is notified via +/// @bbref{bmqt::SessionEventType::e_QUEUE_OPEN_RESULT} session event. +/// +/// Example 4 {#bmqa_session_ex4} +/// --------- +/// +/// The following example demonstrates how to open a queue for posting +/// messages. The code first opens the queue with appropriate flags, and then +/// uses @bbref{bmqa::MessageEventBuilder} to build a message event and post to +/// the queue. +/// +/// ``` +/// // Session creation and startup logic elided for brevity +/// const char *queueUri = "bmq://my.domain/my.queue"; +/// bmqa::QueueId myQueueId(1); // ID for the queue +/// int rc = session.openQueue( +/// &myQueueId, +/// queueUri, +/// bmqt::QueueFlags::e_WRITE | bmqt::QueueFlags::e_ACK, +/// bsls::TimeInterval(30, 0)); +/// +/// if (rc != 0) { +/// bsl::cerr << "Failed to open queue, rc: " +/// << bmqt::OpenQueueResult::Enum(rc) +/// << bsl::endl; +/// return; +/// } +/// ``` +/// +/// Note that apart from `WRITE` flag, `ACK` flag has been passed to +/// `openQueue` method above. This indicates that application is interested in +/// receiving `ACK` notification for each message it posts to the queue, +/// irrespective of whether or not the message was successfully received by the +/// broker and posted to the queue. +/// +/// Once the queue has been successfully opened for writing, messages can be +/// posted to the queue for consumption by interested applications. We will +/// use @bbref{bmqa::MessageEventBuilder} to build a message event. +/// +/// ``` +/// // Create a message event builder +/// bmqa::MessageEventBuilder builder; +/// session.loadMessageEventBuilder(&builder); +/// +/// // Create and post a message event containing 1 message +/// bmqa::Message& msg = builder.startMessage(); +/// +/// msg.setCorrelationId(myCorrelationId); +/// msg.setDataRef(&myPayload); // where 'myPayload' is of type 'bdlbb::Blob' +/// rc = builder.packMessage(myQueueId); +/// if (rc != 0) { +/// bsl::cerr << "Failed to pack message, rc: " +/// << bmqt::EventBuilderResult::Enum(rc) +/// << bsl::endl; +/// return; +/// } +/// +/// // Post message event +/// rc = session.post(builder.messageEvent()); +/// if (rc != 0) { +/// bsl::cerr << "Failed to post message event to the queue, rc: " +/// << bmqt::PostResult::Enum(rc) +/// << bsl::endl; +/// return; +/// } +/// +/// // ... post more messages +/// ``` +/// +/// Closing queues {#bmqa_session_closing} +/// ============== +/// +/// After an application no longer needs to produce or consume messages from a +/// queue, it can be closed by `closeQueue` or `closeQueueAsync` method. Note +/// that closing a queue closes an application's "view" on the queue, and may +/// not lead to queue deletion in the broker. A @bbref{bmqa::Session} does not +/// expose any method to explicitly delete a queue. +/// +/// Note that `closeQueue` is a blocking method and returns after the specified +/// queue has been successfully closed (success) or after specified timeout has +/// expired (failure). `closeQueueAsync`, as the name suggests, is a +/// non-blocking method, and result of the operation is notified via +/// @bbref{bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT} session event. +/// +/// There are 3 flavors which behave differently with regard to thread blocking +/// and callback execution: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +///
openQueue, configureQueue, closeQueue (deprecated Sync)openQueueSync, configureQueueSync, closeQueueSync (Synchronous)openQueueAsync, configureQueueAsync, closeQueueAsync +/// (Asynchronous)
event handlerunblocks in internal threadunblocks in event handler thread (*)executes callback in event handler thread
nextEventunblocks in internal threadunblocks in internal threadexecutes callback in nextEvent thread
+/// +/// (*) - guarantees unblocking after all previously enqueued events have been +/// emitted to the eventHandler, allowing the user to have proper serialization +/// of events for the given queue (for example no more PUSH messages will be +/// delivered through the eventHandler for the queue after +/// `configureQueueSync(maxUnconfirmed = 0)` returns). // BMQ diff --git a/src/groups/bmq/bmqa/bmqa_sessionevent.h b/src/groups/bmq/bmqa/bmqa_sessionevent.h index 0ec10a0e25..8f3ed61f54 100644 --- a/src/groups/bmq/bmqa/bmqa_sessionevent.h +++ b/src/groups/bmq/bmqa/bmqa_sessionevent.h @@ -17,32 +17,36 @@ #ifndef INCLUDED_BMQA_SESSIONEVENT #define INCLUDED_BMQA_SESSIONEVENT -//@PURPOSE: Provide value-semantic type for system event session notifications. -// -//@CLASSES: -// bmqa::SessionEvent: type for notification events related to the 'Session'. -// -//@SEE_ALSO: -// bmqt::SessionEventType: Enum of the various type of notifications -// -//@DESCRIPTION: This component provides a generic 'bmqa::SessionEvent' -// notification object used by the 'bmqa::Session' to provide BlazingMQ -// applications with information regarding changes in the session status or the -// result of operations with the message queue broker. -// -// A 'SessionEvent' is composed of 4 attributes: -//: o !type!: indicate the type of the notification -//: o !statusCode!: indicate the status of the operation (success, -//: failure) -//: o !correlationId!: optional correlationId used during async response -//: o !queueId!: optional queueId associated with the event, of type -//: 'OPEN', 'CONFIGURE', 'CLOSE', 'REOPEN' -//: o !errorDescription!: optional string with a human readable description of -//: the error, if any -// -// Note that 'SessionEvent' is implemented using the pimpl idiom, so copying a -// 'SessionEvent' is very cheap (a pointer copy). All copies of this -// 'SessionEvent' will share the same underlying implementation. +/// @file bmqa_sessionevent.h +/// +/// @brief Provide value-semantic type for system event session notifications. +/// +/// @see @bbref{bmqt::SessionEventType}: Enum of the various type of +/// notifications +/// +/// This component provides a generic @bbref{bmqa::SessionEvent} notification +/// object used by the @bbref{bmqa::Session} to provide BlazingMQ applications +/// with information regarding changes in the session status or the result of +/// operations with the message queue broker. +/// +/// A @bbref{bmqa::SessionEvent} is composed of 4 attributes: +/// +/// - **type**: indicate the type of the notification +/// +/// - **statusCode**: indicate the status of the operation (success, failure) +/// +/// - **correlationId**: optional correlationId used during async response +/// +/// - **queueId**: optional queueId associated with the event, of type +/// `OPEN`, `CONFIGURE`, `CLOSE`, `REOPEN` +/// +/// - **errorDescription**: optional string with a human readable description +/// of the error, if any +/// +/// Note that @bbref{bmqa::SessionEvent} is implemented using the pimpl idiom, +/// so copying a @bbref{bmqa::SessionEvent} is very cheap (a pointer copy). +/// All copies of this @bbref{bmqa::SessionEvent} will share the same +/// underlying implementation. // BMQ diff --git a/src/groups/bmq/bmqpi/bmqpi_dtcontext.h b/src/groups/bmq/bmqpi/bmqpi_dtcontext.h index e14e34fe29..cfafb00109 100644 --- a/src/groups/bmq/bmqpi/bmqpi_dtcontext.h +++ b/src/groups/bmq/bmqpi/bmqpi_dtcontext.h @@ -17,27 +17,24 @@ #ifndef INCLUDED_BMQPI_DTCONTEXT #define INCLUDED_BMQPI_DTCONTEXT -//@PURPOSE: Provide an interface for a context with a notion of a current span. -// -//@CLASSES: -// bmqpi::DTContext: Interface for a context with a notion of a current span. -// -//@DESCRIPTION: -// 'bmqpi::DTContext' is a pure interface representing a context which defines -// a "current" 'bmqpi::DTSpan' for the calling thread. Implementations *may* -// return different spans for each thread, or return a single span shared by -// all calling threads. -// -// Many distributed trace libraries provide a well-defined thread-local storage -// slot for the span currently under execution, which allows a function to -// obtain a reference to its caller across library boundaries, without changes -// to its API to facilitate dependency injection. This storage slot is set by -// instantiating an RAII "Span Guard" that writes a span to the TLS at -// construction, and reverts its state on destruction (emulating the semantics -// of a call-stack). The API of 'bmqpi::DTContext' aims to make it easy to wrap -// these common patterns in a library-agnostic manner, while also facilitating -// test double implementations. -// +/// @file bmqpi_dtcontext.h +/// +/// @brief Provide an interface for a context with a notion of a current span. +/// +/// @bbref{bmqpi::DTContext} is a pure interface representing a context which +/// defines a "current" @bbref{bmqpi::DTSpan} for the calling +/// thread. Implementations *may* return different spans for each thread, or +/// return a single span shared by all calling threads. +/// +/// Many distributed trace libraries provide a well-defined thread-local +/// storage slot for the span currently under execution, which allows a +/// function to obtain a reference to its caller across library boundaries, +/// without changes to its API to facilitate dependency injection. This storage +/// slot is set by instantiating an RAII "Span Guard" that writes a span to the +/// TLS at construction, and reverts its state on destruction (emulating the +/// semantics of a call-stack). The API of @bbref{bmqpi::DTContext} aims to +/// make it easy to wrap these common patterns in a library-agnostic manner, +/// while also facilitating test double implementations. // BMQ diff --git a/src/groups/bmq/bmqpi/bmqpi_dtspan.h b/src/groups/bmq/bmqpi/bmqpi_dtspan.h index a63f28406c..6c1869f96a 100644 --- a/src/groups/bmq/bmqpi/bmqpi_dtspan.h +++ b/src/groups/bmq/bmqpi/bmqpi_dtspan.h @@ -17,19 +17,16 @@ #ifndef INCLUDED_BMQPI_DTSPAN #define INCLUDED_BMQPI_DTSPAN -//@PURPOSE: Provide an interface representing a span of a distributed trace. -// -//@CLASSES: -// bmqpi::DTSpan: Interface for a span of a distributed trace. -// bmqpi::DTSpan::Baggage: A set of key-values used to describe a 'DTSpan'. -// -//@DESCRIPTION: -// 'bmqpi::DTSpan' is a pure interface representing a node within a distributed -// trace graph (which forms a DAG with edges as invocations). -// -// 'bmqpi::DTSpan::Baggage' represents a set of key-values used to describe -// metadata belonging to a 'DTSpan'. The phrase "baggage" is borrowed from the -// OpenTelemetry standard's terminology. +/// @file bmqpi_dtspan.h +/// +/// @brief Provide an interface representing a span of a distributed trace. +/// +/// @bbref{bmqpi::DTSpan} is a pure interface representing a node within a +/// distributed trace graph (which forms a DAG with edges as invocations). +/// +/// @bbref{bmqpi::DTSpan::Baggage} represents a set of key-values used to +/// describe metadata belonging to a @bbref{bmqpi::DTSpan}. The phrase +/// "baggage" is borrowed from the OpenTelemetry standard's terminology. // BMQ diff --git a/src/groups/bmq/bmqpi/bmqpi_dttracer.h b/src/groups/bmq/bmqpi/bmqpi_dttracer.h index d72df24c53..45f7bbd848 100644 --- a/src/groups/bmq/bmqpi/bmqpi_dttracer.h +++ b/src/groups/bmq/bmqpi/bmqpi_dttracer.h @@ -17,13 +17,13 @@ #ifndef INCLUDED_BMQPI_DTTRACER #define INCLUDED_BMQPI_DTTRACER -//@PURPOSE: Provide an interface that can create new 'DTSpan' objects. -// -//@CLASSES: -// bmqpi::DTTracer: Interface for creators of 'DTSpan' objects. -// -//@DESCRIPTION: -// 'bmqpi::DTTracer' is a pure interface for creators of new 'DTSpan' objects. +/// @file bmqpi_dttracer.h +/// +/// @brief Provide an interface that can create new @bbref{bmqpi::DTSpan} +/// objects. +/// +/// @bbref{bmqpi::DTTracer} is a pure interface for creators of new +/// @bbref{bmqpi::DTSpan} objects. // BMQ diff --git a/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.h b/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.h index 7ba58fc426..c80d5011e0 100644 --- a/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.h +++ b/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.h @@ -17,15 +17,13 @@ #ifndef INCLUDED_BMQPI_HOSTHEALTHMONITOR #define INCLUDED_BMQPI_HOSTHEALTHMONITOR -//@PURPOSE: Provide an interface for monitoring the health of the host. -// -//@CLASSES: -// bmqpi::HostHealthMonitor: Interface for a monitor of host health. -// -//@DESCRIPTION: -// 'bmqpi::HostHealthMonitor' is a pure interface for a monitor of the health -// of the host. BlazingMQ sessions can use such objects to conditionally -// suspend queue activity while the host is marked unhealthy. +/// @file bmqpi_hosthealthmonitor.h +/// +/// @brief Provide an interface for monitoring the health of the host. +/// +/// @bbref{bmqpi::HostHealthMonitor} is a pure interface for a monitor of the +/// health of the host. BlazingMQ sessions can use such objects to +/// conditionally suspend queue activity while the host is marked unhealthy. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_compressionalgorithmtype.h b/src/groups/bmq/bmqt/bmqt_compressionalgorithmtype.h index 0081c9eb59..1f7dfd6378 100644 --- a/src/groups/bmq/bmqt/bmqt_compressionalgorithmtype.h +++ b/src/groups/bmq/bmqt/bmqt_compressionalgorithmtype.h @@ -17,16 +17,15 @@ #ifndef INCLUDED_BMQT_COMPRESSIONALGORITHMTYPE #define INCLUDED_BMQT_COMPRESSIONALGORITHMTYPE -//@PURPOSE: Provide an enumeration for different compression algorithm types. -// -//@CLASSES: -// bmqt::CompressionAlgorithmType: Type of compression algorithm -// -//@DESCRIPTION: Provide an enumeration, 'bmqt::CompressionAlgorithmType' for -// different types of compression algorithm. -// -//: o !NONE!: No compression algorithm was specified -//: o !ZLIB!: The compression algorithm is ZLIB +/// @file bmqt_compressionalgorithmtype.h +/// +/// @brief Provide an enumeration for different compression algorithm types. +/// +/// Provide an enumeration, @bbref{bmqt::CompressionAlgorithmType} for +/// different types of compression algorithm. +/// +/// - *NONE*: No compression algorithm was specified +/// - *ZLIB*: The compression algorithm is ZLIB // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_correlationid.h b/src/groups/bmq/bmqt/bmqt_correlationid.h index 0485bc1f0e..0b9f510349 100644 --- a/src/groups/bmq/bmqt/bmqt_correlationid.h +++ b/src/groups/bmq/bmqt/bmqt_correlationid.h @@ -17,150 +17,159 @@ #ifndef INCLUDED_BMQT_CORRELATIONID #define INCLUDED_BMQT_CORRELATIONID -//@PURPOSE: Provide a value-semantic type usable as an efficient identifier. -// -//@CLASSES: -// bmqt::CorrelationId: correlation ID class. -// bmqt::CorrelationIdLess: comparison functor for 'CorrelationId' as map key -// bsl::hash: hash functor specialization -// -//@DESCRIPTION: This component implements a value-semantic class, -// 'bmqt::CorrelationId', which can be used to identify any async operations. -// The correlationId contains a value (64-bit integer, raw pointer or -// sharedPtr) supplied by the application or uses an auto-assigned value. The -// type and the value of the correlationId can be set at construction time and -// changed later via the 'setNumeric()', 'setPointer()' and 'setSharedPointer' -// methods. Alternatively, a 'CorrelationId::AutoValue' can be used to -// generate a unique correlationId from within the process. The -// 'bmqt::CorrelationIdLess' comparison functor can be used for storing -// 'CorrelationId' in a map as the key element; and a hash functor -// specialization is provided in the 'bsl::hash' namespace. -// -/// AutoValue -///--------- -// If the application doesn't care about the actual value of the correlation, -// AutoValue type can be used to create a unique correlationId. An AutoValue -// correlationId behaves exactly the same as any other type of correlation, -// with the exception that it's value can not be retrieved (but two -// correlationId can be still compared equal). -//.. -// bmqt::CorrelationId corrId = bmqt::CorrelationId::autoValue(); -//.. -// -/// Usage -///----- -// This section illustrates intended use of this component. -// -/// Example 1: Correlating Responses -/// - - - - - - - - - - - - - - - - -// Suppose that we have the following asynchronous messaging interface that we -// want to use to implement a basic request/response class. -//.. -// class Messenger { -// -// public: -// // TYPES -// typedef bsl::function< -// void(void *buffer, -// int bufferLength, -// const bmqt::CorrelationId& correlationId)> MessageHandler; -// // 'MessageHandler' is an alias for a functor that handles received -// // messages consisting of the specified 'buffer', having the -// // specified 'bufferLength', as well as the specified associated -// // 'correlationId' if the message is in response to a previously -// // transmitted message. -// -// // MANIPULATORS -// void sendMessage(void *buffer, -// int bufferLength, -// const bmqt::CorrelationId& correlationId); -// // Send a message containing the specified 'buffer' of the -// // specified 'bufferLength', associating the specified -// // 'correlationId' with any messages later received in response. -// -// void setMessageHandler(const MessageHandler& handler); -// // Set the functor to handle messages received by this object to -// // the specified 'handler'. -// }; -//.. -// First we declare a requester class. -//.. -// class Requester { -// -// // DATA -// Messenger *d_messenger_p; // used to send messages (held) -// bslma::Allocator *d_allocator_p; // memory supply (held) -// -// // PRIVATE CLASS METHODS -// static void handleMessage(void *buffer, -// int bufferLength, -// const bmqt::CorrelationId& correlationId); -// // Handle the response message consisting fo the specified 'buffer' -// // having the specified 'bufferLength', and associated -// // 'correlationId'. -// -// public: -// // TYPES -// typedef bsl::function -// ResponseCallback; -// // 'ResponseCallback' is an alias for a functor that is used to -// // process received responses consisting of the specified 'buffer' -// // having the specified 'bufferLength'. -// -// // CREATORS -// explicit Requester(Messenger *messenger, -// bslma::Allocator *basicAllocator); -// // Create a 'Requester' that uses the specified 'messenger' to send -// // requests and receive responses, and the specified -// // 'basicAllocator' to supply memory. -// -// // MANIPULATORS -// void sendRequest(void *buffer, -// int bufferLength, -// const ResponseCallback& callback); -// // Send a request consisting of the specified 'buffer' having the -// // specified 'bufferLength', and invoke the specified 'callback' -// // with any asynchronous response. -// }; -//.. -// Then, we implement the constructor, setting the message handler on the -// provided 'Messenger' to our class method. -//.. -// Requester::Requester(Messenger *messenger, -// bslma::Allocator *basicAllocator) -// : d_messenger_p(messenger) -// , d_allocator_p(basicAllocator) -// { -// d_messenger_p->setMessageHandler(&Requester::handleMessage); -// } -//.. -// Now, we implement 'sendRequest', copying the given 'callback' into a -// correlationId that is provided to the messenger. -//.. -// void Requester::sendRequest(void *buffer, -// int bufferLength, -// const ResponseCallback& callback) -// { -// bsl::shared_ptr callbackCopy; -// callbackCopy.createInplace(d_allocator_p, callback, d_allocator_p); -// bmqt::CorrelationId correlationId(bsl::shared_ptr(callbackCopy)); -// d_messenger_p->sendMessage(buffer, bufferLength, correlationId); -// } -//.. -// Finally, we implement our message handler, extracting the response callback -// from the correlationId, and invoking it with the received response message. -//.. -// void Requester::handleMessage(void *buffer, -// int bufferLength, -// const bmqt::CorrelationId& correlationId) -// { -// assert(correlationId.isSharedPtr()); -// ResponseCallback *callback = static_cast( -// correlationId.theSharedPtr().get()); -// (*callback)(buffer, bufferLength); -// } -//.. -// +/// @file bmqt_correlationid.h +/// +/// @brief Provide a value-semantic type usable as an efficient identifier. +/// +/// This component implements a value-semantic class, +/// @bbref{bmqt::CorrelationId}, which can be used to identify any async +/// operations. The correlationId contains a value (64-bit integer, raw +/// pointer or sharedPtr) supplied by the application or uses an auto-assigned +/// value. The type and the value of the correlationId can be set at +/// construction time and changed later via the `setNumeric()`, `setPointer()` +/// and `setSharedPointer()` methods. Alternatively, an `AutoValue` can be +/// used to generate a unique correlationId from within the process. The +/// @bbref{bmqt::CorrelationIdLess} comparison functor can be used for storing +/// @bbref{bmqt::CorrelationId} in a map as the key element; and a hash functor +/// specialization is provided in the `bsl::hash` namespace. +/// +/// AutoValue {#bmqt_correlationid_autovalue} +/// ========= +/// +/// If the application doesn't care about the actual value of the correlation, +/// `AutoValue` type can be used to create a unique correlationId. An +/// `AutoValue` correlationId behaves exactly the same as any other type of +/// correlation, with the exception that it's value can not be retrieved (but +/// two correlationId can be still compared equal). +/// +/// ``` +/// bmqt::CorrelationId corrId = bmqt::CorrelationId::autoValue(); +/// ``` +/// +/// Usage {#bmqt_correlationid_usage} +/// ===== +/// +/// This section illustrates intended use of this component. +/// +/// Example 1: Correlating Responses {#bmqt_correlationid_ex1} +/// -------------------------------- +/// +/// Suppose that we have the following asynchronous messaging interface that we +/// want to use to implement a basic request/response class. +/// +/// ``` +/// class Messenger { +/// +/// public: +/// // TYPES +/// typedef bsl::function< +/// void(void *buffer, +/// int bufferLength, +/// const bmqt::CorrelationId& correlationId)> MessageHandler; +/// // 'MessageHandler' is an alias for a functor that handles received +/// // messages consisting of the specified 'buffer', having the +/// // specified 'bufferLength', as well as the specified associated +/// // 'correlationId' if the message is in response to a previously +/// // transmitted message. +/// +/// // MANIPULATORS +/// void sendMessage(void *buffer, +/// int bufferLength, +/// const bmqt::CorrelationId& correlationId); +/// // Send a message containing the specified 'buffer' of the +/// // specified 'bufferLength', associating the specified +/// // 'correlationId' with any messages later received in response. +/// +/// void setMessageHandler(const MessageHandler& handler); +/// // Set the functor to handle messages received by this object to +/// // the specified 'handler'. +/// }; +/// ``` +/// +/// First we declare a requester class. +/// +/// ``` +/// class Requester { +/// +/// // DATA +/// Messenger *d_messenger_p; // used to send messages (held) +/// bslma::Allocator *d_allocator_p; // memory supply (held) +/// +/// // PRIVATE CLASS METHODS +/// static void handleMessage(void *buffer, +/// int bufferLength, +/// const bmqt::CorrelationId& correlationId); +/// // Handle the response message consisting fo the specified 'buffer' +/// // having the specified 'bufferLength', and associated +/// // 'correlationId'. +/// +/// public: +/// // TYPES +/// typedef bsl::function +/// ResponseCallback; +/// // 'ResponseCallback' is an alias for a functor that is used to +/// // process received responses consisting of the specified 'buffer' +/// // having the specified 'bufferLength'. +/// +/// // CREATORS +/// explicit Requester(Messenger *messenger, +/// bslma::Allocator *basicAllocator); +/// // Create a 'Requester' that uses the specified 'messenger' to send +/// // requests and receive responses, and the specified +/// // 'basicAllocator' to supply memory. +/// +/// // MANIPULATORS +/// void sendRequest(void *buffer, +/// int bufferLength, +/// const ResponseCallback& callback); +/// // Send a request consisting of the specified 'buffer' having the +/// // specified 'bufferLength', and invoke the specified 'callback' +/// // with any asynchronous response. +/// }; +/// ``` +/// +/// Then, we implement the constructor, setting the message handler on the +/// provided 'Messenger' to our class method. +/// +/// ``` +/// Requester::Requester(Messenger *messenger, +/// bslma::Allocator *basicAllocator) +/// : d_messenger_p(messenger) +/// , d_allocator_p(basicAllocator) +/// { +/// d_messenger_p->setMessageHandler(&Requester::handleMessage); +/// } +/// ``` +/// +/// Now, we implement `sendRequest`, copying the given `callback` into a +/// correlationId that is provided to the messenger. +/// +/// ``` +/// void Requester::sendRequest(void *buffer, +/// int bufferLength, +/// const ResponseCallback& callback) +/// { +/// bsl::shared_ptr callbackCopy; +/// callbackCopy.createInplace(d_allocator_p, callback, d_allocator_p); +/// bmqt::CorrelationId correlationId(bsl::shared_ptr(callbackCopy)); +/// d_messenger_p->sendMessage(buffer, bufferLength, correlationId); +/// } +/// ``` +/// +/// Finally, we implement our message handler, extracting the response callback +/// from the correlationId, and invoking it with the received response message. +/// +/// ``` +/// void Requester::handleMessage(void *buffer, +/// int bufferLength, +/// const bmqt::CorrelationId& correlationId) +/// { +/// assert(correlationId.isSharedPtr()); +/// ResponseCallback *callback = static_cast( +/// correlationId.theSharedPtr().get()); +/// (*callback)(buffer, bufferLength); +/// } +/// ``` // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_encodingtype.h b/src/groups/bmq/bmqt/bmqt_encodingtype.h index e78cf50818..251371bbfe 100644 --- a/src/groups/bmq/bmqt/bmqt_encodingtype.h +++ b/src/groups/bmq/bmqt/bmqt_encodingtype.h @@ -17,22 +17,21 @@ #ifndef INCLUDED_BMQT_ENCODINGTYPE #define INCLUDED_BMQT_ENCODINGTYPE -//@PURPOSE: Provide an enumeration for different message encoding types. -// -//@CLASSES: -// bmqt::EncodingType: Enumeration for different message encoding types. -// -//@DESCRIPTION: Provide an enumeration, 'bmqt::EncodingType' for different -// message encoding types. -// -//: o !UNDEFINED!: No encoding was specified -//: o !RAW!: The encoding is RAW, i.e., binary -//: o !BER!: Binary encoding using the BER codec -//: o !BDEX!: Binary encoding using the BDEX codec -//: o !XML!: Text encoding, using the XML format -//: o !JSON!: Text encoding, using the JSON format -//: o !TEXT!: Plain text encoding, using a custom user-specific format -//: o !MULTIPARTS!: Message is part of a multipart message +/// @file bmqt_encodingtype.h +/// +/// @brief Provide an enumeration for different message encoding types. +/// +/// Provide an enumeration, @bbref{bmqt::EncodingType} for different message +/// encoding types. +/// +/// - *UNDEFINED*: No encoding was specified +/// - *RAW*: The encoding is RAW, i.e., binary +/// - *BER*: Binary encoding using the BER codec +/// - *BDEX*: Binary encoding using the BDEX codec +/// - *XML*: Text encoding, using the XML format +/// - *JSON*: Text encoding, using the JSON format +/// - *TEXT*: Plain text encoding, using a custom user-specific format +/// - *MULTIPARTS*: Message is part of a multipart message // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_hosthealthstate.h b/src/groups/bmq/bmqt/bmqt_hosthealthstate.h index ceb9231955..e5a466616e 100644 --- a/src/groups/bmq/bmqt/bmqt_hosthealthstate.h +++ b/src/groups/bmq/bmqt/bmqt_hosthealthstate.h @@ -17,17 +17,16 @@ #ifndef INCLUDED_BMQT_HOSTHEALTHSTATE #define INCLUDED_BMQT_HOSTHEALTHSTATE -//@PURPOSE: Provide an enumeration for different host health states. -// -//@CLASSES: -// bmqt::HostHealthState: Enumeration for different host health states. -// -//@DESCRIPTION: Provide an enumeration, 'bmqt::HostHealthState' for different -// representations of the health of a host. -// -//: o !UNKNOWN!: Host health could not be ascertained -//: o !HEALTHY!: Host is considered to be healthy -//: o !UNHEALTHY!: Host is not considered to be healthy +/// @file bmqt_hosthealthstate.h +/// +/// @brief Provide an enumeration for different host health states. +/// +/// Provide an enumeration, @bbref{bmqt::HostHealthState} for different +/// representations of the health of a host. +/// +/// - *UNKNOWN*: Host health could not be ascertained +/// - *HEALTHY*: Host is considered to be healthy +/// - *UNHEALTHY*: Host is not considered to be healthy // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_messageeventtype.h b/src/groups/bmq/bmqt/bmqt_messageeventtype.h index 552d4982e3..631bf5c409 100644 --- a/src/groups/bmq/bmqt/bmqt_messageeventtype.h +++ b/src/groups/bmq/bmqt/bmqt_messageeventtype.h @@ -17,19 +17,17 @@ #ifndef INCLUDED_BMQT_MESSAGEEVENTTYPE #define INCLUDED_BMQT_MESSAGEEVENTTYPE -//@PURPOSE: Provide an enumeration for the different types of message events. -// -//@CLASSES: -// bmqt::MessageEventType: Enumeration for the types of message events. -// -//@DESCRIPTION: Provide an enumeration, 'bmqt::MessageEventType', for the -// different types of message events. -// -//: o !UNDEFINED!: Unknown message type -//: o !ACK!: Message is an ack -//: o !PUSH!: Message is a push -//: o !PUT!: Message is a put -// +/// @file bmqt_messageeventtype.h +/// +/// @brief Provide an enumeration for the different types of message events. +/// +/// Provide an enumeration, @bbref{bmqt::MessageEventType}, for the different +/// types of message events. +/// +/// - *UNDEFINED*: Unknown message type +/// - *ACK*: Message is an ack +/// - *PUSH*: Message is a push +/// - *PUT*: Message is a put // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_messageguid.h b/src/groups/bmq/bmqt/bmqt_messageguid.h index f04b0e6117..bf135d2b0d 100644 --- a/src/groups/bmq/bmqt/bmqt_messageguid.h +++ b/src/groups/bmq/bmqt/bmqt_messageguid.h @@ -17,57 +17,60 @@ #ifndef INCLUDED_BMQT_MESSAGEGUID #define INCLUDED_BMQT_MESSAGEGUID -//@PURPOSE: Provide a value-semantic global unique identifier for BlazingMQ -// messages. -// -//@CLASSES: -// bmqt::MessageGUID : Value-semantic global unique ID for BlazingMQ -// message -// bmqt::MessageGUIDLess : Binary function for comparing GUIDs. -// bmqt::MessageGUIDHashAlgo : Provide a hashing algorithm for Message GUID. -// -//@DESCRIPTION: 'bmqt::MessageGUID' provides a value-semantic global unique -// identifier for BlazingMQ messages. Each bmqa::Message delivered to -// BlazingMQ client from BlazingMQ broker contains a unique MessageGUID. The -// binary function 'bmqt::MessageGUIDLess' can be used for comparing GUIDs, and -// an optimized custom hash function is provided with -// 'bmqt::MessageGUIDHashAlgo'. -// -// -/// Externalization -///--------------- -// For convenience, this class provides 'toHex' method that can be used to -// externalize a 'bmqt::MessageGUID' instance. Applications can persist the -// resultant buffer (on filesystem, in database) to keep track of last -// processed message ID across task instantiations. 'fromHex' method can be -// used to convert a valid externalized buffer back to a message ID. -// -/// Efficient comparison and hash function -///-------------------------------------- -// This component also provides efficient comparison and hash functions for -// convenience, and thus, applications can use this component as a key in -// associative containers. -// -// -/// Example 1: Externalizing -/// - - - - - - - - - - - - -//.. -// // Below, 'msg' is a valid instance of 'bmqa::Message' obtained from an -// // instance of 'bmqa::Session': -// -// bmqt::MessageGUID g1 = msg.messageId(); -// -// char buffer[bmqt::MessageGUID::e_SIZE_HEX]; -// g1.toHex(buffer); -// -// BSLS_ASSERT(true == bmqt::MessageGUID::isValidHexRepresentation(buffer)); -// -// bmqt::MessageGUID g2; -// g2.fromHex(buffer); -// -// BSLS_ASSERT(g1 == g2); -//.. -// +/// @file bmqt_messageguid.h +/// +/// @brief Provide a value-semantic global unique identifier for BlazingMQ +/// messages. +/// +/// @bbref{bmqt::MessageGUID} provides a value-semantic global unique +/// identifier for BlazingMQ messages. Each @bbref{bmqa::Message} delivered to +/// BlazingMQ client from BlazingMQ broker contains a unique +/// @bbref{bmqt::MessageGUID}. The binary functor +/// @bbref{bmqt::MessageGUIDLess} can be used for comparing GUIDs, and an +/// optimized custom hash function is provided with +/// @bbref{bmqt::MessageGUIDHashAlgo}. +/// +/// +/// Externalization {#bmqt_messageguid_externalization} +/// =============== +/// +/// For convenience, this class provides `toHex` method that can be used to +/// externalize a @bbref{bmqt::MessageGUID} instance. Applications can persist +/// the resultant buffer (on filesystem, in database) to keep track of last +/// processed message ID across task instantiations. `fromHex` method can be +/// used to convert a valid externalized buffer back to a message ID. +/// +/// Efficient comparison and hash function {#bmqt_messageguid_efficient} +/// ====================================== +/// +/// This component also provides efficient comparison and hash functions for +/// convenience, and thus, applications can use this component as a key in +/// associative containers. +/// +/// Usage {#bmqt_messageguid_usage} +/// ===== +/// +/// This section illustrates intended use of this component. +/// +/// Example 1: Externalizing {#bmqt_messageguid_ex1} +/// ------------------------ +/// +/// ``` +/// // Below, 'msg' is a valid instance of 'bmqa::Message' obtained from an +/// // instance of 'bmqa::Session': +/// +/// bmqt::MessageGUID g1 = msg.messageId(); +/// +/// char buffer[bmqt::MessageGUID::e_SIZE_HEX]; +/// g1.toHex(buffer); +/// +/// BSLS_ASSERT(true == bmqt::MessageGUID::isValidHexRepresentation(buffer)); +/// +/// bmqt::MessageGUID g2; +/// g2.fromHex(buffer); +/// +/// BSLS_ASSERT(g1 == g2); +/// ``` // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_propertytype.h b/src/groups/bmq/bmqt/bmqt_propertytype.h index a1750d6ba2..a7fcf00b65 100644 --- a/src/groups/bmq/bmqt/bmqt_propertytype.h +++ b/src/groups/bmq/bmqt/bmqt_propertytype.h @@ -17,39 +17,30 @@ #ifndef INCLUDED_BMQT_PROPERTYTYPE #define INCLUDED_BMQT_PROPERTYTYPE -//@PURPOSE: Provide enum for the supported data types for a message property. -// -//@CLASSES: -// bmqt::PropertyType: Enum for supported data types for a message property. -// -//@DESCRIPTION: This component contains 'bmqt::PropertyType' which describes -// various data types that are supported for message properties. -// -/// Data Types and Size -///------------------- -// This section describes the size of each data type: -//.. -// -// +----------------------------------------------------+ -// | Data Type | Size (in bytes) | -// +====================================================+ -// | BOOL | 1 -// | CHAR | 1 | -// +----------------------------------------------------+ -// | SHORT | 2 | -// +----------------------------------------------------+ -// | INT | 4 | -// +----------------------------------------------------+ -// | INT64 | 8 | -// +----------------------------------------------------+ -// | STRING | variable | -// +----------------------------------------------------+ -// | BINARY | variable | -// +----------------------------------------------------+ -//.. -// -// Note that the difference between 'BINARY' and 'STRING' data types is that -// the former allows null ('\0') character while the later does not. +/// @file bmqt_propertytype.h +/// +/// @brief Provide enum for the supported data types for a message property. +/// +/// This component contains @bbref{bmqt::PropertyType} which describes various +/// data types that are supported for message properties. +/// +/// Data Types and Size {#bmqt_propertytype_types} +/// =================== +/// +/// This section describes the size of each data type: +/// +/// | Data Type | Size (in bytes) | +/// | ------------------------------ | ----------------- | +/// | BOOL | 1 | +/// | CHAR | 1 | +/// | SHORT | 2 | +/// | INT | 4 | +/// | INT64 | 8 | +/// | STRING | variable | +/// | BINARY | variable | +/// +/// Note that the difference between `BINARY` and `STRING` data types is that +/// the former allows null (`'\0'`) character while the later does not. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_queueflags.h b/src/groups/bmq/bmqt/bmqt_queueflags.h index fbf1d618f2..e69277177a 100644 --- a/src/groups/bmq/bmqt/bmqt_queueflags.h +++ b/src/groups/bmq/bmqt/bmqt_queueflags.h @@ -17,16 +17,14 @@ #ifndef INCLUDED_BMQT_QUEUEFLAGS #define INCLUDED_BMQT_QUEUEFLAGS -//@PURPOSE: Provide enumerators for flags to use at Queue open. -// -//@CLASSES: -// bmqt::QueueFlags: flags to use at Queue open -// bmqt::QueueFlagsUtil: utilities to manipulate queue flags bit-mask values -// -//@DESCRIPTION: This file contains an enum, 'bmqt::QueueFlags' of all the flags -// that can be used at Queue open. Each value of the enum correspond to a bit -// of a bit-mask integer. It also exposes a set of utilities, in the -// 'bmqt::QueueFlagsUtil' namespace to manipulate such bit-mask value. +/// @file bmqt_queueflags.h +/// +/// @brief Provide enumerators for flags to use at Queue open. +/// +/// This file contains an enum, @bbref{bmqt::QueueFlags} of all the flags that +/// can be used at Queue open. Each value of the enum correspond to a bit of a +/// bit-mask integer. It also exposes a set of utilities, in the +/// @bbref{bmqt::QueueFlagsUtil} namespace to manipulate such bit-mask value. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_queueoptions.h b/src/groups/bmq/bmqt/bmqt_queueoptions.h index 1e12dc35b9..99659cf5a7 100644 --- a/src/groups/bmq/bmqt/bmqt_queueoptions.h +++ b/src/groups/bmq/bmqt/bmqt_queueoptions.h @@ -17,30 +17,29 @@ #ifndef INCLUDED_BMQT_QUEUEOPTIONS #define INCLUDED_BMQT_QUEUEOPTIONS -//@PURPOSE: Provide a value-semantic type for options related to a queue. -// -//@CLASSES: -// bmqt::QueueOptions: options related to a queue. -// -//@DESCRIPTION: 'bmqt::QueueOptions' provides a value-semantic type, -// 'QueueOptions', which is used to specify parameters for a queue. -// -// -// The following parameters are supported: -//: o !maxUnconfirmedMessages!: -//: Maximum number of outstanding messages that can be sent by the broker -//: without being confirmed. -//: -//: o !maxUnconfirmedBytes!: -//: Maximum accumulated bytes of all outstanding messages that can be sent -//: by the broker without being confirmed. -//: -//: o !consumerPriority!: -//: Priority of a consumer with respect to delivery of messages. -//: -//: o !suspendsOnBadHostHealth!: -//: Sets whether the queue should suspend operation when the host machine -//: is unhealthy. +/// @file bmqt_queueoptions.h +/// +/// @brief Provide a value-semantic type for options related to a queue. +/// +/// @bbref{bmqt::QueueOptions} provides a value-semantic type, `QueueOptions`, +/// which is used to specify parameters for a queue. +/// +/// The following parameters are supported: +/// +/// - *maxUnconfirmedMessages*: +/// Maximum number of outstanding messages that can be sent by the broker +/// without being confirmed. +/// +/// - *maxUnconfirmedBytes*: +/// Maximum accumulated bytes of all outstanding messages that can be sent +/// by the broker without being confirmed. +/// +/// - *consumerPriority*: +/// Priority of a consumer with respect to delivery of messages. +/// +/// - *suspendsOnBadHostHealth*: +/// Sets whether the queue should suspend operation when the host machine +/// is unhealthy. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_resultcode.h b/src/groups/bmq/bmqt/bmqt_resultcode.h index ac36d14ca1..c26bacccca 100644 --- a/src/groups/bmq/bmqt/bmqt_resultcode.h +++ b/src/groups/bmq/bmqt/bmqt_resultcode.h @@ -17,37 +17,31 @@ #ifndef INCLUDED_BMQT_RESULTCODE #define INCLUDED_BMQT_RESULTCODE -//@PURPOSE: Provide enums for various publicly exposed result code. -// -//@CLASSES: -// bmqt::GenericResult: generic common result values -// bmqt::AckResult: result code status of an ack message -// bmqt::CloseQueueResult: result of a close queue operation -// bmqt::EventBuilderResult: result of eventBuilder pack operation -// bmqt::OpenQueueResult: result of an open queue operation -// bmqt::ConfigureQueueResult: result of a configure queue operation -// bmqt::PostResult: result of a post operation -// -//@DESCRIPTION: This file contains a list of Enums ('bmqt::GenericResult', -// 'bmqt::AckResult', 'bmqt::CloseQueueResult', 'bmqt::EventBuilderResult', -// 'bmqt::OpenQueueResult', 'bmqt::ConfigureQueueResult', and -// 'bmqt::PostResult') that are publicly exposed to Application (via bmqa), but -// whose value comes from the internal implementation (bmqimp). Having them -// defined in bmqt allows bmqa to return the enum returned by bmqimp with no -// transformation. -// -// All enums are using the convention that < 0 values are errors, while > 0 are -// warnings. -// -// The 'GenericStatus' enum contains values that are common for most or all of -// the other status enums, such as 'success', 'timeout', ... The values of its -// members can range from -99 to 99. -// -// Each other enum should duplicate any values from the 'GenericStatus' one -// that it intends to be able to represent (aliasing the values to the ones -// from the 'GenericStatus' enum) and extend with specialized values in the -// ']..., -99[' or ']99, ...[' ranges. -// +/// @file bmqt_resultcode.h +/// +/// @brief Provide enums for various publicly exposed result code. +/// +/// This file contains a list of Enums (@bbref{bmqt::GenericResult}, +/// @bbref{bmqt::AckResult}, @bbref{bmqt::CloseQueueResult}, +/// @bbref{bmqt::EventBuilderResult}, @bbref{bmqt::OpenQueueResult}, +/// @bbref{bmqt::ConfigureQueueResult}, and @bbref{bmqt::PostResult}) that are +/// publicly exposed to Application (via `bmqa`), but whose value comes from +/// the internal implementation (`bmqimp`). Having them defined in `bmqt` +/// allows `bmqa` to return the enum returned by `bmqimp` with no +/// transformation. +/// +/// All enums are using the convention that < 0 values are errors, while > 0 +/// are warnings. +/// +/// The @bbref{bmqt::GenericResult} enum contains values that are common for +/// most or all of the other status enums, such as `success`, `timeout`, ... +/// The values of its members can range from -99 to 99. +/// +/// Each other enum should duplicate any values from the +/// @bbref{bmqt::GenericResult} one that it intends to be able to represent +/// (aliasing the values to the ones from the @bbref{bmqt::GenericResult} enum) +/// and extend with specialized values in the `]..., -99[` or `]99, ...[` +/// ranges. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_sessioneventtype.h b/src/groups/bmq/bmqt/bmqt_sessioneventtype.h index 50a3e0ecf4..1171b803eb 100644 --- a/src/groups/bmq/bmqt/bmqt_sessioneventtype.h +++ b/src/groups/bmq/bmqt/bmqt_sessioneventtype.h @@ -17,81 +17,85 @@ #ifndef INCLUDED_BMQT_SESSIONEVENTTYPE #define INCLUDED_BMQT_SESSIONEVENTTYPE -//@PURPOSE: Provide an enumeration for the different types of session events. -// -//@CLASSES: -// bmqt::SessionEventType: Enumeration for the types of session events. -// -//@DESCRIPTION: 'bmqt::SessionEventType' is an enumeration for the different -// types of session events. -// -//: o !CONNECTED!: The connection with the broker is established, this event is -//: only fired once (if for any reason the connection gets lost and -//: automatically reconnected, this will emit a 'CONNECTION_RESTORED' event). -// -//: o !DISCONNECTED!: The connection with the broker is terminated (after the -//: user called stop on the session). This is the last event that will be -//: delivered. -// -//: o !CONNECTION_LOST!: The session was connected to the broker, but that -//: connection dropped. -// -//: o !RECONNECTED!: The connection to the broker has been re-established. -//: This event is followed by zero or more 'QUEUE_REOPEN_RESULT' events, and -//: one 'STATE_RESTORED' event. -// -//: o !STATE_RESTORED!: Session's state has been restored after connection -//: has been re-established with the broker. This event is preceded by one -//: 'RECONNECTED' event, and zero or more 'QUEUE_REOPEN_RESULT' events. -// -//: o !CONNECTION_TIMEOUT!: The connection to the broker has timedout. -// -//: o !QUEUE_OPEN_RESULT!: Indicates the result of an 'openQueue' operation. -// -//: o !QUEUE_REOPEN_RESULT!: Indicates the result of an 'openQueue' operation, -//: which happens when the connection to the broker has been restored and -//: queues previously opened have been automatically reopened. This event is -//: preceded by a 'RECONNECTED' event and followed by zero or more -//: 'QUEUE_REOPEN_RESULT' events, and one 'STATE_RESTORED' event. -// -//: o !QUEUE_CLOSE_RESULT!: Indicates the result of a 'closeQueue' operation -// -//: o !SLOWCONSUMER_NORMAL!: Notifies that the EventQueue is back to its low -//: watermark level. -// -//: o !SLOWCONSUMER_HIGHWATERMARK!: Notifies that events are accumulating in -//: the EventQueue, which has now reached it's high watermark level. -// -//: o !QUEUE_CONFIGURE_RESULT!: Indicates the result of a 'configureQueue' -//: operation. -// -//: o !HOST_UNHEALTHY!: Indicates the host has become unhealthy. Only issued if -// a 'bmqpi::HostHealthMonitor' has been installed to the session, via the -// 'bmqt::SessionOptions' object. -// -//: o !HOST_HEALTH_RESTORED!: Indicates the health of the host has restored, -// and all queues have resumed operation. Following a Host Health incident, -// this indicates that the application has resumed normal operation. -// -//: o !QUEUE_SUSPENDED!: Indicates that an open queue has suspended operation: -// * Consumers are configured to receive no more messages from broker -// (i.e., maxUnconfirmedMessages := 0, maxUnconfirmedBytes := 0, -// consumerPriority := INT_MIN). -// * Attempts to pack messages targeting queue will be rejected by -// 'bmqa::MessageEventBuilder::pack()'. Clients may still attempt to POST -// existing packed events. -// * Attempts by client to reconfigure queue will not take effect until the -// queue has resumed. -// -//: o !QUEUE_RESUMED!: Indicates that a suspended queue has resumed normal -// operation (i.e., effects of QUEUE_SUSPENDED state no longer apply). -// -//: o !ERROR!: Indicates a generic error. -// -//: o !TIMEOUT! Indicates that the specified operation has timed out. -// -//: o !CANCELED!: Indicates that the specified operation was canceled. -// +/// @file bmqt_sessioneventtype.h +/// +/// @brief Provide an enumeration for the different types of session events. +/// +/// @bbref{bmqt::SessionEventType} is an enumeration for the different types of +/// session events. +/// +/// - *CONNECTED*: The connection with the broker is established, this event +/// is only fired once (if for any reason the connection gets lost and +/// automatically reconnected, this will emit a `CONNECTION_RESTORED` +/// event). +/// +/// - *DISCONNECTED*: The connection with the broker is terminated (after the +/// user called stop on the session). This is the last event that will be +/// delivered. +/// +/// - *CONNECTION_LOST*: The session was connected to the broker, but that +/// connection dropped. +/// +/// - *RECONNECTED*: The connection to the broker has been re-established. +/// This event is followed by zero or more `QUEUE_REOPEN_RESULT` events, +/// and one `STATE_RESTORED` event. +/// +/// - *STATE_RESTORED*: Session's state has been restored after connection +/// has been re-established with the broker. This event is preceded by one +/// `RECONNECTED` event, and zero or more `QUEUE_REOPEN_RESULT` events. +/// +/// - *CONNECTION_TIMEOUT*: The connection to the broker has timedout. +/// +/// - *QUEUE_OPEN_RESULT*: Indicates the result of an `openQueue` operation. +/// +/// - *QUEUE_REOPEN_RESULT*: Indicates the result of an `openQueue` +/// operation, which happens when the connection to the broker has been +/// restored and queues previously opened have been automatically reopened. +/// This event is preceded by a `RECONNECTED` event and followed by zero or +/// more `QUEUE_REOPEN_RESULT` events, and one `STATE_RESTORED` event. +/// +/// - *QUEUE_CLOSE_RESULT*: Indicates the result of a `closeQueue` operation. +/// +/// - *SLOWCONSUMER_NORMAL*: Notifies that the `EventQueue` is back to its +/// low watermark level. +/// +/// - *SLOWCONSUMER_HIGHWATERMARK*: Notifies that events are accumulating in +/// the `EventQueue`, which has now reached it's high watermark level. +/// +/// - *QUEUE_CONFIGURE_RESULT*: Indicates the result of a `configureQueue` +/// operation. +/// +/// - *HOST_UNHEALTHY*: Indicates the host has become unhealthy. Only issued +/// if a @bbref{bmqpi::HostHealthMonitor} has been installed to the +/// session, via the @bbref{bmqt::SessionOptions} object. +/// +/// - *HOST_HEALTH_RESTORED*: Indicates the health of the host has restored, +/// and all queues have resumed operation. Following a Host Health +/// incident, this indicates that the application has resumed normal +/// operation. +/// +/// - *QUEUE_SUSPENDED*: Indicates that an open queue has suspended +/// operation: +/// +/// * Consumers are configured to receive no more messages from broker +/// (i.e., `maxUnconfirmedMessages` := 0, `maxUnconfirmedBytes` := 0, +/// `consumerPriority` := `INT_MIN`). +/// +/// * Attempts to pack messages targeting queue will be rejected by +/// @bbref{bmqa::MessageEventBuilder::packMessage}'. Clients may still +/// attempt to POST existing packed events. +/// +/// * Attempts by client to reconfigure queue will not take effect until +/// the queue has resumed. +/// +/// - *QUEUE_RESUMED*: Indicates that a suspended queue has resumed normal +/// operation (i.e., effects of `QUEUE_SUSPENDED` state no longer apply). +/// +/// - *ERROR*: Indicates a generic error. +/// +/// - *TIMEOUT* Indicates that the specified operation has timed out. +/// +/// - *CANCELED*: Indicates that the specified operation was canceled. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_sessionoptions.h b/src/groups/bmq/bmqt/bmqt_sessionoptions.h index 721d6ea793..74920761d0 100644 --- a/src/groups/bmq/bmqt/bmqt_sessionoptions.h +++ b/src/groups/bmq/bmqt/bmqt_sessionoptions.h @@ -17,105 +17,110 @@ #ifndef INCLUDED_BMQT_SESSIONOPTIONS #define INCLUDED_BMQT_SESSIONOPTIONS -//@PURPOSE: Provide a value-semantic type to configure session with the broker. -// -//@CLASSES: bmqt::SessionOptions: options to configure a session with a -// BlazingMQ broker. -// -//@DESCRIPTION: 'bmqt::SessionOptions' provides a value-semantic type, -// 'SessionOptions', which is used to specify session-level configuration -// parameters. -// -// Most applications should not need to change the parameters for creating a -// 'Session'; the default parameters are fine. -// -// The following parameters are supported: -//: o !brokerUri!: -//: Address of the broker to connect to. Default is to connect to the -//: broker on the local host on the default port (30114). The format is -//: 'tcp://:port'. Host can be: -//: o an explicit hostname or 'localhost' -//: o an ip, example 10.11.12.13 -//: o a DNS entry. In this case, the client will resolve the list of -//: addresses from that entry, and try to connect to one of them. -//: When the connection with the host goes down, it will automatically -//: immediately failover and reconnects to another entry from the -//: address list. -//: If the environment variable 'BMQ_BROKER_URI' is set, then instances of -//: 'bmqa::Session' will ignore the 'brokerUri' field from the provided -//: 'SessionOptions' and use the value from this environment variable -//: instead. -//: -//: o !processNameOverride!: -//: If not empty, use this value for the processName in the identity -//: message (useful for scripted language bindings). This field is used -//: in the broker's logs to more easily identify the client's process. -//: -//: o !numProcessingThreads!: -//: Number of threads to use for processing events. Default is 1. Note -//: that this setting has an effect only if providing a -//: 'SessionEventHandler' to the session. -//: -//: o !blobBufferSize!: -//: Size (in bytes) of the blob buffers to use. Default value is 4k. -//: -//: o !channelHighWatermark!: -//: Size (in bytes) to use for write cache high watermark on the -//: channel. Default value is 128MB. This value is set on the -//: 'writeCacheHiWatermark' of the 'btemt_ChannelPoolConfiguration' object -//: used by the session with the broker. Note that BlazingMQ reserves 4MB -//: of this value for control message, so the actual watermark for data -//: published is 'channelHighWatermark - 4MB'. -//: -//: o !statsDumpInterval!: -//: Interval (in seconds) at which to dump stats in the logs. Set to 0 to -//: disable recurring dump of stats (final stats are always dumped at end -//: of session). Default is 5min. The value must be a multiple of 30s, in -//: the range [0s - 60min]. -//: -//: o !connectTimeout!, -//: o !disconnetTimeout!, -//: o !openQueueTimeout!, -//: o !configureQueueTimeout!, -//: o !closeQueueTimeout!, -//: Default timeout to use for various operations. -//: -//: o !eventQueueLowWatermark!, -//: o !eventQueueHighWatermark!, -//: Parameters to configure the EventQueue notification watermarks -//: thresholds. The EventQueue is the buffer of all incoming events from -//: the broker (PUSH and ACK messages as well as session and queue -//: operations result) pending being processed by the application code. A -//: warning ('bmqt::SessionEventType::e_SLOWCONSUMER_HIGHWATERMARK') is -//: emitted when the buffer reaches the 'highWatermark' value, and a -//: notification ('bmqt::SessionEventType::e_SLOWCONSUMER_NORMAL') is -//: sent when the buffer is back to the 'lowWatermark'. The -//: 'highWatermark' typically would be reached in case of either a very -//: slow consumer, causing events to accumulate in the buffer, or a huge -//: burst of data. Setting the 'highWatermark' to a high value should be -//: done cautiously because it will potentially hide slowness of the -//: consumer because of the enqueuing of PUSH events for a consumer, ACK -//: events for a producer as well as all system events to the buffer -//: (meaning that the messages may have a huge latency). Note, it is also -//: recommended to have a reasonable distance between 'highWatermark' and -//: 'lowWatermark' values to avoid a constant back and forth toggling of -//: state resulting from push pop of events. -//: -//: o !hostHealthMonitor!: -//: Optional instance of a class derived from 'bmqpi::HostHealthMonitor', -//: responsible for notifying the 'Session' when the health of the host -//: machine has changed. A 'hostHealthMonitor' must be specified, in order -//: for queues opened through the session to suspend on unhealthy hosts. -//: -//: o !traceOptions!: -//: Provides the `bmqpi::DTContext` and `bmqpi::DTTracer` objects required -//: for integration with a Distributed Trace framework. If these objects -//: are provided, then the session will use them to create "spans" to -//: represent requests made to the BlazingMQ broker on behalf of -//: operations initiated by the client. This includes session-level -//: operations (e.g., Session-Start, Session-Stop) as well as queue-level -//: operations (e.g., Queue-Open, Queue-Configure, Queue-Close). -// +/// @file bmqt_sessionoptions.h +/// +/// @brief Provide a value-semantic type to configure session with the broker. +/// +/// +/// @bbref{bmqt::SessionOptions} provides a value-semantic type, +/// `SessionOptions`, which is used to specify session-level configuration +/// parameters. +/// +/// Most applications should not need to change the parameters for creating a +/// @bbref{bmqa::Session}; the default parameters are fine. +/// +/// The following parameters are supported: +/// +/// - *brokerUri*: +/// Address of the broker to connect to. Default is to connect to the +/// broker on the local host on the default port (30114). The format is +/// `tcp://:port`. Host can be: +/// +/// * an explicit hostname or `localhost`, +/// +/// * an IP, example 10.11.12.13, or +/// +/// * a DNS entry. In this case, the client will resolve the list of +/// addresses from that entry, and try to connect to one of them. When +/// the connection with the host goes down, it will automatically +/// immediately failover and reconnects to another entry from the +/// address list. +/// +/// If the environment variable `BMQ_BROKER_URI` is set, then instances of +/// @bbref{bmqa::Session} will ignore the `brokerUri` field from the +/// provided @bbref{bmqt::SessionOptions} and use the value from this +/// environment variable instead. +/// +/// - *processNameOverride*: +/// If not empty, use this value for the processName in the identity +/// message (useful for scripted language bindings). This field is used in +/// the broker's logs to more easily identify the client's process. +/// +/// - *numProcessingThreads*: +/// Number of threads to use for processing events. Default is 1. Note that +/// this setting has an effect only if providing a +/// @bbref{bmqa::SessionEventHandler} to the session. +/// +/// - *blobBufferSize*: +/// Size (in bytes) of the blob buffers to use. Default value is 4k. +/// +/// - *channelHighWatermark*: +/// Size (in bytes) to use for write cache high watermark on the +/// channel. Default value is 128MB. This value is set on the +/// `writeCacheHiWatermark` of the `btemt_ChannelPoolConfiguration` object +/// used by the session with the broker. Note that BlazingMQ reserves 4MB +/// of this value for control message, so the actual watermark for data +/// published is `channelHighWatermark - 4MB`. +/// +/// - *statsDumpInterval*: +/// Interval (in seconds) at which to dump stats in the logs. Set to 0 to +/// disable recurring dump of stats (final stats are always dumped at end +/// of session). Default is 5min. The value must be a multiple of 30s, in +/// the range [0s - 60min]. +/// +/// - *connectTimeout*, +/// *disconnectTimeout*, +/// *openQueueTimeout*, +/// *configureQueueTimeout*, +/// *closeQueueTimeout*: +/// Default timeout to use for various operations. +/// +/// - *eventQueueLowWatermark*, +/// *eventQueueHighWatermark*: +/// Parameters to configure the EventQueue notification watermarks +/// thresholds. The EventQueue is the buffer of all incoming events from +/// the broker (PUSH and ACK messages as well as session and queue +/// operations result) pending being processed by the application code. A +/// warning (@bbref{bmqt::SessionEventType::e_SLOWCONSUMER_HIGHWATERMARK}) +/// is emitted when the buffer reaches the `highWatermark` value, and a +/// notification (@bbref{bmqt::SessionEventType::e_SLOWCONSUMER_NORMAL}) is +/// sent when the buffer is back to the `lowWatermark`. The `highWatermark` +/// typically would be reached in case of either a very slow consumer, +/// causing events to accumulate in the buffer, or a huge burst of +/// data. Setting the `highWatermark` to a high value should be done +/// cautiously because it will potentially hide slowness of the consumer +/// because of the enqueuing of PUSH events for a consumer, ACK events for +/// a producer as well as all system events to the buffer (meaning that the +/// messages may have a huge latency). Note, it is also recommended to have +/// a reasonable distance between `highWatermark` and `lowWatermark` values +/// to avoid a constant back and forth toggling of state resulting from +/// push pop of events. +/// +/// - *hostHealthMonitor*: +/// Optional instance of a class derived from +/// @bbref{bmqpi::HostHealthMonitor}, responsible for notifying the +/// @bbref{bmqa::Session} when the health of the host machine has +/// changed. A `hostHealthMonitor` must be specified, in order for queues +/// opened through the session to suspend on unhealthy hosts. +/// +/// - *traceOptions*: +/// Provides the @bbref{bmqpi::DTContext} and @bbref{bmqpi::DTTracer} +/// objects required for integration with a Distributed Trace framework. If +/// these objects are provided, then the session will use them to create +/// "spans" to represent requests made to the BlazingMQ broker on behalf of +/// operations initiated by the client. This includes session-level +/// operations (e.g., Session-Start, Session-Stop) as well as queue-level +/// operations (e.g., Queue-Open, Queue-Configure, Queue-Close). // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_subscription.h b/src/groups/bmq/bmqt/bmqt_subscription.h index f2a36c3879..d1d4fa902f 100644 --- a/src/groups/bmq/bmqt/bmqt_subscription.h +++ b/src/groups/bmq/bmqt/bmqt_subscription.h @@ -17,18 +17,14 @@ #ifndef INCLUDED_BMQT_SUBSCRIPTION #define INCLUDED_BMQT_SUBSCRIPTION -//@PURPOSE: Provide a value-semantic types for subscription related API. -// -//@CLASSES: -// bmqt::SubscriptionHandle: uniquely identifies Subscription -// bmqt::SubscriptionExpression: Subscription criteria -// bmqt::Subscription: Subscription parameters -// -//@DESCRIPTION: 'bmqt::Subscription' provides a value-semantic type carried -// by 'bmqt::QueueOptions', when opening and configuring a queue. -// -//@NOTE: Experimental. Do not use until this feature is announced. -// +/// @file bmqt_subscription.h +/// +/// @brief Provide a value-semantic types for subscription related API. +/// +/// @bbref{bmqt::Subscription} provides a value-semantic type carried by +/// @bbref{bmqt::QueueOptions}, when opening and configuring a queue. +/// +/// @note Experimental. Do not use until this feature is announced. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_uri.h b/src/groups/bmq/bmqt/bmqt_uri.h index af24d461bc..7f51c631e5 100644 --- a/src/groups/bmq/bmqt/bmqt_uri.h +++ b/src/groups/bmq/bmqt/bmqt_uri.h @@ -17,106 +17,114 @@ #ifndef INCLUDED_BMQT_URI #define INCLUDED_BMQT_URI -//@PURPOSE: Provide value-semantic type and utilities for a BlazingMQ queue -// URI. -// -//@CLASSES: -// bmqt::Uri : value-semantic type representing a URI -// bmqt::UriParser : utility to parse a string into a URI -// bmqt::UriBuilder : builder mechanism to create a URI -// -//@DESCRIPTION: This component provides a value-semantic type, 'bmqt::Uri' -// representing a URI for a BlazingMQ queue. A 'bmqt:Uri' can be built by -// parsing from a string representation, using the 'bmqt::UriParser', or built -// using the 'bmqt::UriBuilder'. -// -//@SEE_ALSO: -//---------- -// https://tools.ietf.org/html/rfc3986 -// -/// URI format -///---------- -// In a nutshell, a URI representing an application queue managed by a -// BlazingMQ broker on a given machine looks like one of the following: -//.. -// bmq://ts.trades.myapp/my.queue -// bmq://ts.trades.myapp.~bt/my.queue -// bmq://ts.trades.myapp/my.queue?id=foo -//.. -// where: -// -//: o The URI scheme is always "bmq". -// -//: o The URI authority is the name of BlazingMQ domain (such as -// "ts.trades.myapp") -//: as registered with the BlazingMQ infrastructure. The domain name may -//: contain alphanumeric characters, dots and dashes (it has to match the -//: following regular expression: '[-a-zA-Z0-9\\._]+'). The domain may be -//: followed by an optional tier, introduced by the ".~" sequence and -//: consisting of alphanumeric characters and dashes. The ".~" sequence is -//: not part of the tier. -// -//: o The URI path is the name of the queue ("my.queue" above) and may contain -//: alphanumeric characters, dashes, underscores and tild (it has to match -//: the following regular expression: '[-a-zA-Z0-9_~\\.]+'). The queue name -//: must be less than 'bmqt::Uri::k_QUEUENAME_MAX_LENGTH' characters long. -// -//: o The name of the queue ("my.queue" above) may contain alphanumeric -//: characters and dots. -// -//: o The URI may contain an optional query with a key-value pair. Currently -//: supported keys are: -//: o !id!: the corresponding value represents a name that will be used by -//: BlazingMQ broker to uniquely identify the client. -// -//: o The URI fragment part is currently unused. -// -/// Usage Example 1 -///--------------- -// First, call the 'initialize' method of the 'UriParser'. This call is only -// needed one time; you can call it when your task starts. -// -// Note that the 'bmq' library takes care of that, so users of 'bmq' don't -// have to explicitly do it themselves. -//.. -// bmqt::UriParser::initialize(); -//.. -// Then, parse a URI string created on the stack to populate a 'Uri' object. -// The parse function takes an optional error string which is populated with a -// short error message if the URI is not formatted correctly. -//.. -// bsl::string input = "bmq://my.domain/queue"; -// bmqt::Uri uri(allocator); -// bsl::string errorDescription; -// -// int rc = bmqt::UriParser::parse(&uri, &errorDescription, input); -// if (rc != 0) { -// BALL_LOG_ERROR << "Invalid URI [error: " << errorDescription << "]"; -// } -// assert(rc == 0); -// assert(error == ""); -// assert(uri.scheme() == "bmq"); -// assert(uri.domain() == "my.domain"); -// assert(uri.queue() == "queue"); -//.. -// -/// Usage Example 2 -///---------------- -// Instantiate a 'Uri' object with a string representation of the URI and an -// allocator. -//.. -// bmqt::Uri uri("bmq://my.domain/queue", allocator); -// assert(uri.scheme() == "bmq"); -// assert(uri.domain() == "my.domain"); -// assert(uri.queue() == "queue"); -//.. - -/// Thread Safety -///------------- -//: o 'bmqt::UriBuilder' is NOT thread safe -//: o 'bmqt::UriParser' should be thread safe: the component depends on -//: 'bdepcre_regex' that is a wrapper around "pcre.h". See -//: http://www.pcre.org/pcre.txt. +/// @file bmqt_uri.h +/// +/// @brief Provide value-semantic type and utilities for a BlazingMQ queue URI. +/// +/// +/// This component provides a value-semantic type, @bbref{bmqt::Uri} +/// representing a URI for a BlazingMQ queue. A @bbref{bmqt::Uri} can be built +/// by parsing from a string representation, using the @bbref{bmqt::UriParser}, +/// or built using the @bbref{bmqt::UriBuilder}. +/// +/// @see https://tools.ietf.org/html/rfc3986 +/// +/// URI format {#bmqt_uri_format} +/// ========== +/// +/// In a nutshell, a URI representing an application queue managed by a +/// BlazingMQ broker on a given machine looks like one of the following: +/// +/// ``` +/// bmq://ts.trades.myapp/my.queue +/// bmq://ts.trades.myapp.~bt/my.queue +/// bmq://ts.trades.myapp/my.queue?id=foo +/// ``` +/// +/// where: +/// +/// - The URI scheme is always "bmq". +/// +/// - The URI authority is the name of BlazingMQ domain (such as +/// "ts.trades.myapp") as registered with the BlazingMQ infrastructure. +/// The domain name may contain alphanumeric characters, dots and dashes +/// (it has to match the following regular expression: +/// `[-a-zA-Z0-9\\._]+`). The domain may be followed by an optional tier, +/// introduced by the ".~" sequence and consisting of alphanumeric +/// characters and dashes. The ".~" sequence is not part of the tier. +/// +/// - The URI path is the name of the queue ("my.queue" above) and may +/// contain alphanumeric characters, dashes, underscores and tild (it has +/// to match the following regular expression: `[-a-zA-Z0-9_~\\.]+`). The +/// queue name must be less than @bbref{bmqt::Uri::k_QUEUENAME_MAX_LENGTH} +/// characters long. +/// +/// - The name of the queue ("my.queue" above) may contain alphanumeric +/// characters and dots. +/// +/// - The URI may contain an optional query with a key-value pair. Currently +/// supported keys are: +/// +/// * *id*: the corresponding value represents a name that will be used +/// by BlazingMQ broker to uniquely identify the client. +/// +/// - The URI fragment part is currently unused. +/// +/// Usage Example 1 {#bmqt_uri_ex1} +/// =============== +/// +/// First, call the `initialize` method of the @bbref{bmqt::UriParser}. This +/// call is only needed one time; you can call it when your task starts. +/// +/// Note that the `bmq` library takes care of that, so users of `bmq` don't +/// have to explicitly do it themselves. +/// +/// ``` +/// bmqt::UriParser::initialize(); +/// ``` +/// +/// Then, parse a URI string created on the stack to populate a +/// @bbref{bmqt::Uri} object. The parse function takes an optional error +/// string which is populated with a short error message if the URI is not +/// formatted correctly. +/// +/// ``` +/// bsl::string input = "bmq://my.domain/queue"; +/// bmqt::Uri uri(allocator); +/// bsl::string errorDescription; +/// +/// int rc = bmqt::UriParser::parse(&uri, &errorDescription, input); +/// if (rc != 0) { +/// BALL_LOG_ERROR << "Invalid URI [error: " << errorDescription << "]"; +/// } +/// assert(rc == 0); +/// assert(error == ""); +/// assert(uri.scheme() == "bmq"); +/// assert(uri.domain() == "my.domain"); +/// assert(uri.queue() == "queue"); +/// ``` +/// +/// Usage Example 2 {#bmqt_uri_ex2} +/// =============== +/// +/// Instantiate a @bbref{bmqt::Uri} object with a string representation of the +/// URI and an allocator. +/// +/// ``` +/// bmqt::Uri uri("bmq://my.domain/queue", allocator); +/// assert(uri.scheme() == "bmq"); +/// assert(uri.domain() == "my.domain"); +/// assert(uri.queue() == "queue"); +/// ``` +/// +/// Thread Safety {#bmqt_uri_thread} +/// ============= +/// +/// - @bbref{bmqt::UriBuilder} is NOT thread safe. +/// +/// - @bbref{bmqt::UriParser} should be thread safe: the component depends on +/// `bdepcre_regex` that is a wrapper around "pcre.h". See +/// http://www.pcre.org/pcre.txt. // BMQ diff --git a/src/groups/bmq/bmqt/bmqt_version.h b/src/groups/bmq/bmqt/bmqt_version.h index ceeab56145..e89644aaf1 100644 --- a/src/groups/bmq/bmqt/bmqt_version.h +++ b/src/groups/bmq/bmqt/bmqt_version.h @@ -17,30 +17,30 @@ #ifndef INCLUDED_BMQT_VERSION #define INCLUDED_BMQT_VERSION -//@PURPOSE: Provide a value-semantic type representing a version (major minor). -// -//@CLASSES: -// bmqt::Version: version with major and minor parts. -// -//@DESCRIPTION: This component implements a simple value-semantic type, -// 'bmqt::Version' representing the version of an object. It is used in -// particular to attach a version attribute to a 'bmqa::Message', so that a -// consuming application receiving a message knows the version of the schema -// that was used for publishing. -// -// A version is represented by two numbers: a major and a minor version. Both -// are positive integers within the range [0-255]. -// -/// Usage Example -///------------- -//.. -// bmqt::Version version(1, 3); -// BSLS_ASSERT(version.major() == 1); -// BSLS_ASSERT(version.minor() == 3); -// version.setMajor(2).setMinor(4); -// BSLS_ASSERT(version.major() == 2); -// BSLS_ASSERT(version.minor() == 4); -//.. +/// @file bmqt_version.h +/// +/// @brief Provide a value-semantic type representing a version (major minor). +/// +/// This component implements a simple value-semantic type, +/// @bbref{bmqt::Version} representing the version of an object. It is used in +/// particular to attach a version attribute to a @bbref{bmqa::Message}, so +/// that a consuming application receiving a message knows the version of the +/// schema that was used for publishing. +/// +/// A version is represented by two numbers: a major and a minor version. Both +/// are positive integers within the range [0-255]. +/// +/// Usage Example {#bmqt_version_ex1} +/// ============= +/// +/// ``` +/// bmqt::Version version(1, 3); +/// BSLS_ASSERT(version.major() == 1); +/// BSLS_ASSERT(version.minor() == 3); +/// version.setMajor(2).setMinor(4); +/// BSLS_ASSERT(version.major() == 2); +/// BSLS_ASSERT(version.minor() == 4); +/// ``` // BMQ From 54daf656d1caa96a77bcd95b24f47800d5638435 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Mon, 8 Apr 2024 18:13:29 -0400 Subject: [PATCH 14/21] docs: Document packages as directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just as a previous patch documents components using Doxygen’s file documentation support, this patch converts package-level documentation into Doxygen’s directory documentation. Signed-off-by: Patrick M. Niedzielski --- src/groups/bmq/bmqa/README.md | 29 ++--------------------------- src/groups/bmq/bmqpi/README.md | 19 +++---------------- src/groups/bmq/bmqt/README.md | 34 +++++----------------------------- 3 files changed, 10 insertions(+), 72 deletions(-) diff --git a/src/groups/bmq/bmqa/README.md b/src/groups/bmq/bmqa/README.md index 8c2093537c..5dfe3dfa78 100644 --- a/src/groups/bmq/bmqa/README.md +++ b/src/groups/bmq/bmqa/README.md @@ -1,31 +1,6 @@ -BMQA -==== -> The `BMQA` (BlazingMQ API) package provides applications a public API for the -> BlazingMQ SDK. +@dir bmqa +@brief The `BMQA` (BlazingMQ API) package provides applications a public API -Description ------------ The `bmqa` package provides the public API of the BlazingMQ SDK for applications to use. - -Component Synopsis ------------------- -Component | Provides ... --------------------------------|----------------------------------------------------------- -`bmqa_abstractsession` | a pure protocol for a BlazingMQ session. -`bmqa_closequeuestatus` | a value-semantic type for a close queue operation status. -`bmqa_configurequeuestatus` | a value-semantic type for a configure queue operation status. -`bmqa_confirmeventbuilder` | a builder for batching confirmation messages. -`bmqa_event` | a generic variant encompassing all types of events. -`bmqa_manualhosthealthmonitor` | a minimal implementation of `bmqpi::HostHealthMonitor`. -`bmqa_message` | the application with a message data object. -`bmqa_messageevent` | the application with data event notifications. -`bmqa_messageeventbuilder` | a builder for `MessageEvent` objects. -`bmqa_messageiterator` | a mechanism to iterate over the messages of a `MessageEvent`. -`bmqa_messageproperties` | a value-semantic type representing message properties. -`bmqa_mocksession` | a mock session, implementing `bmqa::AbstractSession`. -`bmqa_openqueuestatus` | a value-semantic type for an open queue operation status. -`bmqa_queueid` | a value-semantic efficient identifier for a queue. -`bmqa_session` | access to the BlazingMQ broker. -`bmqa_sessionevent` | a value-semantic type for system event session notifications. diff --git a/src/groups/bmq/bmqpi/README.md b/src/groups/bmq/bmqpi/README.md index df90d395e2..35ea63ab54 100644 --- a/src/groups/bmq/bmqpi/README.md +++ b/src/groups/bmq/bmqpi/README.md @@ -1,23 +1,10 @@ -BMQPI -===== -> The `BMQPI` (BlazingMQ Public Interfaces) package provides class interfaces -> intended to serve as extension points for the BlazingMQ SDK. +@dir bmqpi +@brief The `BMQPI` (BlazingMQ Public Interfaces) package provides class +interfaces intended to serve as extension points for the BlazingMQ SDK. -Description ------------ The `bmqpi` package provides pure abstract interfaces, which are intended for clients to extend in their own applications and libraries. These extension points facilitate integration with other aspects of a runtime environment (e.g. authentication, host health-checking), which may vary significantly from organization to organization. - - -Component Synopsis ------------------- -Component | Provides ... ---------------------------|-------------------------------------------------------------- -`bmqpi_dtcontext` | an interface for a context with a notion of a current span. -`bmqpi_dtspan` | an interface representing a span of a distributed trace. -`bmqpi_dttracer` | an interface that can create new `DTSpan` objects. -`bmqpi_hosthealthmonitor` | an interface for monitoring the health of the underlying host. diff --git a/src/groups/bmq/bmqt/README.md b/src/groups/bmq/bmqt/README.md index b93a585e9f..33ce546b27 100644 --- a/src/groups/bmq/bmqt/README.md +++ b/src/groups/bmq/bmqt/README.md @@ -1,31 +1,7 @@ -BMQT -==== -> The `BMQT` (BlazingMQ (vocabulary) Types) package provides value-semantic -> vocabulary types. +@dir bmqt +@brief The `BMQT` (BlazingMQ (vocabulary) Types) package provides +value-semantic vocabulary types. -Description ------------ -The 'bmqt' package provides low level value-semantic vocabulary types for use by -the BlazingMQ SDK. - - -Component Synopsis ------------------- -Component | Provides ... ---------------------------------|----------------------------------------------------------- -`bmqt_compressionalgorithmtype` | an enumeration for different compression algorithm types. -`bmqt_correlationid` | a value-semantic type usable as an efficient identifier. -`bmqt_encodingtype` | an enumeration for different message encoding types. -`bmqt_hosthealthstate` | an enumeration for different host health states. -`bmqt_messageeventtype` | an enumeration for the different types of message events. -`bmqt_messageguid` | a value-semantic global unique identifier for BlazingMQ messages. -`bmqt_propertytype` | an enum for the supported data types for a message property. -`bmqt_queueflags` | enums for flags to use at Queue open. -`bmqt_queueoptions` | a value-semantic type for options related to a queue. -`bmqt_resultcode` | enums for various publicly exposed result code. -`bmqt_sessioneventtype` | an enumeration for the different types of session events. -`bmqt_sessionoptions` | a value-semantic type to configure session with the broker. -`bmqt_subscription` | a value-semantic types for subscription related API. -`bmqt_uri` | value-semantic type and utilities for a BlazingMQ queue URI. -`bmqt_version` | a value-semantic type representing a version (major minor). +The ‘bmqt‘ package provides low level value-semantic vocabulary types for use +by the BlazingMQ SDK. From b43ad18473a51258a4ee537cd208100e3406f332 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Mon, 8 Apr 2024 18:19:12 -0400 Subject: [PATCH 15/21] =?UTF-8?q?docs:=20Expand=20macros=20that=20confuse?= =?UTF-8?q?=20Doxygen=E2=80=99s=20parser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our Doxygen is not configured to search through BDE’s header files for macros to expand, so they are passed, unexpanded, on to Doxygen’s parser. In certain cases, this confuses the parser: for instance, the lack of a semicolon after `BSLMF_NESTED_TRAIT_DECLARATION(..)‘ uses results in an apparent syntax error, which causes Doxygen to build our documentation with warnings. Other BDE macros that are meant to enable C++11 and later features to be used only when available, like `BSLS_KEYWORD_FINAL`, are also unexpanded, and result in Doxygen failing to properly document symbols to which they are attached. This patch teaches Doxygen to ignore or properly expand the above two macros, removing several warnings from our documentation builds. There may be more macros that need to be added, but these are the only ones for which Doxygen issued warnings. Signed-off-by: Patrick M. Niedzielski --- Doxyfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index f53d0365e2..0e1bfb62fc 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2107,7 +2107,8 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = BSLS_KEYWORD_FINAL=final \ + BSLMF_NESTED_TRAIT_DECLARATION(..)= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The From 057e31cbe5640b464d7ca02a8278c772c25d6e32 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Mon, 8 Apr 2024 18:28:25 -0400 Subject: [PATCH 16/21] docs: Update Doxyfile Several Doxygen configuration elements that we do not use have been deprecated or removed from later versions of Doxygen. When building with these versions, Doxygen would warn of their presence. This patch runs `doxygen -u` on our `Doxyfile`, updating it to remove these deprecated or removed configurations. Signed-off-by: Patrick M. Niedzielski --- Doxyfile | 868 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 574 insertions(+), 294 deletions(-) diff --git a/Doxyfile b/Doxyfile index 0e1bfb62fc..81ab071337 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.15 +# Doxyfile 1.9.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,6 +12,16 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options @@ -32,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "libbmq" +PROJECT_NAME = libbmq # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -60,16 +70,28 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = docs/docs/apidocs -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,26 +103,18 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English -# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. - -OUTPUT_TEXT_DIRECTION = None - # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -197,6 +211,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -217,6 +241,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -240,26 +272,18 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. -# When you need a literal { or } or , in the value part of an alias you have to -# escape them by means of a backslash (\), this can lead to conflicts with the -# commands \{ and \} for these it is advised to use the version @{ and @} or use -# a double escape (\\{ and \\}) - -ALIASES = - -ALIASES += bbref{1}="@ref BloombergLP::\1 \"\1\"" +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = +ALIASES = "bbref{1}=@ref BloombergLP::\1 \"\1\"" # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -301,19 +325,22 @@ OPTIMIZE_OUTPUT_SLICE = NO # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, -# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is -# Fortran), use: inc=Fortran f=C. +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = @@ -331,11 +358,22 @@ MARKDOWN_SUPPORT = YES # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. +# Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -447,6 +485,27 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -467,6 +526,12 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -504,6 +569,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -515,14 +587,15 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -541,12 +614,20 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. CASE_SENSE_NAMES = YES @@ -564,6 +645,12 @@ HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -721,7 +808,8 @@ FILE_VERSION_FILTER = # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -767,24 +855,50 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. If -# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. # The default value is: NO. WARN_AS_ERROR = NO @@ -795,13 +909,27 @@ WARN_AS_ERROR = NO # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard -# error (stderr). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = @@ -823,12 +951,23 @@ INPUT = src/groups/bmq/bmqa \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. @@ -837,11 +976,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, +# *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, *.php, +# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be +# provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cpp \ @@ -877,16 +1020,14 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = *.t.cpp *.cpp +EXCLUDE_PATTERNS = *.t.cpp \ + *.cpp # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* +# ANamespace::AClass, ANamespace::*Test EXCLUDE_SYMBOLS = @@ -931,6 +1072,11 @@ IMAGE_PATH = docs/assets/images # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. @@ -972,6 +1118,15 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = ./README.md +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- @@ -1069,17 +1224,11 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = NO -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = @@ -1158,7 +1307,12 @@ HTML_STYLESHEET = # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -1173,9 +1327,22 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see +# this color. Hue is specified as an angle on a color-wheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. @@ -1185,7 +1352,7 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1203,20 +1370,11 @@ HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that -# are dynamically created via Javascript. If disabled, the navigation index will +# are dynamically created via JavaScript. If disabled, the navigation index will # consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have Javascript, +# page. Disable this option to support browsers that do not have JavaScript, # like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1231,6 +1389,13 @@ HTML_DYNAMIC_MENUS = YES HTML_DYNAMIC_SECTIONS = NO +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to @@ -1246,10 +1411,11 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/xcode/), introduced with OSX -# 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. @@ -1266,6 +1432,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. @@ -1291,8 +1464,12 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1322,7 +1499,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1349,6 +1526,16 @@ BINARY_TOC = NO TOC_EXPAND = NO +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help @@ -1367,7 +1554,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1375,8 +1563,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1384,30 +1572,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1450,16 +1638,28 @@ DISABLE_INDEX = NO # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = YES +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # @@ -1484,6 +1684,24 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1493,19 +1711,14 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. -FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1515,11 +1728,29 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1532,22 +1763,29 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1575,7 +1813,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1594,7 +1832,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1607,8 +1846,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1679,10 +1919,11 @@ LATEX_CMD_NAME = MAKEINDEX_CMD_NAME = makeindex # The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to -# generate index for LaTeX. +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. # Note: This tag is used in the generated output file (.tex). # See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. -# The default value is: \makeindex. +# The default value is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_MAKEINDEX_CMD = \makeindex @@ -1716,29 +1957,31 @@ PAPER_TYPE = a4 EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1771,18 +2014,26 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. USE_PDFLATEX = YES -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error. +# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch +# mode nothing is printed on the terminal, errors are scrolled as if is +# hit at every error; missing files that TeX tries to input or request from +# keyboard input (\read on a not open input stream) cause the job to abort, +# NON_STOP In nonstop mode the diagnostic message will appear on the terminal, +# but there is no possibility of user interaction just like in batch mode, +# SCROLL In scroll mode, TeX will stop only for missing files to input or if +# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at +# each error, asking for user intervention. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1795,16 +2046,6 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # https://en.wikipedia.org/wiki/BibTeX and \cite for more info. @@ -1813,14 +2054,6 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_TIMESTAMP = NO - # The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) # path from which the emoji images will be read. If a relative path is entered, # it will be relative to the LATEX_OUTPUT directory. If left blank the @@ -1885,16 +2118,6 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -1991,27 +2214,44 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures # the structure of the code including all documentation. Note that this feature # is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + +# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3 +# database with symbols found by doxygen stored in tables. +# The default value is: NO. + +GENERATE_SQLITE3 = NO + +# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be +# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put +# in front of it. +# The default directory is: sqlite3. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_OUTPUT = sqlite3 + +# The SQLITE3_OVERWRITE_DB tag is set to YES, the existing doxygen_sqlite3.db +# database file will be recreated with each doxygen run. If set to NO, doxygen +# will warn if an a database file is already found and not modify it. +# The default value is: YES. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_RECREATE_DB = YES + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2086,7 +2326,8 @@ SEARCH_INCLUDES = NO # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = @@ -2157,15 +2398,15 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. +# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces +# will be listed in the class and namespace index. If set to NO, only the +# inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be +# in the topic index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. @@ -2178,41 +2419,10 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2221,7 +2431,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2238,49 +2448,73 @@ HAVE_DOT = NO DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see Node, +# Edge and Graph Attributes specification You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" + +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about +# arrows shapes. +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification +# The default value is: shape=box,height=0.2,width=0.4. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will +# generate a graph for each documented class showing the direct and indirect +# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and +# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case +# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the +# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used. +# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance +# relations will be shown as texts / links. +# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. +# class with other documented classes. Explicit enabling a collaboration graph, +# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the +# command \collaborationgraph. Disabling a collaboration graph can be +# accomplished by means of the command \hidecollaborationgraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. Explicit enabling a group +# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means +# of the command \groupgraph. Disabling a directory graph can be accomplished by +# means of the command \hidegroupgraph. See also the chapter Grouping in the +# manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2303,10 +2537,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2318,7 +2574,9 @@ TEMPLATE_RELATIONS = YES # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO, +# can be accomplished by means of the command \includegraph. Disabling an +# include graph can be accomplished by means of the command \hideincludegraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2327,7 +2585,10 @@ INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set +# to NO, can be accomplished by means of the command \includedbygraph. Disabling +# an included by graph can be accomplished by means of the command +# \hideincludedbygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2367,16 +2628,26 @@ GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the -# files in the directories. +# files in the directories. Explicit enabling a directory graph, when +# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command +# \directorygraph. Disabling a directory graph can be accomplished by means of +# the command \hidedirectorygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). @@ -2413,11 +2684,12 @@ DOT_PATH = DOTFILE_DIRS = -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. -MSCFILE_DIRS = +DIA_PATH = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile @@ -2426,10 +2698,10 @@ MSCFILE_DIRS = DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. PLANTUML_JAR_PATH = @@ -2467,18 +2739,6 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support @@ -2491,14 +2751,34 @@ DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will +# use a built-in version of mscgen tool to produce the charts. Alternatively, +# the MSCGEN_TOOL tag can also specify the name an external tool. For instance, +# specifying prog as the value, doxygen will call the tool as prog -T +# -o . The external tool should support +# output file formats "png", "eps", "svg", and "ismap". + +MSCGEN_TOOL = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = From f59437e83fb07ef11d3220beef3024b0525abf9c Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Tue, 16 Apr 2024 17:36:22 -0400 Subject: [PATCH 17/21] docs: Mark `Impl` types in `bmqa` as internal In our existing published documentation, generated by `bdedox` from the old component-level documentation comments, documentation for `Impl` types is excluded. After conversion, these types have Doxygen-style documentation comments, and as such are picked up by Doxygen when we build documentation now. This patch marks all such types explicitly as `@private`, so we do not generate their documentation by default. This does give us the option of generating internal builds of the documentation which include these types, if we ever need such builds. Signed-off-by: Patrick M. Niedzielski --- src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h | 1 + src/groups/bmq/bmqa/bmqa_message.h | 1 + src/groups/bmq/bmqa/bmqa_messageeventbuilder.h | 1 + src/groups/bmq/bmqa/bmqa_messageiterator.h | 1 + src/groups/bmq/bmqa/bmqa_session.h | 1 + 5 files changed, 5 insertions(+) diff --git a/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h b/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h index ca2f14db82..bc03af900d 100644 --- a/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h +++ b/src/groups/bmq/bmqa/bmqa_confirmeventbuilder.h @@ -121,6 +121,7 @@ namespace bmqa { // struct ConfirmEventBuilderImpl // ============================== +/// @private /// Component-private class. Do not use. struct ConfirmEventBuilderImpl { // CONSTANTS diff --git a/src/groups/bmq/bmqa/bmqa_message.h b/src/groups/bmq/bmqa/bmqa_message.h index e208352c0c..c487181324 100644 --- a/src/groups/bmq/bmqa/bmqa_message.h +++ b/src/groups/bmq/bmqa/bmqa_message.h @@ -90,6 +90,7 @@ class MessageProperties; // struct MessageImpl // ================== +/// @private /// Struct containing the internal (private) members of Message (That is so /// that we can access private members of Message to initialize it, without /// having to expose them publicly). diff --git a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h index 1fc2a56ecf..2c5208506c 100644 --- a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h +++ b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.h @@ -277,6 +277,7 @@ namespace bmqa { // struct MessageEventBuilderImpl // ============================== +/// @private /// Struct containing the internal (private) members of MessageEventBuilder /// (That is so that bmqa::Session::loadMessageEventBuilder can access /// private members of MessageEventBuilder to initialize it, without having diff --git a/src/groups/bmq/bmqa/bmqa_messageiterator.h b/src/groups/bmq/bmqa/bmqa_messageiterator.h index 98e06e959e..111322601a 100644 --- a/src/groups/bmq/bmqa/bmqa_messageiterator.h +++ b/src/groups/bmq/bmqa/bmqa_messageiterator.h @@ -58,6 +58,7 @@ namespace bmqa { // struct MessageIteratorImpl // ========================== +/// @private /// Struct to hold the impl of the `MessageIterator`; that is so that we can /// keep the real impl private and use some special cast to manipulate it, /// without publicly exposing private members. diff --git a/src/groups/bmq/bmqa/bmqa_session.h b/src/groups/bmq/bmqa/bmqa_session.h index 745f5f002e..604edeec5c 100644 --- a/src/groups/bmq/bmqa/bmqa_session.h +++ b/src/groups/bmq/bmqa/bmqa_session.h @@ -630,6 +630,7 @@ class SessionEventHandler { // struct SessionImpl // ================== +/// @private /// Impl structure for the session data members, so that special task such /// as `bmqadm` can access them by reinterpret casting a `Session` object. /// Care should be taken though since `Session` is a polymorphic class. From 9b033c2c3d0552a142046f44d26740a10fad8d07 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Tue, 16 Apr 2024 17:56:04 -0400 Subject: [PATCH 18/21] docs: Exclude internal namespaces In several places in our SDK, we need to forward declare a symbol from one of the implementation packages (e.g., `bmqimp`). These packages do not form part of the public API of `libbmq`, and we do not want to include them in the documentation. Unfortunately, it looks like the best way to do this is to manually and explicitly exclude the namespaces for these symbols in the `Doxyfile`. This patch excludes the namespaces of components outside of `bmqa`, `bmqpi`, and `bmqt` that we need to forward-declare, including private `libbmq` packages and BDE packages. Signed-off-by: Patrick M. Niedzielski --- Doxyfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 81ab071337..f63649e2e8 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1029,7 +1029,9 @@ EXCLUDE_PATTERNS = *.t.cpp \ # wildcard * is used, a substring. Examples: ANamespace, AClass, # ANamespace::AClass, ANamespace::*Test -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = BloombergLP::bmqimp \ + BloombergLP::bmqp \ + BloombergLP::bslmt # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include From c564ff15aec473bfcdc9b6e65046c756be937e05 Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Wed, 17 Apr 2024 18:14:19 +0300 Subject: [PATCH 19/21] CI: reduce cache size (#241) Signed-off-by: Evgeny Malygin --- .github/workflows/build.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b4472d9abe..82e6b90624 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,6 +52,15 @@ jobs: -DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \ -DCMAKE_INSTALL_LIBDIR=lib64 cmake --build build/blazingmq --parallel 8 --target all all.t + - name: Run C++ Unit Tests + run: | + cd ${{ github.workspace }}/build/blazingmq + ctest -E mwcsys_executil.t --output-on-failure + - name: Clean-up build directories before caching + run: | + find . -name "*.o" -type f -delete + find . -name "*.a" -type f -delete + find . -name "*.t.tsk" -type f -delete - uses: actions/cache@v4 with: path: | @@ -82,10 +91,6 @@ jobs: src/python/bin/schemagen src/python/bin/tweakgen pytest src/python - - name: Run C++ Unit Tests - run: | - cd ${{ github.workspace }}/build/blazingmq - ctest -E mwcsys_executil.t --output-on-failure integration_tests_ubuntu: name: BlazingMQ integration tests From 9f97478ad05bf0f05399d639642dae0094f29ada Mon Sep 17 00:00:00 2001 From: Yuan Jing Vincent Yan Date: Wed, 17 Apr 2024 17:03:35 -0400 Subject: [PATCH 20/21] mqbblp::Routers::AppContext: Fix function documentation Signed-off-by: Yuan Jing Vincent Yan --- src/groups/mqb/mqbblp/mqbblp_routers.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/groups/mqb/mqbblp/mqbblp_routers.h b/src/groups/mqb/mqbblp/mqbblp_routers.h index d29c8043e0..a7d814294f 100644 --- a/src/groups/mqb/mqbblp/mqbblp_routers.h +++ b/src/groups/mqb/mqbblp/mqbblp_routers.h @@ -758,8 +758,10 @@ class Routers { void apply(); // ACCESSORS + + /// Load into the specified 'out', internal details about this object. void loadInternals(mqbcmd::RoundRobinRouter* out) const; - // Load into the specified 'out', internal details about this object. + void generate(bmqp_ctrlmsg::StreamParameters* streamParameters) const; bool hasHandle(mqbi::QueueHandle* handle) const; From 397bdc895f52a8725fb4f6aaf9c9ce263d3e605e Mon Sep 17 00:00:00 2001 From: Anton Pryakhin <102428376+waldgange@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:40:59 +0300 Subject: [PATCH 21/21] Fix bmqstoragetool-related enterprise CI fails (#253) Signed-off-by: Anton Pryakhin Co-authored-by: Evgeny Malygin --- .../m_bmqstoragetool_commandprocessorfactory.t.cpp | 3 +-- .../m_bmqstoragetool_journalfileprocessor.t.cpp | 9 +++------ .../m_bmqstoragetool_searchresultfactory.t.cpp | 3 +-- .../bmqstoragetool/m_bmqstoragetool_testutils.h | 6 ++++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp index bd40125086..093b1c14e4 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp @@ -56,8 +56,7 @@ static void test1_breathingTest() fileManager, bsl::cout, s_allocator_p); - ASSERT_NE(dynamic_cast(cmdProcessor.get()), - bsl::nullptr_t()); + ASSERT(dynamic_cast(cmdProcessor.get()) != 0); } // ============================================================================ diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp index fd342917f3..c2103da262 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp @@ -515,9 +515,8 @@ static void test8_searchMessagesByQueueKeyTest() queueKey2); // Configure parameters to search messages by queueKey1 - Parameters params(s_allocator_p); - bsl::vector queueKeys(1, queueKey1, s_allocator_p); - params.d_queueKey = bsl::move(queueKeys); + Parameters params(s_allocator_p); + params.d_queueKey.push_back(queueKey1); // Prepare file manager bslma::ManagedPtr fileManager( new (*s_allocator_p) FileManagerMock(journalFile, s_allocator_p), @@ -652,9 +651,7 @@ static void test10_searchMessagesByQueueNameAndQueueKeyTest() Parameters params(s_allocator_p); params.d_queueName.push_back("queue1"); params.d_queueMap.insert(queueInfo); - - bsl::vector queueKeys(1, queueKey2, s_allocator_p); - params.d_queueKey = bsl::move(queueKeys); + params.d_queueKey.push_back(queueKey2); // Prepare file manager bslma::ManagedPtr fileManager( diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp index a3da0c4d06..3931e0184a 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp @@ -56,8 +56,7 @@ static void test1_breathingTest() fileManager, bsl::cout, s_allocator_p); - ASSERT_NE(dynamic_cast(searchResult.get()), - bsl::nullptr_t()); + ASSERT(dynamic_cast(searchResult.get()) != 0); } // ============================================================================ diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_testutils.h b/src/applications/bmqstoragetool/m_bmqstoragetool_testutils.h index 89e9ba1626..6f99f301fa 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_testutils.h +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_testutils.h @@ -226,6 +226,8 @@ class FileManagerMock : public FileManager { mqbs::JournalFileIterator d_journalFileIt; // Journal file iterator. + mqbs::DataFileIterator d_dataFileIt; + // Data file iterator. public: // CREATORS @@ -234,7 +236,7 @@ class FileManagerMock : public FileManager { explicit FileManagerMock(bslma::Allocator* allocator = 0) { EXPECT_CALL(*this, dataFileIterator()) - .WillRepeatedly(Return(bsl::nullptr_t())); + .WillRepeatedly(Return(&d_dataFileIt)); } /// Constructor using the specified `journalFile` and `allocator`. @@ -245,7 +247,7 @@ class FileManagerMock : public FileManager { false) { EXPECT_CALL(*this, dataFileIterator()) - .WillRepeatedly(Return(bsl::nullptr_t())); + .WillRepeatedly(Return(&d_dataFileIt)); } // MANIPULATORS