#ifndef BLOBINDEX_H
#define BLOBINDEX_H

#include "persifs.h"
#include "superblob.h"

class blobIndex 
{
public:
  /**
   * Factory function. Load a blob index stored in file filename, or
   * create a new blob index and store it in that location if it
   * doesn't already exist.
   */
//   virtual static void create(str filename,
//                              callback<void, ref<blobIndex> >::ref cb,
//                              cbe error) = 0;

  /**
   * Get the block address of the block with fingerprint fp.
   */
  virtual void get(blockFingerprint fp,
                   callback<void, blockAddress>::ref cb,
                   cbe error) = 0;
  /**
   * Set the address of the block with fingerprint fp to addr. The
   * modification to the blob index is immediately committed to disk
   * (before the callback is called.)
   */
  virtual void put(blockFingerprint fp, blockAddress addr,
           callback<void>::ref cb, cbe error) = 0;
};

#endif // BLOBINDEX_H
