#ifndef _LIVOX_GEN1_MESH_STIMULUS_BUFFER_H
#define _LIVOX_GEN1_MESH_STIMULUS_BUFFER_H

#include <memory>
#include <user/stimulusBuffer.h>
#include <user/stagingBuffer.h>
#include <user/intrinThresholdParams.h>

namespace smo {
namespace stim_buff {

// Forward declaration
class StimulusProducer;

/**
 * MeshStimulusBuffer is a specialized StimulusBuffer for mesh data.
 * Intrinsic threshold params are not allowed on mesh qualeIfaceApi lines;
 * attach postrin(...) specifiers to a pcloudDarkAmbience line or
 * negtrin(...) specifiers to a pcloudLightAmbience line instead.
 */
class MeshStimulusBuffer
:	public StimulusBuffer
{
public:
	explicit MeshStimulusBuffer(
		StimulusProducer& parent,
		const std::shared_ptr<device::DeviceAttachmentSpec>& deviceAttachmentSpec,
		int histbuffMs,
		const StagingBuffer::IOEngineConstraints& inputEngineConstraints,
		const StagingBuffer::IOEngineConstraints& outputEngineConstraints,
		const SmoCallbacks& callbacks,
		cl_mem_flags flags)
	:	StimulusBuffer(
			parent, deviceAttachmentSpec, histbuffMs,
			inputEngineConstraints, outputEngineConstraints,
			callbacks, flags)
	{
		intrin::validateNoIntrinParamsOnQualeIface(
			deviceAttachmentSpec->qualeIfaceApi,
			deviceAttachmentSpec->qualeIfaceApiParams);
	}

	~MeshStimulusBuffer() = default;

	// Non-copyable, non-movable: inherited pinner lifetime is instance-bound
	MeshStimulusBuffer(const MeshStimulusBuffer&) = delete;
	MeshStimulusBuffer& operator=(const MeshStimulusBuffer&) = delete;
	MeshStimulusBuffer(MeshStimulusBuffer&&) = delete;
	MeshStimulusBuffer& operator=(MeshStimulusBuffer&&) = delete;
};

} // namespace stim_buff
} // namespace smo

#endif // _LIVOX_GEN1_MESH_STIMULUS_BUFFER_H
