mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
- Replace Parts::AtRef(i) with Parts::At(i). At() returns a reference to the MessagePtr, so a following '.' becomes '->', and a lone call gets a leading '*'. - Wrap the raw pointer of Parts::AddPart(Message*) in fair::mq::MessagePtr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
1.0 KiB
C++
22 lines
1.0 KiB
C++
#include <fairmq/Message.h>
|
|
#include <fairmq/Parts.h>
|
|
|
|
#include <cstddef>
|
|
|
|
std::size_t sizes(fair::mq::Parts& parts, fair::mq::Message* raw)
|
|
{
|
|
// CHECK-MESSAGES: :[[@LINE+1]]:11: warning: 'Parts::AddPart(Message*)' is deprecated; pass a 'fair::mq::MessagePtr' [fairmq-modernize-parts-api]
|
|
parts.AddPart(raw);
|
|
// CHECK-FIXES: parts.AddPart(fair::mq::MessagePtr(raw));
|
|
// CHECK-MESSAGES: :[[@LINE+1]]:33: warning: 'Parts::AtRef()' is deprecated; use 'Parts::At()' [fairmq-modernize-parts-api]
|
|
std::size_t const a = parts.AtRef(0).GetSize();
|
|
// CHECK-FIXES: std::size_t const a = parts.At(0)->GetSize();
|
|
// CHECK-MESSAGES: :[[@LINE+1]]:38: warning: 'Parts::AtRef()' is deprecated; use 'Parts::At()' [fairmq-modernize-parts-api]
|
|
fair::mq::Message& first = parts.AtRef(0);
|
|
// CHECK-FIXES: fair::mq::Message& first = *parts.At(0);
|
|
// The current API is not reported.
|
|
parts.AddPart(fair::mq::MessagePtr(nullptr));
|
|
std::size_t const b = parts.At(0)->GetSize() + first.GetSize();
|
|
return a + b;
|
|
}
|