mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: allow accumulation of parts on receive.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
1fa5c836a6
commit
0926a9a764
@@ -823,27 +823,26 @@ bool FairMQChannel::CheckCompatibility(unique_ptr<FairMQMessage>& msg) const
|
||||
|
||||
bool FairMQChannel::CheckCompatibility(vector<unique_ptr<FairMQMessage>>& msgVec) const
|
||||
{
|
||||
bool match = true;
|
||||
|
||||
if (msgVec.size() > 0)
|
||||
{
|
||||
if (fTransportType == msgVec.at(0)->GetType())
|
||||
for (unsigned int i = 0; i < msgVec.size(); ++i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// LOG(WARN) << "Channel type does not match message type. Copying...";
|
||||
vector<unique_ptr<FairMQMessage>> tempVec;
|
||||
for (unsigned int i = 0; i < msgVec.size(); ++i)
|
||||
if (fTransportType != msgVec.at(i)->GetType())
|
||||
{
|
||||
tempVec.push_back(fTransportFactory->CreateMessage(msgVec[i]->GetSize()));
|
||||
memcpy(tempVec[i]->GetData(), msgVec[i]->GetData(), msgVec[i]->GetSize());
|
||||
// LOG(WARN) << "Channel type does not match message type. Copying...";
|
||||
FairMQMessagePtr newMsg(fTransportFactory->CreateMessage(msgVec[i]->GetSize()));
|
||||
memcpy(newMsg->GetData(), msgVec[i]->GetData(), msgVec[i]->GetSize());
|
||||
msgVec[i] = move(newMsg);
|
||||
match = false;
|
||||
}
|
||||
msgVec = move(tempVec);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return match;
|
||||
}
|
||||
|
Reference in New Issue
Block a user