//
// Copyright (c) 2009 Froduald Kabanza and the Université de Sherbrooke.
// Use of this software is permitted for non-commercial research purposes, and
// it may be copied or applied only for that use. All copies must include this
// copyright message.
// 
// This is a research prototype that has not gone through intensive tests and
// is delivered as is. It may still contain bugs. Froduald Kabanza and the
// Université de Sherbrooke disclaim any responsibility for damage that may be
// caused by using it.
//
// Please note that some files were inspired in part by the PDDL4J library:
// http://www.math-info.univ-paris5.fr/~pellier/software/software.php 
//
// Implementation: Simon Chamberland
// Project Manager: Froduald Kabanza
//

#ifndef _BINDINGS_ITERATOR_H
#define _BINDINGS_ITERATOR_H

#include <vector>

#include "Bindings.h"
#include "Term/ObjectParameterVariable.h"

namespace planning
{
  // TODO: make as a regular iterator?
  class BindingsIterator
  {
  public:
    BindingsIterator(const std::vector<const planning::ObjectParameterVariable*>& variables, 
                     const planning::Bindings* parentBindings);

    BindingsIterator(const std::vector<const planning::ObjectParameterVariable*>& variables);

    bool nextBinding();

    const planning::Bindings& getCurrentBindings() const;

  private:
    const std::vector<const planning::ObjectParameterVariable*>& m_variables;
    std::vector<planning::ObjectParameterVariable::object_const_iterator> m_currentObjects;
    bool m_initialized;

    planning::Bindings m_currentBindings;
  };

}

#endif