5845f1a41d
This symbol is defined as a static member object inside of a boost detail header. When boost headers are used in a project that uses Boost in both the main binary as well as dlopen()'d shlibs, the top_ symbol gets duplicated and the metadata gets partitioned. We use the Boost shlib to unify both the main binary and the shlibs to use the same memory address for top_. This involves marking the templated object call_stack::top_ as "extern" and then declaring to Boost that we intend to use the shlibs.
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#ifndef _LIVOX_GEN1_IOURING_ASSEMBLY_ENGINE_H
|
|
#define _LIVOX_GEN1_IOURING_ASSEMBLY_ENGINE_H
|
|
|
|
#include <boostAsioLinkageFix.h>
|
|
#include <cstdint>
|
|
#include <cstddef>
|
|
#include <memory>
|
|
#include <functional>
|
|
#include <vector>
|
|
#include <chrono>
|
|
#include <atomic>
|
|
#include <liburing.h>
|
|
#include <boost/asio/io_service.hpp>
|
|
#include <boost/asio/deadline_timer.hpp>
|
|
#include <livoxProto1/device.h>
|
|
#include "frameAssemblyDesc.h"
|
|
|
|
namespace smo {
|
|
namespace stim_buff {
|
|
|
|
class PcloudStimulusBuffer;
|
|
|
|
class IoUringAssemblyEngine
|
|
{
|
|
public:
|
|
explicit IoUringAssemblyEngine(PcloudStimulusBuffer& parent);
|
|
~IoUringAssemblyEngine() = default;
|
|
|
|
bool setup();
|
|
void finalize();
|
|
void resetAndAssembleFrame();
|
|
void stop();
|
|
|
|
// Telemetry helpers
|
|
static size_t computePointsPerDgram(int returnMode);
|
|
static size_t computePointsPerFrame(int returnMode, size_t nDgramsPerFrame)
|
|
{ return computePointsPerDgram(returnMode) * nDgramsPerFrame; }
|
|
|
|
private:
|
|
PcloudStimulusBuffer& parent;
|
|
|
|
// Cached descriptor for reuse across iterations
|
|
std::shared_ptr<FrameAssemblyDesc> frameAssemblyDesc;
|
|
|
|
// io_uring infrastructure
|
|
struct io_uring ring;
|
|
bool isSetup;
|
|
|
|
// Stall detection timer
|
|
boost::asio::deadline_timer stallTimer;
|
|
|
|
void cancelIncompleteAndFillDummies();
|
|
};
|
|
|
|
} // namespace stim_buff
|
|
} // namespace smo
|
|
|
|
#endif // _LIVOX_GEN1_IOURING_ASSEMBLY_ENGINE_H
|
|
|
|
|