#ifndef __FORENSICS_NTFSALLOCATION_HH__
#define __FORENSICS_NTFSALLOCATION_HH__

#include "forensics-gecode.hh"
#include "unsafe.hh"
#include "error.hh"
#include "ntfsbitmap.hh"


class NTFSAllocation : public Gecode::Propagator
{
protected:
  const bool m_allocated;
  NTFSBitmapExtractor* m_bitmap_cache;
  Gecode::Int::IntView m_cluster;

public:
  NTFSAllocation (Gecode::Space& home, Gecode::Int::IntView cluster, NTFSBitmapExtractor* bitmap_cache, bool allocated);

  NTFSAllocation (Gecode::Space& home, bool share, NTFSAllocation& p);

  virtual Gecode::Propagator* copy (Gecode::Space& home, bool share);

  virtual size_t dispose (Gecode::Space& home);

  virtual Gecode::PropCost cost (const Gecode::Space& home, const Gecode::ModEventDelta& med) const;

  virtual Gecode::ExecStatus propagate (Gecode::Space& home, const Gecode::ModEventDelta& med);

  static Gecode::ExecStatus post (Gecode::Space& home, Gecode::Int::IntView cluster, NTFSBitmapExtractor* bitmap_cache, bool allocated);
};

void ntfs_allocated (Gecode::Space& home, Gecode::IntVar cluster, NTFSBitmapExtractor* bitmap_cache);
void ntfs_unallocated (Gecode::Space& home, Gecode::IntVar cluster, NTFSBitmapExtractor* bitmap_cache);

#endif
