#pragma once
#include "a83/macro.hpp"
//! данные и их размер
class data_t {
public:
  std::size_t size = 0;
  uint8_t* data = 0;
  bool empty() const { return !size and !data; }
  bool check() const { return size and data; }
  void free() {
    size = 0;
    delete[] data;
    data = 0;
  }
  data_t() = default;
  ~data_t() { free(); }
  data_t(CN(data_t) x) { free(); size = x.size; data = x.data; }
  void operator =(CN(data_t) x) { free(); size = x.size; data = x.data; }
}; // data_t