#ifndef __FORENSICS_BLOCKDATASOURCE_HH__
#define __FORENSICS_BLOCKDATASOURCE_HH__

#include "forensics.hh"
#include "datasource.hh"
#include "blockreadpropagator.hh"


class BlockDataSource : public DataSource 
{
protected:
  DataSource& m_parent;
  Gecode::IntVar m_unavailable;
  Gecode::IntVarArray m_blocks;
  int m_num_blocks;
  int m_min_block_value;
  int m_max_block_value;
  int m_bytes_per_block;

public:
  BlockDataSource (Gecode::Space& home, DataSource& parent, int num_blocks, int min_block_value, int max_block_value);

  BlockDataSource (bool share, Gecode::Space& home, DataSource& parent, BlockDataSource& ds);

  virtual Gecode::IntVar& unavailable ();

  virtual Gecode::IntVarArray& blocks ();

  virtual unsigned char read (int64_t offset) const;

  virtual void read (int64_t block, unsigned char* buffer) const;

  virtual void print (std::ostream& os) const;
};


#endif

