Files
Jungfraujoch/common/SendBufferControl.h
2024-11-22 21:25:20 +01:00

25 lines
794 B
C++

// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#ifndef JUNGFRAUJOCH_SENDBUFFERCONTROL_H
#define JUNGFRAUJOCH_SENDBUFFERCONTROL_H
#include "SendBuffer.h"
#include "ThreadSafeFIFO.h"
#include "ZeroCopyReturnValue.h"
#include "DiffractionExperiment.h"
class SendBufferControl {
ThreadSafeFIFO<uint32_t> send_buffer_avail;
std::vector<ZeroCopyReturnValue> send_buffer_zero_copy_ret_val;
SendBuffer &buffer;
public:
SendBufferControl(const DiffractionExperiment& experiment, SendBuffer &buffer);
ZeroCopyReturnValue *GetBufLocation();
size_t GetAvailBufLocations();
bool CheckIfBufferReturned(std::chrono::microseconds timeout);
};
#endif //JUNGFRAUJOCH_SENDBUFFERCONTROL_H