<commit_before>/**
 * Copyright 2007 FLWOR Foundation
 *
 * Author: <NAME> (<EMAIL>)
 */

#ifndef XQP_NOARYBASE_H
#define XQP_NOARYBASE_H

#include "runtime/base/iterator.h"

namespace xqp
{
  /**
   * Superclass for all iterators which have no child iterators
   * and no additional state variables.
   */
  template <class IterType>
  class NoaryBaseIterator : public Batcher<IterType>
  {
    public:
      NoaryBaseIterator ( const yy::location& loc );
      virtual ~NoaryBaseIterator();

      void resetImpl ( PlanState& planState );
      void releaseResourcesImpl ( PlanState& planState );

      virtual uint32_t getStateSize() const { return sizeof ( PlanIterator::PlanIteratorState ); }
      virtual uint32_t getStateSizeOfSubtree() const { return getStateSize(); }
      virtual void setOffset ( PlanState& planState, uint32_t& offset );
  }; /* class NoaryBaseIterator */

  /* begin class NoaryBaseIterator */
  template <class IterType>
  NoaryBaseIterator<IterType>::NoaryBaseIterator ( const yy::location& loc )
  :
  Batcher<IterType> ( loc )
  {}


  template <class IterType>
  NoaryBaseIterator<IterType>::~NoaryBaseIterator()
  {}


  template <class IterType>
  void
  NoaryBaseIterator<IterType>::resetImpl ( PlanState& planState )
  {
    PlanIterator::PlanIteratorState* state;
    GET_STATE ( PlanIterator::PlanIteratorState, state, planState );
    state->reset();
  }


  template <class IterType>
  void
  NoaryBaseIterator<IterType>::releaseResourcesImpl ( PlanState& planState )
  {
  }


  template <class IterType>
  void
  NoaryBaseIterator<IterType>::setOffset (
  PlanState& planState,
  uint32_t& offset )
  {
    this->stateOffset = offset;
    offset += getStateSize();
  }
  /* end class NoaryBaseIterator */
}; /* namespace xqp*/

#endif /* XQP_NOARYBASE_H */
<commit_msg>fix implementations of variable iterators (for, let, and external)<commit_after>/**
 * Copyright 2007 FLWOR Foundation
 *
 * Author: <NAME> (<EMAIL>)
 */

#ifndef XQP_NOARYBASE_H
#define XQP_NOARYBASE_H

#include "runtime/base/iterator.h"

namespace xqp
{
/**
 * Superclass for all iterators which have no child iterators
 * and no additional state variables.
 */
template <class IterType>
class NoaryBaseIterator : public Batcher<IterType>
{
public:
  NoaryBaseIterator ( const yy::location& loc );
  virtual ~NoaryBaseIterator();

  void resetImpl ( PlanState& planState );
  void releaseResourcesImpl ( PlanState& planState );

  virtual uint32_t getStateSize() const { return sizeof(PlanIterator::PlanIteratorState); }
  virtual uint32_t getStateSizeOfSubtree() const { return getStateSize(); }
  virtual void setOffset(PlanState& planState, uint32_t& offset);
};


template <class IterType>
NoaryBaseIterator<IterType>::NoaryBaseIterator ( const yy::location& loc )
  :
  Batcher<IterType> ( loc )
{
}


template <class IterType>
NoaryBaseIterator<IterType>::~NoaryBaseIterator()
{
}


template <class IterType>
void
NoaryBaseIterator<IterType>::resetImpl ( PlanState& planState )
{
  PlanIterator::PlanIteratorState* state;
  GET_STATE(PlanIterator::PlanIteratorState, state, planState);
  state->reset();
}


template <class IterType>
void
NoaryBaseIterator<IterType>::releaseResourcesImpl(PlanState& planState)
{
  PlanIterator::PlanIteratorState* state;
  GET_STATE(PlanIterator::PlanIteratorState, state, planState);
  state->releaseResources();
}


template <class IterType>
void
NoaryBaseIterator<IterType>::setOffset (
    PlanState& planState,
    uint32_t& offset )
{
  this->stateOffset = offset;
  offset += getStateSize();
}


}; /* namespace xqp*/

#endif /* XQP_NOARYBASE_H */

{'fraction_non_alphanumeric': 0.11071132023249378, 'fraction_numerical': 0.0066426792139496265, 'mean_word_length': 4.727416798732171, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3600379', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1097, 'n_words': 264}