mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
/********************************************************************************
|
|
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
* *
|
|
* This software is distributed under the terms of the *
|
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
* copied verbatim in the file "LICENSE" *
|
|
********************************************************************************/
|
|
|
|
#include "FairMQUnmanagedRegionZMQ.h"
|
|
#include "FairMQLogger.h"
|
|
|
|
using namespace std;
|
|
|
|
FairMQUnmanagedRegionZMQ::FairMQUnmanagedRegionZMQ(const size_t size, FairMQRegionCallback callback, const std::string& /* path = "" */, int /* flags = 0 */)
|
|
: fBuffer(malloc(size))
|
|
, fSize(size)
|
|
, fCallback(callback)
|
|
{
|
|
}
|
|
|
|
FairMQUnmanagedRegionZMQ::FairMQUnmanagedRegionZMQ(const size_t size, int64_t /* userFlags */, FairMQRegionCallback callback, const std::string& /* path = "" */, int /* flags = 0 */)
|
|
: fBuffer(malloc(size))
|
|
, fSize(size)
|
|
, fCallback(callback)
|
|
{
|
|
}
|
|
|
|
void* FairMQUnmanagedRegionZMQ::GetData() const
|
|
{
|
|
return fBuffer;
|
|
}
|
|
|
|
size_t FairMQUnmanagedRegionZMQ::GetSize() const
|
|
{
|
|
return fSize;
|
|
}
|
|
|
|
FairMQUnmanagedRegionZMQ::~FairMQUnmanagedRegionZMQ()
|
|
{
|
|
LOG(debug) << "destroying region";
|
|
free(fBuffer);
|
|
}
|