#ifndef VIRTUALSQLTREENODEADAPTER_H
#define VIRTUALSQLTREENODEADAPTER_H

#include "../virtualmodeladapter/virtualmodeladapter.h"

#include <QPair>

template <typename DataType>
struct SqlTreeNode;

template <typename DataType>
class VirtualSqlTreeNodeAdapter : public VirtualModelAdapter {
private:
  using SqlTreeNode = SqlTreeNode<DataType>;

private:
  SqlTreeNode &m_root;

public:
  explicit VirtualSqlTreeNodeAdapter(SqlTreeNode &root);

public:
  SqlTreeNode *getValue(void *data);

public:
  int getItemsCount(void *parent) override;
  void *getItem(void *parent, int index) override;
  QVariant data(void *item, int role) override;
  void *getItemParent(void *item) override;
};

#include "virtualsqltreenodeadapter.tpp"

#endif // VIRTUALSQLTREENODEADAPTER_H
