FairMQ/examples/advanced/Region/FairMQExampleRegionSampler.h
Alexey Rybalchenko 15479a58d1 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/
2018-05-02 13:51:55 +02:00

41 lines
1.2 KiB
C++

/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* FairMQExampleRegionSampler.h
*
* @since 2014-10-10
* @author A. Rybalchenko
*/
#ifndef FAIRMQEXAMPLEREGIONSAMPLER_H_
#define FAIRMQEXAMPLEREGIONSAMPLER_H_
#include <string>
#include <atomic>
#include "FairMQDevice.h"
class FairMQExampleRegionSampler : public FairMQDevice
{
public:
FairMQExampleRegionSampler();
virtual ~FairMQExampleRegionSampler();
protected:
virtual void InitTask();
virtual bool ConditionalRun();
virtual void ResetTask();
private:
int fMsgSize;
FairMQUnmanagedRegionPtr fRegion;
std::atomic<uint64_t> fNumUnackedMsgs;
};
#endif /* FAIRMQEXAMPLEREGIONSAMPLER_H_ */