mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 01:51:45 +00:00
FairMQ: Introduce callbacks for the FairMQUnmanagedRegion.
Callbacks are called when the data buffer of the message assiciated with the corresponding region is no longer needed by the transport. Example in examples/advanced/Region/
This commit is contained in:
committed by
Mohammad Al-Turany
parent
378c47c5e5
commit
58a312b730
@@ -10,20 +10,21 @@
|
||||
#define FAIRMQTRANSPORTFACTORYSHM_H_
|
||||
|
||||
#include "FairMQTransportFactory.h"
|
||||
#include "Manager.h"
|
||||
#include "FairMQMessageSHM.h"
|
||||
#include "FairMQSocketSHM.h"
|
||||
#include "FairMQPollerSHM.h"
|
||||
#include "FairMQShmCommon.h"
|
||||
#include <options/FairMQProgOptions.h>
|
||||
#include "Common.h"
|
||||
#include "FairMQUnmanagedRegionSHM.h"
|
||||
#include <options/FairMQProgOptions.h>
|
||||
|
||||
#include <boost/interprocess/sync/named_mutex.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
#include <boost/interprocess/sync/named_mutex.hpp>
|
||||
|
||||
class FairMQTransportFactorySHM : public FairMQTransportFactory
|
||||
{
|
||||
public:
|
||||
@@ -43,7 +44,7 @@ class FairMQTransportFactorySHM : public FairMQTransportFactory
|
||||
FairMQPollerPtr CreatePoller(const std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, const std::vector<std::string>& channelList) const override;
|
||||
FairMQPollerPtr CreatePoller(const FairMQSocket& cmdSocket, const FairMQSocket& dataSocket) const override;
|
||||
|
||||
FairMQUnmanagedRegionPtr CreateUnmanagedRegion(const size_t size) const override;
|
||||
FairMQUnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, FairMQRegionCallback callback = nullptr) const override;
|
||||
|
||||
FairMQ::Transport GetType() const override;
|
||||
|
||||
@@ -60,6 +61,8 @@ class FairMQTransportFactorySHM : public FairMQTransportFactory
|
||||
std::atomic<bool> fSendHeartbeats;
|
||||
boost::interprocess::named_mutex fShMutex;
|
||||
fair::mq::shmem::DeviceCounter* fDeviceCounter;
|
||||
std::string fSegmentName;
|
||||
std::unique_ptr<fair::mq::shmem::Manager> fManager;
|
||||
};
|
||||
|
||||
#endif /* FAIRMQTRANSPORTFACTORYSHM_H_ */
|
||||
|
Reference in New Issue
Block a user