#pragma once
#include <memory>

namespace myapp::modbus {

class raw_data
{
public:
	static std::unique_ptr<raw_data> rtu();
	static std::unique_ptr<raw_data> tcp();

	virtual ~raw_data() = default;

	// pdu with slave_id
	virtual uint8_t* data() = 0;
	virtual int data_length() const = 0;
	virtual void data_length(int) = 0;

	virtual int size() const = 0;
	virtual void size(int) = 0;
	virtual int max_size() const noexcept = 0;

	virtual uint8_t& operator[](std::size_t pos) = 0;
	virtual uint8_t const& operator[](std::size_t pos) const = 0;
};

} /* namespace myapp::modbus */
