Skip to content

Commit d2587ed

Browse files
mkrzewicdberzano
authored andcommitted
Compile against FairMQ 1.3.6
1 parent 25cb88c commit d2587ed

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

DataFormats/MemoryResources/include/MemoryResources/MemoryResources.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class FairMQMemoryResource : public boost::container::pmr::memory_resource
5858
/// return nullptr if returning a message does not make sense!
5959
virtual FairMQMessagePtr getMessage(void* p) = 0;
6060
virtual void* setMessage(FairMQMessagePtr) = 0;
61-
virtual const FairMQTransportFactory* getTransportFactory() const noexcept = 0;
61+
virtual FairMQTransportFactory* getTransportFactory() noexcept = 0;
6262
virtual size_t getNumberOfMessages() const noexcept = 0;
6363
};
6464

@@ -69,14 +69,14 @@ class FairMQMemoryResource : public boost::container::pmr::memory_resource
6969
class ChannelResource : public FairMQMemoryResource
7070
{
7171
protected:
72-
const FairMQTransportFactory* factory{ nullptr };
72+
FairMQTransportFactory* factory{ nullptr };
7373
// TODO: for now a map to keep track of allocations, something else would probably be faster, but for now this does
7474
// not need to be fast.
7575
boost::container::flat_map<void*, FairMQMessagePtr> messageMap;
7676

7777
public:
7878
ChannelResource() = delete;
79-
ChannelResource(const FairMQTransportFactory* _factory) : FairMQMemoryResource(), factory(_factory), messageMap()
79+
ChannelResource(FairMQTransportFactory* _factory) : FairMQMemoryResource(), factory(_factory), messageMap()
8080
{
8181
if (!factory) {
8282
throw std::runtime_error("Tried to construct from a nullptr FairMQTransportFactory");
@@ -94,7 +94,7 @@ class ChannelResource : public FairMQMemoryResource
9494
messageMap[addr] = std::move(message);
9595
return addr;
9696
}
97-
const FairMQTransportFactory* getTransportFactory() const noexcept override { return factory; }
97+
FairMQTransportFactory* getTransportFactory() noexcept override { return factory; }
9898

9999
size_t getNumberOfMessages() const noexcept override { return messageMap.size(); }
100100

@@ -130,7 +130,7 @@ class SpectatorMessageResource : public FairMQMemoryResource
130130
SpectatorMessageResource() = default;
131131
SpectatorMessageResource(const FairMQMessage* _message) : message(_message){};
132132
FairMQMessagePtr getMessage(void* p) override { return nullptr; }
133-
const FairMQTransportFactory* getTransportFactory() const noexcept override { return nullptr; }
133+
FairMQTransportFactory* getTransportFactory() noexcept override { return nullptr; }
134134
size_t getNumberOfMessages() const noexcept override { return 0; }
135135
void* setMessage(FairMQMessagePtr) override { return nullptr; }
136136

@@ -189,7 +189,7 @@ class MessageResource : public FairMQMemoryResource
189189
}
190190
FairMQMessagePtr getMessage(void* p) override { return mUpstream->getMessage(p); }
191191
void* setMessage(FairMQMessagePtr message) override { return mUpstream->setMessage(std::move(message)); }
192-
const FairMQTransportFactory* getTransportFactory() const noexcept override { return nullptr; }
192+
FairMQTransportFactory* getTransportFactory() noexcept override { return nullptr; }
193193
size_t getNumberOfMessages() const noexcept override { return mMessageData ? 1 : 0; }
194194

195195
protected:
@@ -397,20 +397,20 @@ class TransportAllocatorMap
397397
static TransportAllocatorMap S;
398398
return S;
399399
}
400-
ChannelResource* operator[](const FairMQTransportFactory* factory)
400+
ChannelResource* operator[](FairMQTransportFactory* factory)
401401
{
402402
return std::addressof(map.emplace(factory, factory).first->second);
403403
}
404404

405405
private:
406-
std::unordered_map<const FairMQTransportFactory*, ChannelResource> map{};
406+
std::unordered_map<FairMQTransportFactory*, ChannelResource> map{};
407407
TransportAllocatorMap(){};
408408
};
409409
}
410410

411411
//__________________________________________________________________________________________________
412412
/// Get the allocator associated to a transport factory
413-
inline static ChannelResource* getTransportAllocator(const FairMQTransportFactory* factory)
413+
inline static ChannelResource* getTransportAllocator(FairMQTransportFactory* factory)
414414
{
415415
return internal::TransportAllocatorMap::Instance()[factory];
416416
}

DataFormats/TimeFrame/test/TimeFrameTest.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ inline static void SimpleMsgCleanup(void* /*data*/, void* obj)
6767
}
6868

6969
template<typename Factory, typename T>
70-
inline static FairMQMessagePtr NewSimpleMessage(Factory const &f, const T& data)
70+
inline static FairMQMessagePtr NewSimpleMessage(Factory &f, const T& data)
7171
{
7272
auto* dataCopy = new T(data);
7373
return f.CreateMessage(dataCopy, sizeof(T), SimpleMsgCleanup<T>, dataCopy);

Framework/Core/include/Framework/Dispatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Dispatcher : public Task
4747

4848
private:
4949
void send(DataAllocator& dataAllocator, const DataRef& inputData, const Output& output) const;
50-
void sendFairMQ(const FairMQDevice* device, const DataRef& inputData, const std::string& fairMQChannel) const;
50+
void sendFairMQ(FairMQDevice* device, const DataRef& inputData, const std::string& fairMQChannel) const;
5151

5252
std::string mName;
5353
std::string mReconfigurationSource;

Framework/Core/include/Framework/FairMQDeviceProxy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class FairMQDeviceProxy
3737
}
3838

3939
/// Looks like what we really need in the headers is just the transport.
40-
const FairMQTransportFactory* getTransport();
41-
const FairMQTransportFactory* getTransport(const std::string& channel, int index);
40+
FairMQTransportFactory* getTransport();
41+
FairMQTransportFactory* getTransport(const std::string& channel, int index);
4242
std::unique_ptr<FairMQMessage> createMessage() const;
4343
std::unique_ptr<FairMQMessage> createMessage(const size_t size) const;
4444
private:

Framework/Core/src/Dispatcher.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void Dispatcher::send(DataAllocator& dataAllocator, const DataRef& inputData, co
9191
}
9292

9393
// ideally this should be in a separate proxy device or use Lifetime::External
94-
void Dispatcher::sendFairMQ(const FairMQDevice* device, const DataRef& inputData, const std::string& fairMQChannel) const
94+
void Dispatcher::sendFairMQ(FairMQDevice* device, const DataRef& inputData, const std::string& fairMQChannel) const
9595
{
9696
const auto* dh = header::get<header::DataHeader*>(inputData.header);
9797
assert(dh);

Framework/Core/src/FairMQDeviceProxy.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ namespace o2
1717
{
1818
namespace framework
1919
{
20-
const FairMQTransportFactory *FairMQDeviceProxy::getTransport() {
20+
FairMQTransportFactory *FairMQDeviceProxy::getTransport() {
2121
return mDevice->Transport();
2222
}
2323

24-
const FairMQTransportFactory* FairMQDeviceProxy::getTransport(const std::string& channel, int index)
24+
FairMQTransportFactory* FairMQDeviceProxy::getTransport(const std::string& channel, int index)
2525
{
2626
return mDevice->GetChannel(channel, index).Transport();
2727
}

0 commit comments

Comments
 (0)