|
| 1 | + ! ======================= |
| 2 | + ! iter_of |
| 3 | + ! ======================= |
| 4 | + function __MANGLE(iter_of)(this) result(value) |
| 5 | + class(__alt_set_iterator), intent(in) :: this |
| 6 | + __T_declare_result__, pointer :: value |
| 7 | + |
| 8 | + print*,__FILE__,__LINE__ |
| 9 | + value => null() |
| 10 | + print*,__FILE__,__LINE__, this%current |
| 11 | + print*,__FILE__,__LINE__, __MANGLE(exists)(this%current) |
| 12 | + print*,__FILE__,__LINE__, associated(this%tree) |
| 13 | + if (__MANGLE(exists)(this%current)) then |
| 14 | + value => this%tree%items%of(this%current) |
| 15 | + end if |
| 16 | + print*,__FILE__,__LINE__ |
| 17 | + end function __MANGLE(iter_of) |
| 18 | + |
| 19 | + ! ======================= |
| 20 | + ! iter_next |
| 21 | + ! ======================= |
| 22 | + subroutine __MANGLE(iter_next)(this) |
| 23 | + class(__alt_set_iterator), intent(inout) :: this |
| 24 | + |
| 25 | + call this%tree%advpos(this%current, __RIGHT) |
| 26 | + |
| 27 | + end subroutine __MANGLE(iter_next) |
| 28 | + |
| 29 | + ! ======================= |
| 30 | + ! iter_prev |
| 31 | + ! ======================= |
| 32 | + subroutine __MANGLE(iter_prev)(this) |
| 33 | + class(__alt_set_iterator), intent(inout) :: this |
| 34 | + |
| 35 | + call this%tree%advpos(this%current, __LEFT) |
| 36 | + |
| 37 | + end subroutine __MANGLE(iter_prev) |
| 38 | + |
| 39 | + ! ======================= |
| 40 | + ! equalIters |
| 41 | + ! ======================= |
| 42 | + logical function __MANGLE(iter_equal)(a, b) result(eq) |
| 43 | + type(__alt_set_iterator), intent(in) :: a |
| 44 | + type(__alt_set_iterator), intent(in) :: b |
| 45 | + |
| 46 | + eq = (a%current == b%current) |
| 47 | + |
| 48 | + end function __MANGLE(iter_equal) |
| 49 | + |
| 50 | + ! ======================= |
| 51 | + ! nequal |
| 52 | + ! ======================= |
| 53 | + logical function __MANGLE(iter_not_equal)(a, b) result(ne) |
| 54 | + implicit none |
| 55 | + class(__alt_set_iterator), intent(in) :: a, b |
| 56 | + |
| 57 | + ne = .not. (a == b) |
| 58 | + |
| 59 | + end function __MANGLE(iter_not_equal) |
| 60 | + |
| 61 | + |
| 62 | + subroutine __MANGLE(iter_advance_size_kind)(it, n) |
| 63 | + type(__alt_set_iterator), intent(inout) :: it |
| 64 | + integer(kind=__gftl_size_kind), intent(in) :: n |
| 65 | + |
| 66 | + integer :: i |
| 67 | + |
| 68 | + do i = 1, n |
| 69 | + call it%next() |
| 70 | + end do |
| 71 | + |
| 72 | + return |
| 73 | + end subroutine __MANGLE(iter_advance_size_kind) |
| 74 | + |
| 75 | + subroutine __MANGLE(iter_advance_default)(it, n) |
| 76 | + type(__alt_set_iterator), intent(inout) :: it |
| 77 | + integer, intent(in) :: n |
| 78 | + |
| 79 | + integer :: i |
| 80 | + |
| 81 | + do i = 1, n |
| 82 | + call it%next() |
| 83 | + end do |
| 84 | + |
| 85 | + return |
| 86 | + end subroutine __MANGLE(iter_advance_default) |
| 87 | + |
| 88 | + |
| 89 | + function __MANGLE(iter_begin)(cont) result(begin) |
| 90 | + type(__alt_set_iterator) :: begin |
| 91 | + type(__alt_set), target, intent(in) :: cont |
| 92 | + |
| 93 | + begin = cont%begin() |
| 94 | + |
| 95 | + return |
| 96 | + end function __MANGLE(iter_begin) |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + function __MANGLE(iter_end)(cont) result(end) |
| 101 | + type(__alt_set_iterator) :: end |
| 102 | + type(__alt_set), target, intent(in) :: cont |
| 103 | + |
| 104 | + end = cont%end() |
| 105 | + |
| 106 | + end function __MANGLE(iter_end) |
| 107 | + |
| 108 | + |
| 109 | + function __MANGLE(iter_ftn_begin)(cont) result(begin) |
| 110 | + type(__alt_set_iterator) :: begin |
| 111 | + type(__alt_set), target, intent(in) :: cont |
| 112 | + |
| 113 | + begin = cont%ftn_begin() |
| 114 | + |
| 115 | + return |
| 116 | + end function __MANGLE(iter_ftn_begin) |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + function __MANGLE(iter_ftn_end)(cont) result(end) |
| 121 | + type(__alt_set_iterator) :: end |
| 122 | + type(__alt_set), target, intent(in) :: cont |
| 123 | + |
| 124 | + end = cont%ftn_end() |
| 125 | + |
| 126 | + end function __MANGLE(iter_ftn_end) |
| 127 | + |
| 128 | + |
| 129 | + function __MANGLE(iter_next_1)(it) result(new_it) |
| 130 | + type(__alt_set_iterator) :: new_it |
| 131 | + type(__alt_set_iterator), intent(in) :: it |
| 132 | + |
| 133 | + new_it = next(it,1) |
| 134 | + |
| 135 | + return |
| 136 | + end function __MANGLE(iter_next_1) |
| 137 | + |
| 138 | + function __MANGLE(iter_next_n_size_kind)(it, n) result(new_it) |
| 139 | + type(__alt_set_iterator) :: new_it |
| 140 | + type(__alt_set_iterator), intent(in) :: it |
| 141 | + integer(kind=__gftl_size_kind), intent(in) :: n |
| 142 | + |
| 143 | + integer :: i |
| 144 | + |
| 145 | + new_it = it |
| 146 | + do i = 1, n |
| 147 | + call new_it%next() |
| 148 | + end do |
| 149 | + |
| 150 | + return |
| 151 | + end function __MANGLE(iter_next_n_size_kind) |
| 152 | + |
| 153 | + function __MANGLE(iter_next_n_default)(it, n) result(new_it) |
| 154 | + type(__alt_set_iterator) :: new_it |
| 155 | + type(__alt_set_iterator), intent(in) :: it |
| 156 | + integer, intent(in) :: n |
| 157 | + |
| 158 | + integer :: i |
| 159 | + |
| 160 | + new_it = it |
| 161 | + do i = 1, n |
| 162 | + call new_it%next() |
| 163 | + end do |
| 164 | + |
| 165 | + return |
| 166 | + end function __MANGLE(iter_next_n_default) |
| 167 | + |
| 168 | + function __MANGLE(iter_prev_1)(it) result(new_it) |
| 169 | + type(__alt_set_iterator) :: new_it |
| 170 | + type(__alt_set_iterator), intent(in) :: it |
| 171 | + |
| 172 | + new_it = prev(it,1) |
| 173 | + |
| 174 | + return |
| 175 | + end function __MANGLE(iter_prev_1) |
| 176 | + |
| 177 | + function __MANGLE(iter_prev_n_size_kind)(it, n) result(new_it) |
| 178 | + type(__alt_set_iterator) :: new_it |
| 179 | + type(__alt_set_iterator), intent(in) :: it |
| 180 | + integer(kind=__gftl_size_kind), intent(in) :: n |
| 181 | + |
| 182 | + integer :: i |
| 183 | + |
| 184 | + new_it = it |
| 185 | + do i = 1, n |
| 186 | + call new_it%prev() |
| 187 | + end do |
| 188 | + |
| 189 | + return |
| 190 | + end function __MANGLE(iter_prev_n_size_kind) |
| 191 | + |
| 192 | + function __MANGLE(iter_prev_n_default)(it, n) result(new_it) |
| 193 | + type(__alt_set_iterator) :: new_it |
| 194 | + type(__alt_set_iterator), intent(in) :: it |
| 195 | + integer, intent(in) :: n |
| 196 | + |
| 197 | + integer :: i |
| 198 | + |
| 199 | + new_it = it |
| 200 | + do i = 1, n |
| 201 | + call new_it%prev() |
| 202 | + end do |
| 203 | + |
| 204 | + return |
| 205 | + end function __MANGLE(iter_prev_n_default) |
| 206 | + |
0 commit comments