24 lines
704 B
C++
24 lines
704 B
C++
// Copyright (2019-2024) Paul Scherrer Institute
|
|
|
|
#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
|