# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0.  If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.

module iterator;

command new(b:bat[:any_2], size:lng) (:lng,:bat[:any_2])
address ITRnewChunk
comment "Create an iterator with fixed granule size.
	  The result is a view.";

command next(b:bat[:any_2], size:lng) (:lng, :bat[:any_2])
address ITRnextChunk
comment "Produce the next chunk for processing.";

pattern new(b:bat[:any_2]) (h:oid, t:any_2)
address ITRbunIterator
comment "Process the buns one by one extracted from a void table.";

pattern next(b:bat[:any_2]) (h:oid, t:any_2)
address ITRbunNext
comment "Produce the next bun for processing.";

command next(step:oid,last:oid):oid
address ITRnext_oid; 
command next(step:sht,last:sht):sht
address ITRnext_sht; 
command next(step:int,last:int):int
address ITRnext_int; 
command next(step:lng,last:lng):lng
address ITRnext_lng; 
command next(step:flt,last:flt):flt
address ITRnext_flt; 
command next(step:dbl,last:dbl):dbl
address ITRnext_dbl 
comment "Advances the iterator with a fixed value";
