mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
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:
@@ -75,17 +75,15 @@ std::vector<const ElemT, boost::container::pmr::polymorphic_allocator<const Elem
|
||||
};
|
||||
|
||||
//_________________________________________________________________________________________________
|
||||
/// Return a vector of const ElemT, takes ownership of the message, needs an
|
||||
/// upstream global
|
||||
/// ChannelResource to register the message.
|
||||
/// Return a vector of const ElemT, takes ownership of the message
|
||||
template<typename ElemT>
|
||||
std::vector<const ElemT, OwningMessageSpectatorAllocator<const ElemT>>
|
||||
adoptVector(size_t nelem, ChannelResource *upstream, FairMQMessagePtr message)
|
||||
adoptVector(size_t nelem, FairMQMessagePtr message)
|
||||
{
|
||||
return std::vector<const ElemT, OwningMessageSpectatorAllocator<const ElemT>>(
|
||||
nelem,
|
||||
OwningMessageSpectatorAllocator<const ElemT>(
|
||||
MessageResource{std::move(message), upstream}));
|
||||
MessageResource{std::move(message)}));
|
||||
};
|
||||
|
||||
//_________________________________________________________________________________________________
|
||||
@@ -93,7 +91,7 @@ std::vector<const ElemT, OwningMessageSpectatorAllocator<const ElemT>>
|
||||
// This returns a unique_ptr of const vector, does not allow modifications at
|
||||
// the cost of pointer
|
||||
// semantics for access.
|
||||
// use auto or decltype to catch the return value (or use span)
|
||||
// use auto or decltype to catch the return type.
|
||||
// template<typename ElemT>
|
||||
// auto adoptVector(size_t nelem, FairMQMessage* message)
|
||||
//{
|
||||
|
Reference in New Issue
Block a user