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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
|
!
! File: sort_CompInt_Impl.F90
! Symbol: sort.CompInt-v0.1
! Symbol Type: class
! Babel Version: 0.10.2
! Description: Server-side implementation for sort.CompInt
!
! WARNING: Automatically generated; only changes within splicers preserved
!
! babel-version = 0.10.2
!
!
! Symbol "sort.CompInt" (version 0.1)
!
! Compare two Integer's. By default, this will sort in increasing order.
!
#include "sort_CompInt_fAbbrev.h"
#include "sidl_ClassInfo_fAbbrev.h"
#include "sort_Comparator_fAbbrev.h"
#include "sidl_BaseInterface_fAbbrev.h"
#include "sidl_BaseClass_fAbbrev.h"
! DO-NOT-DELETE splicer.begin(_miscellaneous_code_start)
#include "sort_Integer_fAbbrev.h"
! DO-NOT-DELETE splicer.end(_miscellaneous_code_start)
!
! Class constructor called when the class is created.
!
recursive subroutine sort_CompInt__ctor_mi(self)
use sort_CompInt
use sort_CompInt_impl
! DO-NOT-DELETE splicer.begin(sort.CompInt._ctor.use)
! Insert use statements here...
! DO-NOT-DELETE splicer.end(sort.CompInt._ctor.use)
implicit none
type(sort_CompInt_t) :: self ! in
! DO-NOT-DELETE splicer.begin(sort.CompInt._ctor)
type(sort_CompInt_wrap) :: privatedata
allocate(privatedata%d_private_data)
privatedata%d_private_data%d_increasing = .true.
call sort_CompInt__set_data_m(self, privatedata)
! DO-NOT-DELETE splicer.end(sort.CompInt._ctor)
end subroutine sort_CompInt__ctor_mi
!
! Class destructor called when the class is deleted.
!
recursive subroutine sort_CompInt__dtor_mi(self)
use sort_CompInt
use sort_CompInt_impl
! DO-NOT-DELETE splicer.begin(sort.CompInt._dtor.use)
! Insert use statements here...
! DO-NOT-DELETE splicer.end(sort.CompInt._dtor.use)
implicit none
type(sort_CompInt_t) :: self ! in
! DO-NOT-DELETE splicer.begin(sort.CompInt._dtor)
type(sort_CompInt_wrap) :: privatedata
call sort_CompInt__get_data_m(self, privatedata)
deallocate(privatedata%d_private_data)
! DO-NOT-DELETE splicer.end(sort.CompInt._dtor)
end subroutine sort_CompInt__dtor_mi
!
! Static class initializer called exactly once before any user-defined method is dispatched
!
recursive subroutine sort_CompInt__load_mi()
use sort_CompInt
use sort_CompInt_impl
! DO-NOT-DELETE splicer.begin(sort.CompInt._load.use)
! Insert use statements here...
! DO-NOT-DELETE splicer.end(sort.CompInt._load.use)
implicit none
! DO-NOT-DELETE splicer.begin(sort.CompInt._load)
! Insert the implementation here...
! DO-NOT-DELETE splicer.end(sort.CompInt._load)
end subroutine sort_CompInt__load_mi
!
! If increasing is true, this will cause the comparator to
! report a normal definition of less than; otherwise, it will
! reverse the normal ordering.
!
recursive subroutine setSortIncreasinggv7cy_9zwwk_mi(self, increasing)
use sort_CompInt
use sort_CompInt_impl
! DO-NOT-DELETE splicer.begin(sort.CompInt.setSortIncreasing.use)
! Insert use statements here...
! DO-NOT-DELETE splicer.end(sort.CompInt.setSortIncreasing.use)
implicit none
type(sort_CompInt_t) :: self ! in
logical :: increasing ! in
! DO-NOT-DELETE splicer.begin(sort.CompInt.setSortIncreasing)
type(sort_CompInt_wrap) :: privatedata
call sort_CompInt__get_data_m(self, privatedata)
privatedata%d_private_data%d_increasing = increasing
! DO-NOT-DELETE splicer.end(sort.CompInt.setSortIncreasing)
end subroutine setSortIncreasinggv7cy_9zwwk_mi
!
! This method is used to define an ordering of objects. This method
! will return -1 if i1 < i2, 0 if i1 = i2; and 1 if i1 > i2.
!
recursive subroutine sort_CompInt_compare_mi(self, i1, i2, retval)
use sidl_BaseInterface
use sort_CompInt
use sort_CompInt_impl
! DO-NOT-DELETE splicer.begin(sort.CompInt.compare.use)
use sort_Integer
! DO-NOT-DELETE splicer.end(sort.CompInt.compare.use)
implicit none
type(sort_CompInt_t) :: self ! in
type(sidl_BaseInterface_t) :: i1 ! in
type(sidl_BaseInterface_t) :: i2 ! in
integer (selected_int_kind(9)) :: retval ! out
! DO-NOT-DELETE splicer.begin(sort.CompInt.compare)
type(sort_Integer_t) int1, int2
type(sort_CompInt_wrap) :: privatedata
integer(selected_int_kind(9)) val1, val2
logical increasing
retval = 0
call sort_CompInt__get_data_m(self, privatedata)
increasing = privatedata%d_private_data%d_increasing
call cast(i1, int1)
call cast(i2, int2)
if (not_null(int1) .and. not_null(int2)) then
call getValue(int1, val1)
call getValue(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
! DO-NOT-DELETE splicer.end(sort.CompInt.compare)
end subroutine sort_CompInt_compare_mi
! DO-NOT-DELETE splicer.begin(_miscellaneous_code_end)
! Insert extra code here...
! DO-NOT-DELETE splicer.end(_miscellaneous_code_end)
|