/*
  Copyright (c) 2010      Joachim Bonnet <joachim.bonnet@studium.uni-hamburg.de>
  Copyright (c)      2011 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
  Copyright (c) 2010-2011 Center for Bioinformatics, University of Hamburg

  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef MATCH_ITERATOR_REP_H
#define MATCH_ITERATOR_REP_H

#include <string.h>
#include "core/file.h"
#include "match.h"
#include "extended/match_iterator_api.h"

typedef GtMatchIteratorStatus (*GtMatchIteratorNextFunc)(GtMatchIterator*,
                                                         GtMatch**, GtError*);
typedef void (*GtMatchIteratorFreeFunc)(GtMatchIterator*);

struct GtMatchIteratorClass {
  size_t size;
  GtMatchIteratorNextFunc next;
  GtMatchIteratorFreeFunc free;
};

struct GtMatchIterator {
  const GtMatchIteratorClass *c_class;
};

const GtMatchIteratorClass* gt_match_iterator_class_new(size_t size,
                                           GtMatchIteratorNextFunc next,
                                           GtMatchIteratorFreeFunc free);
GtMatchIterator*            gt_match_iterator_create(const
                                                         GtMatchIteratorClass*);
void*                       gt_match_iterator_cast(const GtMatchIteratorClass*,
                                                   GtMatchIterator*);

#endif
