/*
 * class PeriodicPosition
 *
 * $Date$
 * $Revision$
 *
 */

#ifndef PERIODIC_POSITION_HH__
#define PERIODIC_POSITION_HH__

#include "Wave/VectorPosition.hh"

/** 
 * @addtogroup Wave 
 * @{ */

/** 
 * A Periodic index (abstract). Performs symmetric, periodic and whatever
 * extensions to a vector or a part of it.
 */
/*abstract*/
class 
PeriodicPosition: public VectorPosition
{
public:
  /** Constructor. Calls the superclass' constructor. */
  PeriodicPosition (void) : VectorPosition () { } 
  
  /** Constructor. Calls the superclass' constructor. */
  PeriodicPosition (int newsize) : VectorPosition (newsize) { } 
  
  /** Calculate real position assuming a given vector start and length. 
   * If a position is greater than the assumed size or less than the 
   * assumed start position we mirror the position back into range.
   * @param pos
   * the requested position
   * @param start
   * the assumed start
   * @param end
   * the assumed end point
   * @param sign
   * always 1
   * @return
   * the new position */
  int pos (int pos, int start, int end, int &sign);
}; /* class PeriodicPosition */

/** @} */

#endif /* PERIODIC_POSITION_HH__ */

