#ifndef _ITERATOR_H
#define _ITERATOR_H

#include "schema.h"
#include "tuple.h"
#include "predicate.h"

// Maximum data buffer size
#define MAX_BUF 1024

// Types of Iterators
#define SCAN_ITERATOR 1

// Scan iterator
typedef struct scan_iterator {
  // pointer to relation schema info
  relation_info *rel_info;
  // pointer to projection attribute list
  proj_attr_list *proj_list;
  // boolean expression
  bool_expr *expr;
  // data file
  FILE *data_file;
  // max buffer to read from file
  char buf[MAX_BUF];
  // buffer to store next tuple read from file
  tuple *next_tuple;
  // buffer to store the values of constants
  tuple *const_tuple;
  // flag used to keep track as to when the iterator becomes empty
  bool empty;
}scan_iterator;

#endif
