Adopt FairMQMessage backed memory resource collection from AliceO2

Add a pmr interface to FairMQTransportFactory

refactor

Port the unit tests for MemoryResources

clang format
This commit is contained in:
mkrzewic
2018-07-30 18:39:30 +02:00
committed by Dennis Klein
parent 919193a1ad
commit 310b9647b5
9 changed files with 711 additions and 5 deletions

View File

@@ -9,11 +9,12 @@
#ifndef FAIRMQTRANSPORTFACTORY_H_
#define FAIRMQTRANSPORTFACTORY_H_
#include <FairMQMessage.h>
#include <FairMQSocket.h>
#include <FairMQPoller.h>
#include <FairMQUnmanagedRegion.h>
#include <FairMQLogger.h>
#include <FairMQMessage.h>
#include <FairMQPoller.h>
#include <FairMQSocket.h>
#include <FairMQUnmanagedRegion.h>
#include <fairmq/MemoryResources.h>
#include <fairmq/Transports.h>
#include <string>
@@ -30,6 +31,9 @@ class FairMQTransportFactory
/// Topology wide unique id
const std::string fkId;
/// The polymorphic memory resource associated with the transport
fair::mq::ChannelResource fMemoryResource{this};
public:
/// ctor
/// @param id Topology wide unique id, usually the device id.
@@ -37,6 +41,9 @@ class FairMQTransportFactory
auto GetId() const -> const std::string { return fkId; };
/// Get a pointer to the associated polymorphic memory resource
fair::mq::ChannelResource* GetMemoryResource() { return &fMemoryResource; }
/// @brief Create empty FairMQMessage
/// @return pointer to FairMQMessage
virtual FairMQMessagePtr CreateMessage() const = 0;