diff --git a/src/groups/bmq/bmqa/bmqa_message.t.cpp b/src/groups/bmq/bmqa/bmqa_message.t.cpp index f389e4513..fbaf82bff 100644 --- a/src/groups/bmq/bmqa/bmqa_message.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_message.t.cpp @@ -166,7 +166,7 @@ static void test2_validPushMessagePrint() bdlbb::PooledBlobBufferFactory bufferFactory( 4 * 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -192,7 +192,7 @@ static void test2_validPushMessagePrint() bsl::strlen(buffer)); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); @@ -256,7 +256,7 @@ static void test3_messageProperties() bdlbb::PooledBlobBufferFactory bufferFactory( 4 * 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -290,7 +290,7 @@ static void test3_messageProperties() bdlbb::BlobUtil::append(&payload, buffer, bsl::strlen(buffer)); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); // Add SubQueueInfo option @@ -432,7 +432,7 @@ static void test4_subscriptionHandle() bdlbb::PooledBlobBufferFactory bufferFactory( 4 * 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -459,7 +459,7 @@ static void test4_subscriptionHandle() bmqtst::TestHelperUtil::allocator()); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(0, peb.messageCount()); @@ -525,7 +525,7 @@ static void test4_subscriptionHandle() bmqtst::TestHelperUtil::allocator()); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(0, peb.messageCount()); @@ -573,7 +573,7 @@ static void test4_subscriptionHandle() bmqtst::TestHelperUtil::allocator()); // Create PutEventBuilder - bmqp::PutEventBuilder builder(&blobSpPool, + bmqp::PutEventBuilder builder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(0, builder.messageCount()); @@ -614,7 +614,7 @@ static void test4_subscriptionHandle() bmqtst::TestHelperUtil::allocator()); // Create AckEventBuilder - bmqp::AckEventBuilder builder(&blobSpPool, + bmqp::AckEventBuilder builder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(0, builder.messageCount()); diff --git a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp index 17dd6834c..ca3c1563f 100644 --- a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp @@ -167,11 +167,11 @@ static void test2_ackMesageIteratorTest() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::AckEventBuilder builder(&blobSpPool, + bmqp::AckEventBuilder builder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -234,11 +234,11 @@ static void test3_putMessageIteratorTest() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder builder(&blobSpPool, + bmqp::PutEventBuilder builder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqa/bmqa_mocksession.cpp b/src/groups/bmq/bmqa/bmqa_mocksession.cpp index 5433ec239..1c4496682 100644 --- a/src/groups/bmq/bmqa/bmqa_mocksession.cpp +++ b/src/groups/bmq/bmqa/bmqa_mocksession.cpp @@ -292,10 +292,10 @@ Event MockSessionUtil::createAckEvent(const bsl::vector& acks, // TODO: deprecate `createAckEvent` with bufferFactory arg and introduce // another function with BlobSpPool arg. - BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool(bufferFactory, allocator)); - bmqp::AckEventBuilder ackBuilder(&blobSpPool, alloc); + bmqp::AckEventBuilder ackBuilder(blobSpPool.get(), alloc); for (size_t i = 0; i != acks.size(); ++i) { const AckParams& params = acks[i]; const QueueImplSp& impQueue = reinterpret_cast( @@ -335,10 +335,10 @@ Event MockSessionUtil::createPushEvent( // TODO: deprecate `createPushEvent` with bufferFactory arg and introduce // another function with BlobSpPool arg. - BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool(bufferFactory, allocator)); - bmqp::PushEventBuilder pushBuilder(&blobSpPool, alloc); + bmqp::PushEventBuilder pushBuilder(blobSpPool.get(), alloc); for (size_t i = 0; i != pushEventParams.size(); ++i) { const QueueImplSp& queueImplPtr = reinterpret_cast( @@ -948,7 +948,7 @@ int MockSession::start(const bsls::TimeInterval& timeout) MockSession::MockSession(const bmqt::SessionOptions& options, bslma::Allocator* allocator) : d_blobBufferFactory(1024, allocator) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, allocator)) , d_eventHandler_mp(0) , d_calls(allocator) @@ -994,7 +994,7 @@ MockSession::MockSession(bslma::ManagedPtr eventHandler, const bmqt::SessionOptions& options, bslma::Allocator* allocator) : d_blobBufferFactory(1024, allocator) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, allocator)) , d_eventHandler_mp(eventHandler) , d_calls(bslma::Default::allocator(allocator)) @@ -1520,7 +1520,7 @@ void MockSession::loadMessageEventBuilder(MessageEventBuilder* builder) g_bufferFactory_p, d_allocator_p); - eventImplSpRef->configureAsMessageEvent(&d_blobSpPool); + eventImplSpRef->configureAsMessageEvent(d_blobSpPool_sp.get()); eventImplSpRef->setMessageCorrelationIdContainer( d_corrIdContainer_sp.get()); } @@ -1544,7 +1544,7 @@ void MockSession::loadConfirmEventBuilder(ConfirmEventBuilder* builder) } new (builderImplRef.d_buffer.buffer()) - bmqp::ConfirmEventBuilder(&d_blobSpPool, d_allocator_p); + bmqp::ConfirmEventBuilder(d_blobSpPool_sp.get(), d_allocator_p); builderImplRef.d_builder_p = reinterpret_cast( builderImplRef.d_buffer.buffer()); diff --git a/src/groups/bmq/bmqa/bmqa_mocksession.h b/src/groups/bmq/bmqa/bmqa_mocksession.h index cd7672f09..451e93ae6 100644 --- a/src/groups/bmq/bmqa/bmqa_mocksession.h +++ b/src/groups/bmq/bmqa/bmqa_mocksession.h @@ -823,6 +823,9 @@ class MockSession : public AbstractSession { bdlcc::ObjectPoolFunctors::RemoveAll > BlobSpPool; + /// Shared pointer to a pool of shared pointers to Blobs + typedef bsl::shared_ptr BlobSpPoolSp; + /// Aligned buffer holding the two key hash map typedef bsls::AlignedBuffer TwoKeyHashMapBuffer; @@ -1035,8 +1038,8 @@ class MockSession : public AbstractSession { /// Buffer factory used to build Blobs with `d_blobSpPool` bdlbb::PooledBlobBufferFactory d_blobBufferFactory; - /// Pool of shared pointers to blobs - BlobSpPool d_blobSpPool; + /// Shared pointer to the pool of shared pointers to blobs + BlobSpPoolSp d_blobSpPool_sp; /// Event handler (set only in asynchronous mode) bslma::ManagedPtr d_eventHandler_mp; diff --git a/src/groups/bmq/bmqimp/bmqimp_application.cpp b/src/groups/bmq/bmqimp/bmqimp_application.cpp index 4d6dd304d..451325c01 100644 --- a/src/groups/bmq/bmqimp/bmqimp_application.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_application.cpp @@ -553,7 +553,7 @@ Application::Application( , d_channelsTip(&d_allocator) , d_blobBufferFactory(sessionOptions.blobBufferSize(), d_allocators.get("BlobBufferFactory")) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, d_allocators.get("BlobSpPool"))) , d_scheduler(bsls::SystemClockType::e_MONOTONIC, &d_allocator) @@ -584,13 +584,13 @@ Application::Application( NegotiatedChannelFactoryConfig(&d_statChannelFactory, negotiationMessage, sessionOptions.connectTimeout(), - &d_blobSpPool, + d_blobSpPool_sp.get(), allocator), allocator) , d_connectHandle_mp() , d_brokerSession(&d_scheduler, &d_blobBufferFactory, - &d_blobSpPool, + d_blobSpPool_sp.get(), d_sessionOptions, eventHandlerCB, bdlf::MemFnUtil::memFn(&Application::stateCb, this), diff --git a/src/groups/bmq/bmqimp/bmqimp_application.h b/src/groups/bmq/bmqimp/bmqimp_application.h index d5d3b00da..926e713db 100644 --- a/src/groups/bmq/bmqimp/bmqimp_application.h +++ b/src/groups/bmq/bmqimp/bmqimp_application.h @@ -81,6 +81,7 @@ class Application { public: // PUBLIC TYPES typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool; + typedef bmqp::BlobPoolUtil::BlobSpPoolSp BlobSpPoolSp; private: // PRIVATE TYPES @@ -118,8 +119,8 @@ class Application { bdlbb::PooledBlobBufferFactory d_blobBufferFactory; // Factory for blob buffers - /// Pool of shared pointers to blobs. - BlobSpPool d_blobSpPool; + /// Shared pointer to the pool of shared pointers to blobs. + BlobSpPoolSp d_blobSpPool_sp; bdlmt::EventScheduler d_scheduler; // Scheduler @@ -324,7 +325,7 @@ inline bool Application::isStarted() const inline Application::BlobSpPool* Application::blobSpPool() { - return &d_blobSpPool; + return d_blobSpPool_sp.get(); } } // close package namespace diff --git a/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp b/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp index 7f745dcc6..624de94e5 100644 --- a/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp @@ -398,7 +398,7 @@ struct TestSession BSLS_CPP11_FINAL { // various builders /// Blob pool used to provide blobs to event builders. - bmqp::BlobPoolUtil::BlobSpPool d_blobSpPool; + bmqp::BlobPoolUtil::BlobSpPoolSp d_blobSpPool_sp; bdlmt::EventScheduler& d_scheduler; // event scheduler used in the @@ -842,7 +842,7 @@ TestSession::TestSession(const bmqt::SessionOptions& sessionOptions, bslma::Allocator* allocator) : d_allocator_p(allocator) , d_blobBufferFactory(1024, d_allocator_p) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, bmqtst::TestHelperUtil::allocator())) , d_scheduler(scheduler) @@ -850,7 +850,7 @@ TestSession::TestSession(const bmqt::SessionOptions& sessionOptions, , d_eventQueue(bsls::SystemClockType::e_MONOTONIC, d_allocator_p) , d_brokerSession(&d_scheduler, &d_blobBufferFactory, - &d_blobSpPool, + d_blobSpPool_sp.get(), sessionOptions, useEventHandler ? bdlf::BindUtil::bind(&sessionEventHandler, @@ -878,7 +878,7 @@ TestSession::TestSession(const bmqt::SessionOptions& sessionOptions, bslma::Allocator* allocator) : d_allocator_p(allocator) , d_blobBufferFactory(1024, d_allocator_p) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, bmqtst::TestHelperUtil::allocator())) , d_scheduler(testClock.d_scheduler) @@ -886,7 +886,7 @@ TestSession::TestSession(const bmqt::SessionOptions& sessionOptions, , d_eventQueue(bsls::SystemClockType::e_MONOTONIC, d_allocator_p) , d_brokerSession(&d_scheduler, &d_blobBufferFactory, - &d_blobSpPool, + d_blobSpPool_sp.get(), sessionOptions, useEventHandler ? bdlf::BindUtil::bind(&sessionEventHandler, @@ -940,7 +940,7 @@ bslma::Allocator* TestSession::allocator() bmqp::BlobPoolUtil::BlobSpPool& TestSession::blobSpPool() { - return d_blobSpPool; + return *d_blobSpPool_sp; } // MANIPULATORS @@ -2456,7 +2456,7 @@ void TestSession::getOutboundControlMessage( void TestSession::sendControlMessage( const bmqp_ctrlmsg::ControlMessage& message) { - bmqp::SchemaEventBuilder builder(&d_blobSpPool, + bmqp::SchemaEventBuilder builder(d_blobSpPool_sp.get(), bmqp::EncodingType::e_BER, d_allocator_p); int rc = builder.setMessage(message, bmqp::EventType::e_CONTROL); @@ -2853,7 +2853,7 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -2867,7 +2867,7 @@ static void test1_breathingTest() bmqimp::BrokerSession session( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, emptyEventHandler, // emptyEventHandler, bdlf::BindUtil::bind(&stateCb, @@ -2923,7 +2923,7 @@ static void test2_basicAccessorsTest() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -2937,7 +2937,7 @@ static void test2_basicAccessorsTest() bmqimp::BrokerSession obj(&scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, emptyEventHandler, emptyStateCb, @@ -2974,7 +2974,7 @@ static void test3_nullChannelTest() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -2990,7 +2990,7 @@ static void test3_nullChannelTest() bmqimp::BrokerSession obj( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, bdlf::BindUtil::bind(&channelEventHandler, bdlf::PlaceHolders::_1, @@ -3073,7 +3073,7 @@ static void test4_createEventTest() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -3084,7 +3084,7 @@ static void test4_createEventTest() bmqimp::BrokerSession obj(&scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, emptyEventHandler, emptyStateCb, @@ -3102,7 +3102,7 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -3135,7 +3135,7 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) bmqimp::BrokerSession session( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, eventCallback, bdlf::BindUtil::bind(&stateCb, @@ -3342,7 +3342,7 @@ static void test6_setChannelTest() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -3359,7 +3359,7 @@ static void test6_setChannelTest() bmqimp::BrokerSession obj( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, bdlf::BindUtil::bind(&channelSetEventHandler, bdlf::PlaceHolders::_1, @@ -4018,7 +4018,7 @@ static void test11_disconnect() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -4044,7 +4044,7 @@ static void test11_disconnect() bmqimp::BrokerSession obj( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), options, bdlf::BindUtil::bind(&sessionEventHandler, &eventQueue, @@ -4111,7 +4111,7 @@ static void test11_disconnect() disconnectMessage.rId().value()); disconnectResponseMessage.choice().makeDisconnectResponse(); - bmqp::SchemaEventBuilder builder(&blobSpPool, + bmqp::SchemaEventBuilder builder(blobSpPool.get(), bmqp::EncodingType::e_BER, bmqtst::TestHelperUtil::allocator()); rc = builder.setMessage(disconnectResponseMessage, @@ -4152,7 +4152,7 @@ static void test11_disconnect() bmqimp::BrokerSession obj( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), options, bmqimp::EventQueue::EventHandlerCallback(), bdlf::BindUtil::bind(&stateCb, @@ -4214,7 +4214,7 @@ static void test11_disconnect() disconnectMessage.rId().value()); disconnectResponseMessage.choice().makeDisconnectResponse(); - bmqp::SchemaEventBuilder builder(&blobSpPool, + bmqp::SchemaEventBuilder builder(blobSpPool.get(), bmqp::EncodingType::e_BER, bmqtst::TestHelperUtil::allocator()); rc = builder.setMessage(disconnectResponseMessage, @@ -5798,7 +5798,7 @@ static void test25_sessionFsmTable() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -5816,7 +5816,7 @@ static void test25_sessionFsmTable() bmqimp::BrokerSession obj( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, emptyEventHandler, // emptyEventHandler, bdlf::BindUtil::bind(&transitionCb, @@ -6731,11 +6731,11 @@ static void test33_queueNackTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder eventBuilder(&blobSpPool, + bmqp::PutEventBuilder eventBuilder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); const bmqt::CorrelationId corrId(243); bmqt::MessageGUID guid = bmqp::MessageGUIDGenerator::testGUID(); @@ -7842,7 +7842,7 @@ static void test40_syncCalledFromEventHandler() bdlbb::PooledBlobBufferFactory blobBufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -7869,7 +7869,7 @@ static void test40_syncCalledFromEventHandler() bmqimp::BrokerSession session( &scheduler, &blobBufferFactory, - &blobSpPool, + blobSpPool.get(), sessionOptions, bdlf::BindUtil::bind(&eventHandlerSyncCall, &eventSp, @@ -9148,15 +9148,15 @@ static void test50_putRetransmittingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder putEventBuilder(&blobSpPool, + bmqp::PutEventBuilder putEventBuilder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqp::PutMessageIterator putIter(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - bmqp::AckEventBuilder ackEventBuilder(&blobSpPool, + bmqp::AckEventBuilder ackEventBuilder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqp::Event rawEvent(bmqtst::TestHelperUtil::allocator()); const bmqt::CorrelationId corrIdFirst(243); @@ -9441,11 +9441,11 @@ static void test51_putRetransmittingNoAckTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder putEventBuilder(&blobSpPool, + bmqp::PutEventBuilder putEventBuilder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqp::PutMessageIterator putIter(&bufferFactory, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqimp/bmqimp_event.t.cpp b/src/groups/bmq/bmqimp/bmqimp_event.t.cpp index 7aa758f8f..b24f280f6 100644 --- a/src/groups/bmq/bmqimp/bmqimp_event.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_event.t.cpp @@ -774,7 +774,7 @@ static void test6_comparisonOperatorTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -818,8 +818,8 @@ static void test6_comparisonOperatorTest() PV("Configure as MesageEvent"); bmqimp::Event obj3(&bufferFactory, bmqtst::TestHelperUtil::allocator()); bmqimp::Event obj4(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - obj3.configureAsMessageEvent(&blobSpPool); - obj4.configureAsMessageEvent(&blobSpPool); + obj3.configureAsMessageEvent(blobSpPool.get()); + obj4.configureAsMessageEvent(blobSpPool.get()); // NOTE: Message event can not be equal. Is it expected? BMQTST_ASSERT(obj3 != obj4); @@ -1112,7 +1112,7 @@ static void test8_putEventBuilder() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1145,7 +1145,7 @@ static void test8_putEventBuilder() // Create PutEventBuilder bmqimp::Event obj(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - obj.configureAsMessageEvent(&blobSpPool); + obj.configureAsMessageEvent(blobSpPool.get()); bmqp::PutEventBuilder& builder = *(obj.putEventBuilder()); builder.startMessage(); @@ -1569,7 +1569,7 @@ static void test12_upgradeDowngradeMessageEvent() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1578,7 +1578,7 @@ static void test12_upgradeDowngradeMessageEvent() bmqimp::Event obj(&bufferFactory, bmqtst::TestHelperUtil::allocator()); // 2. Configure event as message event in WRITE mode. - obj.configureAsMessageEvent(&blobSpPool); + obj.configureAsMessageEvent(blobSpPool.get()); BMQTST_ASSERT_EQ(bmqimp::Event::MessageEventMode::e_WRITE, obj.messageEventMode()); diff --git a/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp b/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp index b05b66a2e..ec93bddee 100644 --- a/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp @@ -260,11 +260,11 @@ static void test2_capacityTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder builder(&blobSpPool, + bmqp::PutEventBuilder builder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqimp::EventQueue::EventPool eventPool( bdlf::BindUtil::bind(&poolCreateEvent, @@ -568,11 +568,11 @@ static void test6_workingStatsTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder builder(&blobSpPool, + bmqp::PutEventBuilder builder(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqimp::EventQueue::EventPool eventPool( bdlf::BindUtil::bind(&poolCreateEvent, diff --git a/src/groups/bmq/bmqimp/bmqimp_messagedumper.t.cpp b/src/groups/bmq/bmqimp/bmqimp_messagedumper.t.cpp index 3b10deb34..daea99713 100644 --- a/src/groups/bmq/bmqimp/bmqimp_messagedumper.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_messagedumper.t.cpp @@ -141,7 +141,7 @@ struct Tester BSLS_CPP11_FINAL { // various builders /// Blob shared pointer pool used in event builders. - bmqp::BlobPoolUtil::BlobSpPool d_blobSpPool; + bmqp::BlobPoolUtil::BlobSpPoolSp d_blobSpPool_sp; bmqp::PushEventBuilder d_pushEventBuilder; // PUSH event builder @@ -336,11 +336,12 @@ Tester::Tester(bslma::Allocator* allocator) , d_nextCorrelationId(0) , d_time(0, 0) , d_bufferFactory(1024, allocator) -, d_blobSpPool(bmqp::BlobPoolUtil::createBlobPool(&d_bufferFactory, allocator)) -, d_pushEventBuilder(&d_blobSpPool, allocator) -, d_ackEventBuilder(&d_blobSpPool, allocator) -, d_putEventBuilder(&d_blobSpPool, allocator) -, d_confirmEventBuilder(&d_blobSpPool, allocator) +, d_blobSpPool_sp( + bmqp::BlobPoolUtil::createBlobPool(&d_bufferFactory, allocator)) +, d_pushEventBuilder(d_blobSpPool_sp.get(), allocator) +, d_ackEventBuilder(d_blobSpPool_sp.get(), allocator) +, d_putEventBuilder(d_blobSpPool_sp.get(), allocator) +, d_confirmEventBuilder(d_blobSpPool_sp.get(), allocator) , d_allocator_p(allocator) { bmqsys::Time::initialize( diff --git a/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp b/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp index c9731fc0a..f5aa89de8 100644 --- a/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp @@ -595,11 +595,11 @@ static void test9_pushStatsTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bdlbb::Blob payload(&bufferFactory, bmqtst::TestHelperUtil::allocator()); bmqt::Uri uri(k_URI, bmqtst::TestHelperUtil::allocator()); @@ -713,11 +713,11 @@ static void test10_putStatsTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder peb(&blobSpPool, + bmqp::PutEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqt::Uri uri(k_URI, bmqtst::TestHelperUtil::allocator()); bmqimp::QueueManager::QueueSp queueSp; diff --git a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.h b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.h index c2f573e78..fbc29342a 100644 --- a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.h @@ -41,10 +41,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::AckEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::AckEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages // builder.appendMessage(0, 1, bmqt::MessageGUID(), 1); diff --git a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp index fbdbea1f6..86a860c9e 100644 --- a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp @@ -142,11 +142,11 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::AckEventBuilder obj(&blobSpPool, + bmqp::AckEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -173,11 +173,11 @@ static void test2_multiMessage() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::AckEventBuilder obj(&blobSpPool, + bmqp::AckEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -196,11 +196,11 @@ static void test3_reset() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::AckEventBuilder obj(&blobSpPool, + bmqp::AckEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -232,11 +232,11 @@ static void test4_capacity() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::AckEventBuilder obj(&blobSpPool, + bmqp::AckEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); PVV("Computing max message"); @@ -292,11 +292,11 @@ static void testN1_decodeFromFile() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::AckEventBuilder obj(&blobSpPool, + bmqp::AckEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); bdlbb::Blob outBlob(&bufferFactory, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqp/bmqp_blobpoolutil.cpp b/src/groups/bmq/bmqp/bmqp_blobpoolutil.cpp index 281bb5d9d..675afa9cf 100644 --- a/src/groups/bmq/bmqp/bmqp_blobpoolutil.cpp +++ b/src/groups/bmq/bmqp/bmqp_blobpoolutil.cpp @@ -42,20 +42,24 @@ void createBlob(bdlbb::BlobBufferFactory* bufferFactory, // class BlobPoolUtil // ------------------ -BlobPoolUtil::BlobSpPool +BlobPoolUtil::BlobSpPoolSp BlobPoolUtil::createBlobPool(bdlbb::BlobBufferFactory* blobBufferFactory_p, bslma::Allocator* allocator) { // PRECONDITIONS BSLS_ASSERT(blobBufferFactory_p); - return BlobSpPool( - bdlf::BindUtil::bind(&createBlob, - blobBufferFactory_p, - bdlf::PlaceHolders::_1, // arena - bdlf::PlaceHolders::_2), // allocator - k_BLOB_POOL_GROWTH_STRATEGY, - bslma::Default::allocator(allocator)); + bslma::Allocator* alloc = bslma::Default::allocator(allocator); + + return bsl::shared_ptr( + new BlobSpPool( + bdlf::BindUtil::bind(&createBlob, + blobBufferFactory_p, + bdlf::PlaceHolders::_1, // arena + bdlf::PlaceHolders::_2), // allocator + k_BLOB_POOL_GROWTH_STRATEGY, + alloc), + alloc); } } // close package namespace diff --git a/src/groups/bmq/bmqp/bmqp_blobpoolutil.h b/src/groups/bmq/bmqp/bmqp_blobpoolutil.h index aa41b2e07..6fc7f11ed 100644 --- a/src/groups/bmq/bmqp/bmqp_blobpoolutil.h +++ b/src/groups/bmq/bmqp/bmqp_blobpoolutil.h @@ -35,7 +35,7 @@ namespace BloombergLP { namespace bmqp { struct BlobPoolUtil { - // TYPES + // PUBLIC TYPES /// Pool of shared pointers to Blobs typedef bdlcc::SharedObjectPool< @@ -44,12 +44,15 @@ struct BlobPoolUtil { bdlcc::ObjectPoolFunctors::RemoveAll > BlobSpPool; + /// Shared pointer to the pool of shared pointers to Blobs + typedef bsl::shared_ptr BlobSpPoolSp; + // CLASS METHODS - /// Create a blob shared pointer pool, using the specified - /// `blobBufferFactory_p`. Use the optionally specified `allocator` - /// for memory allocations. - static BlobSpPool + /// Create a pool of shared pointers to blobs, using the specified + /// `blobBufferFactory_p`, and return it as a shared pointer. + /// Use the optionally specified `allocator` for memory allocations. + static BlobSpPoolSp createBlobPool(bdlbb::BlobBufferFactory* blobBufferFactory_p, bslma::Allocator* allocator = 0); }; diff --git a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.h b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.h index 8d24bae8c..896e4e481 100644 --- a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.h @@ -41,10 +41,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::ConfirmEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::ConfirmEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages, from same or different queue // builder.appendMessage(k_QUEUEID1, k_SUBQUEUEID1, bmqt::MessageGUID()); diff --git a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp index 7958cfad2..d6cd781f4 100644 --- a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp @@ -139,11 +139,11 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::ConfirmEventBuilder obj(&blobSpPool, + bmqp::ConfirmEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -170,11 +170,11 @@ static void test2_multiMessage() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::ConfirmEventBuilder obj(&blobSpPool, + bmqp::ConfirmEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -193,11 +193,11 @@ static void test3_reset() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::ConfirmEventBuilder obj(&blobSpPool, + bmqp::ConfirmEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -229,11 +229,11 @@ static void test4_capacity() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::ConfirmEventBuilder obj(&blobSpPool, + bmqp::ConfirmEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); PVV("Computing max message"); @@ -291,11 +291,11 @@ static void testN1_decodeFromFile() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::ConfirmEventBuilder obj(&blobSpPool, + bmqp::ConfirmEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); bdlbb::Blob outBlob(&bufferFactory, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqp/bmqp_event.t.cpp b/src/groups/bmq/bmqp/bmqp_event.t.cpp index 585dca022..653f8f3c1 100644 --- a/src/groups/bmq/bmqp/bmqp_event.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_event.t.cpp @@ -528,7 +528,7 @@ static void test4_eventLoading() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -548,7 +548,7 @@ static void test4_eventLoading() const Test& test = k_DATA[idx]; PVV(test.d_line << ": Testing " << test.d_encodingType << "encoding"); - bmqp::SchemaEventBuilder obj(&blobSpPool, + bmqp::SchemaEventBuilder obj(blobSpPool.get(), test.d_encodingType, bmqtst::TestHelperUtil::allocator()); @@ -595,7 +595,7 @@ static void test4_eventLoading() } { - bmqp::SchemaEventBuilder obj(&blobSpPool, + bmqp::SchemaEventBuilder obj(blobSpPool.get(), bmqp::EncodingType::e_BER, bmqtst::TestHelperUtil::allocator()); BSLS_ASSERT_OPT(obj.blob()->length() == 0); diff --git a/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp b/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp index 315e0ca63..e294a25fb 100644 --- a/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp @@ -251,12 +251,12 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::PushEventBuilder pushEventBuilder( - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); int payloadLength = 0; @@ -321,7 +321,7 @@ static void test1_breathingTest() &eventInfos, event, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(rc, 0); BMQTST_ASSERT_EQ(eventInfos.size(), 1u); @@ -456,12 +456,12 @@ static void test2_flattenExplodesEvent() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::PushEventBuilder pushEventBuilder( - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); int payloadLength = 0; @@ -499,7 +499,7 @@ static void test2_flattenExplodesEvent() &eventInfos, event, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(rc, 0); BMQTST_ASSERT_EQ(eventInfos.size(), 2u); @@ -690,14 +690,14 @@ static void test3_flattenWithMessageProperties() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::MessageProperties msgProperties(bmqtst::TestHelperUtil::allocator()); bdlbb::Blob appData(bmqtst::TestHelperUtil::allocator()); bmqp::PushEventBuilder pushEventBuilder( - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqt::EventBuilderResult::Enum result; int payloadLength = 0; @@ -778,7 +778,7 @@ static void test3_flattenWithMessageProperties() &eventInfos, event, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(rc, 0); BMQTST_ASSERT_EQ(eventInfos.size(), 1U); diff --git a/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp b/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp index 443a93e26..c33931938 100644 --- a/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp @@ -864,14 +864,14 @@ static void test11_parseMessageProperties() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::MessageProperties in(bmqtst::TestHelperUtil::allocator()); encode(&in); const int queueId = 4; - bmqp::PutEventBuilder peb(&blobSpPool, + bmqp::PutEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bdlbb::Blob payload(&bufferFactory, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqp/bmqp_pusheventbuilder.h b/src/groups/bmq/bmqp/bmqp_pusheventbuilder.h index 277538483..93c6b5e2d 100644 --- a/src/groups/bmq/bmqp/bmqp_pusheventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_pusheventbuilder.h @@ -40,10 +40,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::PushEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::PushEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages // builder.packMessage("hello", 5, 0, bmqt::MessageGUID()); diff --git a/src/groups/bmq/bmqp/bmqp_pusheventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_pusheventbuilder.t.cpp index 9f2761ffc..7f3bff81e 100644 --- a/src/groups/bmq/bmqp/bmqp_pusheventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_pusheventbuilder.t.cpp @@ -273,7 +273,7 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -296,7 +296,7 @@ static void test1_breathingTest() bsl::strlen(buffer)); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); @@ -401,7 +401,7 @@ static void test2_buildEventBackwardsCompatibility() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -424,7 +424,7 @@ static void test2_buildEventBackwardsCompatibility() bsl::strlen(buffer)); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); @@ -530,7 +530,7 @@ static void test3_buildEventWithPackedOption() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -549,7 +549,7 @@ static void test3_buildEventWithPackedOption() bsl::strlen(buffer)); // Create PushEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); @@ -646,11 +646,11 @@ static void test4_buildEventWithMultipleMessages() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); @@ -770,7 +770,7 @@ static void test5_buildEventWithPayloadTooBig() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -794,7 +794,7 @@ static void test5_buildEventWithPayloadTooBig() bigMsgPayload.length()); // Create PutEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); @@ -894,7 +894,7 @@ static void test6_buildEventWithImplicitPayload() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -903,7 +903,7 @@ static void test6_buildEventWithImplicitPayload() const int flags = bmqp::PushHeaderFlags::e_IMPLICIT_PAYLOAD; // Create PutEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bmqt::EventBuilderResult::Enum rc = peb.packMessage( queueId, @@ -980,7 +980,7 @@ static void test7_buildEventOptionTooBig() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1004,7 +1004,7 @@ static void test7_buildEventOptionTooBig() generateSubQueueInfos(&subQueueInfos, numSubQueueInfos); // Create PutEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); // Add option larger than maximum allowed @@ -1164,7 +1164,7 @@ static void test8_buildEventTooBig() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1184,7 +1184,7 @@ static void test8_buildEventTooBig() bdlbb::BlobUtil::append(&validPayload1, s.c_str(), validLen); // Create PutEventBuilder - bmqp::PushEventBuilder peb(&blobSpPool, + bmqp::PushEventBuilder peb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); // Add message with valid payload size @@ -1256,7 +1256,7 @@ static void testN1_decodeFromFile() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1273,7 +1273,7 @@ static void testN1_decodeFromFile() bdlbb::BlobUtil::append(&payloadBlob, k_PAYLOAD, k_PAYLOAD_LEN); // Create PutEventBuilder - bmqp::PushEventBuilder obj(&blobSpPool, + bmqp::PushEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); // Pack one msg diff --git a/src/groups/bmq/bmqp/bmqp_puteventbuilder.h b/src/groups/bmq/bmqp/bmqp_puteventbuilder.h index ef8a7d4e2..d02458e07 100644 --- a/src/groups/bmq/bmqp/bmqp_puteventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_puteventbuilder.h @@ -40,10 +40,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::PutEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::PutEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages // // (Error handling omitted below for brevity) diff --git a/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp index 4686451a4..fee510c89 100644 --- a/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp @@ -217,7 +217,7 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -261,7 +261,7 @@ static void test1_breathingTest() BSLS_ASSERT_OPT(k_NUM_PROPERTIES == msgProps.numProperties()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); @@ -490,7 +490,7 @@ static void test1_breathingTest() BSLS_ASSERT_OPT(k_NUM_PROPERTIES == msgProps.numProperties()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); @@ -725,7 +725,7 @@ static void test1_breathingTest() BSLS_ASSERT_OPT(k_NUM_PROPERTIES == msgProps.numProperties()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); @@ -975,7 +975,7 @@ static void test1_breathingTest() BSLS_ASSERT_OPT(k_NUM_PROPERTIES == msgProps.numProperties()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); @@ -1212,7 +1212,7 @@ static void test1_breathingTest() BSLS_ASSERT_OPT(k_NUM_PROPERTIES == msgProps.numProperties()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); @@ -1432,7 +1432,7 @@ static void test1_breathingTest() PVV("DO NOT USE COMPRESSION FOR RELAYED PUT MESSAGES"); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); bmqu::MemOutStream error(bmqtst::TestHelperUtil::allocator()); @@ -1686,11 +1686,11 @@ static void test2_manipulators_one() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); // Properties. @@ -1846,7 +1846,7 @@ static void test3_eventTooBig() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1868,7 +1868,7 @@ static void test3_eventTooBig() bigMsgPayload.length()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); obj.startMessage(); @@ -1962,11 +1962,11 @@ static void test4_manipulators_two() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); const size_t k_NUM_MSGS = 1000; @@ -2051,11 +2051,11 @@ static void test5_putEventWithZeroLengthMessage() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); @@ -2106,7 +2106,7 @@ static void test6_emptyBuilder() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -2128,7 +2128,7 @@ static void test6_emptyBuilder() const char* k_PAYLOAD = "abcdefghijklmnopqrstuvwxyz"; - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.unpackedMessageSize(), 0); @@ -2201,7 +2201,7 @@ static void test7_multiplePackMessage() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -2242,7 +2242,7 @@ static void test7_multiplePackMessage() BMQTST_ASSERT_EQ(k_NUM_PROPERTIES, msgProps.numProperties()); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.crc32c(), 0U); @@ -2452,7 +2452,7 @@ static void testN1_decodeFromFile() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -2496,7 +2496,7 @@ static void testN1_decodeFromFile() bmqp::PutHeaderFlags::e_MESSAGE_PROPERTIES); // Create PutEventBuilder - bmqp::PutEventBuilder obj(&blobSpPool, + bmqp::PutEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); obj.startMessage(); diff --git a/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.h b/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.h index 789e12512..3d6dc8d28 100644 --- a/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.h @@ -42,10 +42,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::RecoveryEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::RecoveryEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages // builder.appendMessage(0, 1, bmqt::MessageGUID(), 1); diff --git a/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.t.cpp index 43a98f359..5eb28b49a 100644 --- a/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_recoveryeventbuilder.t.cpp @@ -115,7 +115,7 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -130,7 +130,7 @@ static void test1_breathingTest() // Create RecoveryEventBuilder. - bmqp::RecoveryEventBuilder reb(&blobSpPool, + bmqp::RecoveryEventBuilder reb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(reb.eventSize())); @@ -211,11 +211,11 @@ static void test2_multipleMessagesTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RecoveryEventBuilder reb(&blobSpPool, + bmqp::RecoveryEventBuilder reb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); const size_t NUM_MSGS = 1000; @@ -299,11 +299,11 @@ static void test3_eventTooBigTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RecoveryEventBuilder reb(&blobSpPool, + bmqp::RecoveryEventBuilder reb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::string bigChunk(bmqtst::TestHelperUtil::allocator()); bigChunk.resize(bmqp::RecoveryHeader::k_MAX_PAYLOAD_SIZE_SOFT + 4, 'a'); @@ -396,11 +396,11 @@ static void test4_emptyPayloadTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RecoveryEventBuilder reb(&blobSpPool, + bmqp::RecoveryEventBuilder reb(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::shared_ptr chunkBufferSp( diff --git a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.h b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.h index 46e814a33..f8fd6628e 100644 --- a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.h @@ -41,10 +41,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::RejectEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::RejectEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages, from same or different queue // builder.appendMessage(k_QUEUEID1, k_SUBQUEUEID1, bmqt::MessageGUID(), 5); diff --git a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp index f64e44fb8..3e13856e3 100644 --- a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp @@ -139,11 +139,11 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RejectEventBuilder obj(&blobSpPool, + bmqp::RejectEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -170,11 +170,11 @@ static void test2_multiMessage() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RejectEventBuilder obj(&blobSpPool, + bmqp::RejectEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -193,11 +193,11 @@ static void test3_reset() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RejectEventBuilder obj(&blobSpPool, + bmqp::RejectEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); @@ -229,11 +229,11 @@ static void test4_capacity() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RejectEventBuilder obj(&blobSpPool, + bmqp::RejectEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); PVV("Computing max message"); @@ -291,11 +291,11 @@ static void testN1_decodeFromFile() bdlbb::PooledBlobBufferFactory bufferFactory( 256, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); - bmqp::RejectEventBuilder obj(&blobSpPool, + bmqp::RejectEventBuilder obj(blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector messages(bmqtst::TestHelperUtil::allocator()); bdlbb::Blob outBlob(&bufferFactory, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp b/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp index 6c0e71bdd..b715ab31f 100644 --- a/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp @@ -112,7 +112,7 @@ class TestContext { bdlbb::PooledBlobBufferFactory d_blobBufferFactory; /// Blob pool used to provide blobs to event builders. - bmqp::BlobPoolUtil::BlobSpPool d_blobSpPool; + bmqp::BlobPoolUtil::BlobSpPoolSp d_blobSpPool_sp; TestClock d_testClock; // Pointer to struct to initialize system time @@ -204,13 +204,13 @@ class TestContext { TestContext::TestContext(bool lateResponseMode, bslma::Allocator* allocator) : d_blobBufferFactory(1024, allocator) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, allocator)) , d_testClock(allocator) , d_scheduler(d_testClock.d_scheduler) , d_testChannel(allocator) , d_requestManager(bmqp::EventType::e_CONTROL, - &d_blobSpPool, + d_blobSpPool_sp.get(), &d_scheduler, lateResponseMode, allocator) @@ -386,7 +386,7 @@ static void test1_creatorsTest() bdlbb::PooledBlobBufferFactory blobBufferFactory( 4096, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &blobBufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -398,7 +398,7 @@ static void test1_creatorsTest() BMQTST_ASSERT_SAFE_FAIL( ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, + blobSpPool.get(), &scheduler, false, // late response mode is off bmqtst::TestHelperUtil::allocator())); @@ -411,14 +411,14 @@ static void test1_creatorsTest() BMQTST_ASSERT_PASS( ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, + blobSpPool.get(), &scheduler, false, // late response mode is off bmqtst::TestHelperUtil::allocator())); BMQTST_ASSERT_PASS( ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, + blobSpPool.get(), &scheduler, false, // late response mode is off bmqex::SystemExecutor(), @@ -426,7 +426,7 @@ static void test1_creatorsTest() BMQTST_ASSERT_PASS( ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, + blobSpPool.get(), &scheduler, false, // late response mode is off bmqex::SystemExecutor(), diff --git a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp index 13d6bcbea..d76b6637d 100644 --- a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp @@ -58,7 +58,7 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -78,7 +78,7 @@ static void test1_breathingTest() const Test& test = k_DATA[idx]; PVV(test.d_line << ": Testing " << test.d_encodingType << "encoding"); - bmqp::SchemaEventBuilder obj(&blobSpPool, + bmqp::SchemaEventBuilder obj(blobSpPool.get(), test.d_encodingType, bmqtst::TestHelperUtil::allocator()); @@ -288,7 +288,7 @@ static void testN1_decodeFromFile() bdlbb::PooledBlobBufferFactory bufferFactory( k_SIZE, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -308,7 +308,7 @@ static void testN1_decodeFromFile() const Test& test = k_DATA[idx]; PVV(test.d_line << ": Testing " << test.d_encodingType << " encoding"); - bmqp::SchemaEventBuilder obj(&blobSpPool, + bmqp::SchemaEventBuilder obj(blobSpPool.get(), test.d_encodingType, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.h b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.h index 84b3015f7..57dff8e27 100644 --- a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.h +++ b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.h @@ -42,10 +42,10 @@ /// Usage ///----- //.. -// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); -// bmqp::BlobPoolUtil::BlobSpPool blobSpPool( +// bdlbb::PooledBlobBufferFactory bufferFactory(1024, s_allocator_p); +// bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( // bmqp::BlobPoolUtil::createBlobPool(&bufferFactory, s_allocator_p)); -// bmqp::StorageEventBuilder builder(&blobSpPool, d_allocator_p); +// bmqp::StorageEventBuilder builder(blobSpPool.get(), d_allocator_p); // // // Append multiple messages // builder.packMessage(...); diff --git a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp index def80c804..f53d95d71 100644 --- a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp @@ -187,7 +187,7 @@ static void test1_breathingTest() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -202,7 +202,7 @@ static void test1_breathingTest() // Create StorageEventBuilder bmqp::StorageEventBuilder seb(1, // storage protocol version bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(seb.eventSize(), static_cast(sizeof(bmqp::EventHeader))); @@ -295,14 +295,14 @@ static void test2_storageEventHavingMultipleMessages() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::StorageEventBuilder seb(k_SPV, bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); const size_t NUM_MSGS = 1000; @@ -396,7 +396,7 @@ static void test3_packMessage_payloadTooBig() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -410,7 +410,7 @@ static void test3_packMessage_payloadTooBig() bmqp::StorageEventBuilder seb(k_SPV, bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::string bigPayload(bmqtst::TestHelperUtil::allocator()); bigPayload.resize(bmqp::StorageHeader::k_MAX_PAYLOAD_SIZE_SOFT + 4, 'a'); @@ -536,13 +536,13 @@ static void test4_packMessageRaw() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::StorageEventBuilder sebA(k_SPV, bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bsl::vector data(bmqtst::TestHelperUtil::allocator()); const size_t NUM_MSGS = 1000; @@ -571,7 +571,7 @@ static void test4_packMessageRaw() // Iterate over event 'A', and create event 'B' using 'packMessageRaw'. bmqp::StorageEventBuilder sebB(k_SPV, bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); while (1 == iterA.next() && dataIndex < NUM_MSGS) { @@ -681,13 +681,13 @@ static void test5_packMessageRaw_emptyMessage() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); bmqp::StorageEventBuilder seb(k_SPV, bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); bdlbb::Blob emptyBlob(&bufferFactory, bmqtst::TestHelperUtil::allocator()); @@ -728,7 +728,7 @@ static void test6_packMessageRaw_invalidPosition() bdlbb::PooledBlobBufferFactory bufferFactory( 1024, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -736,7 +736,7 @@ static void test6_packMessageRaw_invalidPosition() bmqtst::TestHelperUtil::allocator()); bmqp::StorageEventBuilder seb(k_SPV, bmqp::EventType::e_STORAGE, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()); // 1. diff --git a/src/groups/mqb/mqbnet/mqbnet_channel.cpp b/src/groups/mqb/mqbnet/mqbnet_channel.cpp index 79f1c3748..412b9ecc6 100644 --- a/src/groups/mqb/mqbnet/mqbnet_channel.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_channel.cpp @@ -67,14 +67,14 @@ Channel::Channel(bdlbb::BlobBufferFactory* blobBufferFactory, bslma::Allocator* allocator) : d_allocators(allocator) , d_allocator_p(d_allocators.get("Channel")) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(blobBufferFactory, d_allocators.get("BlobSpPool"))) -, d_putBuilder(&d_blobSpPool, d_allocator_p) -, d_pushBuilder(&d_blobSpPool, d_allocator_p) -, d_ackBuilder(&d_blobSpPool, d_allocator_p) -, d_confirmBuilder(&d_blobSpPool, d_allocator_p) -, d_rejectBuilder(&d_blobSpPool, d_allocator_p) +, d_putBuilder(d_blobSpPool_sp.get(), d_allocator_p) +, d_pushBuilder(d_blobSpPool_sp.get(), d_allocator_p) +, d_ackBuilder(d_blobSpPool_sp.get(), d_allocator_p) +, d_confirmBuilder(d_blobSpPool_sp.get(), d_allocator_p) +, d_rejectBuilder(d_blobSpPool_sp.get(), d_allocator_p) , d_itemPool(sizeof(Item), bsls::BlockGrowth::BSLS_CONSTANT, d_allocators.get("ItemPool")) diff --git a/src/groups/mqb/mqbnet/mqbnet_channel.h b/src/groups/mqb/mqbnet/mqbnet_channel.h index 4a5df5e84..0a303dfa4 100644 --- a/src/groups/mqb/mqbnet/mqbnet_channel.h +++ b/src/groups/mqb/mqbnet/mqbnet_channel.h @@ -127,7 +127,7 @@ class Channel { bdlcc::SingleConsumerQueue > > ItemQueue; - typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool; + typedef bmqp::BlobPoolUtil::BlobSpPoolSp BlobSpPoolSp; /// Const references to everything needed to writeBufferedItem PUT. /// This is template parameter to generalized writing code. @@ -370,7 +370,7 @@ class Channel { /// Counting allocator bslma::Allocator* d_allocator_p; - BlobSpPool d_blobSpPool; + BlobSpPoolSp d_blobSpPool_sp; bmqp::PutEventBuilder d_putBuilder; diff --git a/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp b/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp index b6fa2ea3a..bde7be240 100644 --- a/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp @@ -740,7 +740,7 @@ static void test1_write() bdlbb::PooledBlobBufferFactory bufferFactory( k_BUFFER_SIZE, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -752,31 +752,31 @@ static void test1_write() new (*bmqtst::TestHelperUtil::allocator()) bmqio::TestChannelEx(channel, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()), bmqtst::TestHelperUtil::allocator()); Tester put(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester push(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester ack(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester confirm( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester reject( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); channel.setChannel(bsl::weak_ptr(testChannel)); @@ -830,7 +830,7 @@ static void test2_highWatermark() bdlbb::PooledBlobBufferFactory bufferFactory( k_BUFFER_SIZE, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -842,35 +842,35 @@ static void test2_highWatermark() new (*bmqtst::TestHelperUtil::allocator()) bmqio::TestChannelEx(channel, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()), bmqtst::TestHelperUtil::allocator()); Tester put(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester push(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester ack(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester confirm( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester control(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester reject( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); bslmt::Barrier phase1(6 + 1); @@ -947,7 +947,7 @@ static void test3_highWatermarkInWriteCb() bdlbb::PooledBlobBufferFactory bufferFactory( k_BUFFER_SIZE, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -959,31 +959,31 @@ static void test3_highWatermarkInWriteCb() new (*bmqtst::TestHelperUtil::allocator()) bmqio::TestChannelEx(channel, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()), bmqtst::TestHelperUtil::allocator()); Tester put(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester push(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester ack(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester confirm( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester reject( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); bslmt::Barrier phase1(5 + 1); @@ -1064,7 +1064,7 @@ static void test4_controlBlob() bdlbb::PooledBlobBufferFactory bufferFactory( k_BUFFER_SIZE, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1076,31 +1076,31 @@ static void test4_controlBlob() new (*bmqtst::TestHelperUtil::allocator()) bmqio::TestChannelEx(channel, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()), bmqtst::TestHelperUtil::allocator()); Tester put(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester push(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester ack(channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester confirm( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); Tester reject( channel, bufferFactory, - blobSpPool, + *blobSpPool, bmqtst::TestHelperUtil::allocator()); channel.setChannel(bsl::weak_ptr(testChannel)); @@ -1113,7 +1113,7 @@ static void test4_controlBlob() // cannot assert 'writeCalls().size() == 0' because of auto-flushing - bsl::shared_ptr payload_sp = blobSpPool.getObject(); + bsl::shared_ptr payload_sp = blobSpPool->getObject(); bdlbb::BlobBuffer blobBuffer; bufferFactory.allocate(&blobBuffer); @@ -1157,7 +1157,7 @@ static void test5_reconnect() bdlbb::PooledBlobBufferFactory bufferFactory( k_BUFFER_SIZE, bmqtst::TestHelperUtil::allocator()); - bmqp::BlobPoolUtil::BlobSpPool blobSpPool( + bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool( bmqp::BlobPoolUtil::createBlobPool( &bufferFactory, bmqtst::TestHelperUtil::allocator())); @@ -1169,14 +1169,14 @@ static void test5_reconnect() new (*bmqtst::TestHelperUtil::allocator()) bmqio::TestChannelEx(channel, &bufferFactory, - &blobSpPool, + blobSpPool.get(), bmqtst::TestHelperUtil::allocator()), bmqtst::TestHelperUtil::allocator()); channel.setChannel(bsl::weak_ptr(testChannel)); { - bsl::shared_ptr payload_sp = blobSpPool.getObject(); + bsl::shared_ptr payload_sp = blobSpPool->getObject(); bdlbb::BlobBuffer blobBuffer; bufferFactory.allocate(&blobBuffer); @@ -1198,7 +1198,7 @@ static void test5_reconnect() testChannel->setWriteStatus(bmqio::StatusCategory::e_CONNECTION); { - bsl::shared_ptr payload_sp = blobSpPool.getObject(); + bsl::shared_ptr payload_sp = blobSpPool->getObject(); bdlbb::BlobBuffer blobBuffer; bufferFactory.allocate(&blobBuffer); @@ -1218,7 +1218,7 @@ static void test5_reconnect() testChannel->setWriteStatus(bmqio::StatusCategory::e_SUCCESS); { - bsl::shared_ptr payload_sp = blobSpPool.getObject(); + bsl::shared_ptr payload_sp = blobSpPool->getObject(); bdlbb::BlobBuffer blobBuffer; bufferFactory.allocate(&blobBuffer); diff --git a/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp b/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp index e67502666..a761f5f3c 100644 --- a/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp @@ -123,7 +123,7 @@ class TestContext { // Buffer factory provided to the various builders /// Blob shared pointer pool used in event builders. - bmqp::BlobPoolUtil::BlobSpPool d_blobSpPool; + bmqp::BlobPoolUtil::BlobSpPoolSp d_blobSpPool_sp; ReqManagerTypeSp d_requestManager; // RequestManager object under testing @@ -236,7 +236,7 @@ class TestContext { TestContext::TestContext(int nodesCount, bslma::Allocator* allocator) : d_blobBufferFactory(1024, allocator) -, d_blobSpPool( +, d_blobSpPool_sp( bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, bmqtst::TestHelperUtil::allocator())) , d_requestManager(0) @@ -266,7 +266,7 @@ TestContext::TestContext(int nodesCount, bslma::Allocator* allocator) d_requestManager = bsl::make_shared( bmqp::EventType::e_CONTROL, - &d_blobSpPool, + d_blobSpPool_sp.get(), &d_cluster_mp->_scheduler(), false, // lateResponseMode d_allocator_p); diff --git a/src/groups/mqb/mqbs/mqbs_filestore.t.cpp b/src/groups/mqb/mqbs/mqbs_filestore.t.cpp index fa8c828cb..5ebdb1d19 100644 --- a/src/groups/mqb/mqbs/mqbs_filestore.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_filestore.t.cpp @@ -142,7 +142,7 @@ struct Tester { bdlbb::PooledBlobBufferFactory d_bufferFactory; bsl::string d_clusterLocation; bsl::string d_clusterArchiveLocation; - bmqp::BlobPoolUtil::BlobSpPool d_blobSpPool; + bmqp::BlobPoolUtil::BlobSpPoolSp d_blobSpPool_sp; mqbcfg::PartitionConfig d_partitionCfg; mqbcfg::ClusterDefinition d_clusterCfg; bsl::vector d_clusterNodesCfg; @@ -167,7 +167,7 @@ struct Tester { , d_bufferFactory(1024, bmqtst::TestHelperUtil::allocator()) , d_clusterLocation(location, bmqtst::TestHelperUtil::allocator()) , d_clusterArchiveLocation(location, bmqtst::TestHelperUtil::allocator()) - , d_blobSpPool(bmqp::BlobPoolUtil::createBlobPool( + , d_blobSpPool_sp(bmqp::BlobPoolUtil::createBlobPool( &d_bufferFactory, bmqtst::TestHelperUtil::allocator())) , d_partitionCfg(bmqtst::TestHelperUtil::allocator()) @@ -264,7 +264,7 @@ struct Tester { &d_dispatcher, d_cluster_mp.get(), &d_clusterStats, - &d_blobSpPool, + d_blobSpPool_sp.get(), &d_statePool, &d_miscWorkThreadPool, false, // isCSLModeEnabled