// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute // 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 send_buffer_avail; std::vector 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