Rename PcloudStimulusBuffer=>PcloudDataProducer
This prepares us for the split up of classes. We're going to split StimulusBuffer into two base classes: StimulusBuffer and StimulusProducer.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
#ifndef _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
||||
#define _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
||||
|
||||
#include <functional>
|
||||
#include <atomic>
|
||||
#include <user/stimulusBuffer.h>
|
||||
#include <livoxProto1/device.h>
|
||||
#include <asynchronousContinuation.h>
|
||||
#include <callback.h>
|
||||
#include "stagingBuffer.h"
|
||||
#include "ioUringAssemblyEngine.h"
|
||||
#include "openClCollatingAndMeshingEngine.h"
|
||||
|
||||
namespace smo {
|
||||
namespace stim_buff {
|
||||
|
||||
/**
|
||||
* PcloudDataProducer is a specialized StimulusBuffer for point cloud data.
|
||||
*
|
||||
* This class extends StimulusBuffer to handle point cloud-specific stimulus
|
||||
* frames, particularly those generated from LiDAR point cloud data. It
|
||||
* provides additional functionality for managing point cloud frame metadata
|
||||
* and processing.
|
||||
*/
|
||||
class PcloudDataProducer
|
||||
: public StimulusBuffer
|
||||
{
|
||||
public:
|
||||
explicit PcloudDataProducer(
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec> &deviceAttachmentSpec,
|
||||
std::shared_ptr<livoxProto1::Device> &device,
|
||||
const PcloudFormatDesc& formatDesc,
|
||||
int histbuffMs,
|
||||
size_t nDgramsPerStagingBufferFrame);
|
||||
|
||||
~PcloudDataProducer() = default;
|
||||
|
||||
// Non-copyable, movable
|
||||
PcloudDataProducer(const PcloudDataProducer&) = delete;
|
||||
PcloudDataProducer& operator=(const PcloudDataProducer&) = delete;
|
||||
PcloudDataProducer(PcloudDataProducer&&) = default;
|
||||
PcloudDataProducer& operator=(PcloudDataProducer&&) = default;
|
||||
|
||||
// Control methods
|
||||
void start() override;
|
||||
void stop() override;
|
||||
|
||||
protected:
|
||||
void stimFrameProductionTimesliceInd() override;
|
||||
|
||||
// Callback function type for produceFrameReq
|
||||
typedef std::function<void()> produceFrameReqCbFn;
|
||||
|
||||
public:
|
||||
void produceFrameReq(smo::Callback<produceFrameReqCbFn> callback);
|
||||
|
||||
std::shared_ptr<livoxProto1::Device> device;
|
||||
PcloudFormatDesc formatDesc;
|
||||
OpenClCollatingAndMeshingEngine openClCollatingAndMeshingEngine;
|
||||
StagingBuffer assemblyBuffer;
|
||||
IoUringAssemblyEngine ioUringAssemblyEngine;
|
||||
StagingBuffer collationBuffer;
|
||||
std::atomic<size_t> nAttachedStimBuffs{0};
|
||||
|
||||
private:
|
||||
class ProduceFrameReq;
|
||||
};
|
||||
|
||||
} // namespace stim_buff
|
||||
} // namespace smo
|
||||
|
||||
#endif // _LIVOX_GEN1_PCLOUD_DATA_PRODUCER_H
|
||||
Reference in New Issue
Block a user