#ifndef _STIMULUS_BUFFER_H
#define _STIMULUS_BUFFER_H

#include <vector>
#include <memory>
#include <cstdint>
#include <atomic>
#include <mutex>
#include "stimFrame.h"
#include "deviceAttachmentSpec.h"

namespace smo {
namespace stim_buff {

/**
 * StimulusBuffer manages a collection of stimulus frames with simultaneity stamps.
 *
 * This buffer is designed to hold stimulus frames that have been assembled
 * from raw sensor data (e.g., Livox Avia point cloud data) and are ready
 * for processing by the mind layer.
 *
 * The buffer provides thread-safe operations for adding frames, retrieving
 * frames, and managing the buffer state.
 */
class StimulusBuffer
{
public:
	class PcloudFormatDesc
	{
	public:
		enum class Format
		{
			XYZ,
			XYZI,
		};

	public:
		Format format;
	};

public:
	explicit StimulusBuffer(
		const device::DeviceAttachmentSpec& deviceAttachmentSpec)
	: deviceAttachmentSpec(deviceAttachmentSpec)
	{}

	~StimulusBuffer() = default;

	// Non-copyable, movable
	StimulusBuffer(const StimulusBuffer&) = delete;
	StimulusBuffer& operator=(const StimulusBuffer&) = delete;
	StimulusBuffer(StimulusBuffer&&) = default;
	StimulusBuffer& operator=(StimulusBuffer&&) = default;

public:
	device::DeviceAttachmentSpec deviceAttachmentSpec;
	std::vector<StimFrame> frames_;
};

} // namespace stim_buff
} // namespace smo

#endif // _STIMULUS_BUFFER_H
