33 lines
892 B
C++
33 lines
892 B
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JUNGFRAUJOCH_ZEROCOPYRETURNVALUE_H
|
|
#define JUNGFRAUJOCH_ZEROCOPYRETURNVALUE_H
|
|
|
|
#include "ThreadSafeFIFO.h"
|
|
|
|
class ImageBuffer;
|
|
|
|
class ZeroCopyReturnValue {
|
|
void *ptr;
|
|
size_t payload_size;
|
|
int64_t image_number;
|
|
ImageBuffer &buf_ctrl;
|
|
uint32_t handle;
|
|
bool indexed;
|
|
public:
|
|
ZeroCopyReturnValue(void *in_ptr, ImageBuffer &in_ctrl, uint32_t in_handle);
|
|
|
|
void SetImageNumber(int64_t image_number);
|
|
void SetImageSize(size_t payload_size);
|
|
void SetIndexed(bool input);
|
|
|
|
void *GetImage() const;
|
|
[[nodiscard]] size_t GetImageSize() const;
|
|
[[nodiscard]] int64_t GetImageNumber() const;
|
|
[[nodiscard]] bool IsIndexed() const;
|
|
void release() const;
|
|
};
|
|
|
|
#endif //JUNGFRAUJOCH_ZEROCOPYRETURNVALUE_H
|