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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
C
C File: sort_CompInt_Impl.f
C Symbol: sort.CompInt-v0.1
C Symbol Type: class
C Babel Version: 0.10.2
C Description: Server-side implementation for sort.CompInt
C
C WARNING: Automatically generated; only changes within splicers preserved
C
C babel-version = 0.10.2
C
C
C Symbol "sort.CompInt" (version 0.1)
C
C Compare two Integer's. By default, this will sort in increasing order.
C
C DO-NOT-DELETE splicer.begin(_miscellaneous_code_start)
C Insert extra code here...
C DO-NOT-DELETE splicer.end(_miscellaneous_code_start)
C
C Class constructor called when the class is created.
C
subroutine sort_CompInt__ctor_fi(self)
implicit none
C in sort.CompInt self
integer*8 self
C DO-NOT-DELETE splicer.begin(sort.CompInt._ctor)
C a data pointer equal to self means true
C a data pointer equal to 0 means false
call sort_CompInt__set_data_f(self, self)
C DO-NOT-DELETE splicer.end(sort.CompInt._ctor)
end
C
C Class destructor called when the class is deleted.
C
subroutine sort_CompInt__dtor_fi(self)
implicit none
C in sort.CompInt self
integer*8 self
C DO-NOT-DELETE splicer.begin(sort.CompInt._dtor)
C Insert the implementation here...
C DO-NOT-DELETE splicer.end(sort.CompInt._dtor)
end
C
C Static class initializer called exactly once before any user-defined method is dispatched
C
subroutine sort_CompInt__load_fi()
implicit none
C DO-NOT-DELETE splicer.begin(sort.CompInt._load)
C Insert the implementation here...
C DO-NOT-DELETE splicer.end(sort.CompInt._load)
end
C
C If increasing is true, this will cause the comparator to
C report a normal definition of less than; otherwise, it will
C reverse the normal ordering.
C
subroutine sort_CompInt_setSortIncreasing_fi(self, increasing)
implicit none
C in sort.CompInt self
integer*8 self
C in bool increasing
logical increasing
C DO-NOT-DELETE splicer.begin(sort.CompInt.setSortIncreasing)
integer*8 data
if (increasing) then
data = self
else
data = 0
endif
call sort_CompInt__set_data_f(self, data)
C DO-NOT-DELETE splicer.end(sort.CompInt.setSortIncreasing)
end
C
C This method is used to define an ordering of objects. This method
C will return -1 if i1 < i2, 0 if i1 = i2; and 1 if i1 > i2.
C
subroutine sort_CompInt_compare_fi(self, i1, i2, retval)
implicit none
C in sort.CompInt self
integer*8 self
C in sidl.BaseInterface i1
integer*8 i1
C in sidl.BaseInterface i2
integer*8 i2
C out int retval
integer*4 retval
C DO-NOT-DELETE splicer.begin(sort.CompInt.compare)
integer*8 int1, int2, data
integer*4 val1, val2
logical increasing
retval = 0
call sort_CompInt__get_data_f(self, data)
increasing = (data .eq. self)
call sort_Integer__cast_f(i1, int1)
call sort_Integer__cast_f(i2, int2)
if ((int1 .ne. 0) .and. (int2 .ne. 0)) then
call sort_Integer_getValue_f(int1, val1)
call sort_Integer_getValue_f(int2, val2)
if (val1 .lt. val2) then
retval = -1
endif
if (val1 .gt. val2) then
retval = 1
endif
if (.not. increasing) then
retval = -retval
endif
endif
C DO-NOT-DELETE splicer.end(sort.CompInt.compare)
end
C DO-NOT-DELETE splicer.begin(_miscellaneous_code_end)
C Insert extra code here...
C DO-NOT-DELETE splicer.end(_miscellaneous_code_end)
|