Equip FairMQMessage with pointer to factory (at creation)

the patch seems big but most of it is just propagating the new notion of
constness of the factory - since it keeps track of created messages with
the internal allocator it no longer is const
This commit is contained in:
mkrzewic
2018-10-18 13:15:04 +02:00
committed by Dennis Klein
parent 310b9647b5
commit d40bbfe208
30 changed files with 195 additions and 177 deletions

View File

@@ -213,24 +213,24 @@ void FairMQTransportFactorySHM::SendHeartbeats()
}
}
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage() const
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage()
{
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager));
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, this));
}
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage(const size_t size) const
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage(const size_t size)
{
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, size));
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, size, this));
}
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage(void* data, const size_t size, fairmq_free_fn* ffn, void* hint) const
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage(void* data, const size_t size, fairmq_free_fn* ffn, void* hint)
{
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, data, size, ffn, hint));
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, data, size, ffn, hint, this));
}
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage(FairMQUnmanagedRegionPtr& region, void* data, const size_t size, void* hint) const
FairMQMessagePtr FairMQTransportFactorySHM::CreateMessage(FairMQUnmanagedRegionPtr& region, void* data, const size_t size, void* hint)
{
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, region, data, size, hint));
return unique_ptr<FairMQMessage>(new FairMQMessageSHM(*fManager, region, data, size, hint, this));
}
FairMQSocketPtr FairMQTransportFactorySHM::CreateSocket(const string& type, const string& name) const
@@ -244,7 +244,7 @@ FairMQPollerPtr FairMQTransportFactorySHM::CreatePoller(const vector<FairMQChann
return unique_ptr<FairMQPoller>(new FairMQPollerSHM(channels));
}
FairMQPollerPtr FairMQTransportFactorySHM::CreatePoller(const vector<const FairMQChannel*>& channels) const
FairMQPollerPtr FairMQTransportFactorySHM::CreatePoller(const vector<FairMQChannel*>& channels) const
{
return unique_ptr<FairMQPoller>(new FairMQPollerSHM(channels));
}