summaryrefslogtreecommitdiff
path: root/libtnsl/src/box/iterator.tnsl
blob: 9fb3d6d473bc4039951444d0c2e56ccdf0bd6f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/##
	Copyright 2021 Kyle Gunger
    
    Dual licenced under the CDDL 1.0 and BSD 3-Clause licences.
    
    This file may only be used in accordance with one of the two
    licences.  You should have recieved a copy of each licence with
    the source code.  In the event that you did not recieve a copy
    of the licences, they may be found at the following URLs:
    
    CDDL 1.0:
    https://opensource.org/licenses/CDDL-1.0
    
    BSD 3-Clause:
    https://opensource.org/licenses/BSD-3-Clause
    
    THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO
    WARRENTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE
    EXPRESS OR IMPLIED
#/

# Interface for moving through a list
/; interface ForwardsIterator (type T)

	# Advance to the next element in the list
	/; next [bool]
	;/

	# Get the current element in the list
	/; current [T]
	;/
;/

# Interface for moving through a list forwards or backwards
/; interface TwoWayIterator (type T) extends ForwardsIterator(T)

	# Move to the previous element in the list
	/; prev [bool]
	;/
;/