FairMQ/fairmq/FairMQUnmanagedRegion.h
Alexey Rybalchenko 58a312b730 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/
2017-11-29 09:06:17 +01:00

30 lines
1.1 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" *
********************************************************************************/
#ifndef FAIRMQUNMANAGEDREGION_H_
#define FAIRMQUNMANAGEDREGION_H_
#include <cstddef> // size_t
#include <memory> // std::unique_ptr
#include <functional> // std::function
using FairMQRegionCallback = std::function<void(void*, size_t)>;
class FairMQUnmanagedRegion
{
public:
virtual void* GetData() const = 0;
virtual size_t GetSize() const = 0;
virtual ~FairMQUnmanagedRegion() {};
};
using FairMQUnmanagedRegionPtr = std::unique_ptr<FairMQUnmanagedRegion>;
#endif /* FAIRMQUNMANAGEDREGION_H_ */