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
|
//
// File: sort_CompInt_Impl.cc
// 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
//
#include "sort_CompInt_Impl.hh"
//
// Includes for all method dependencies.
//
#ifndef included_sidl_BaseInterface_hh
#include "sidl_BaseInterface.hh"
#endif
#ifndef included_sidl_ClassInfo_hh
#include "sidl_ClassInfo.hh"
#endif
#line 23 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt._includes)
#include "sort_Integer.hh"
// DO-NOT-DELETE splicer.end(sort.CompInt._includes)
#line 27 "sort_CompInt_Impl.cc"
// user defined constructor
void sort::CompInt_impl::_ctor() {
#line 29 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt._ctor)
d_increasing = true;
// DO-NOT-DELETE splicer.end(sort.CompInt._ctor)
#line 35 "sort_CompInt_Impl.cc"
}
// user defined destructor
void sort::CompInt_impl::_dtor() {
#line 36 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt._dtor)
// add destruction details here
// DO-NOT-DELETE splicer.end(sort.CompInt._dtor)
#line 44 "sort_CompInt_Impl.cc"
}
// static class initializer
void sort::CompInt_impl::_load() {
#line 43 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt._load)
// guaranteed to be called at most once before any other method in this class
// DO-NOT-DELETE splicer.end(sort.CompInt._load)
#line 53 "sort_CompInt_Impl.cc"
}
// user defined static methods: (none)
// user defined non-static methods:
/**
* If increasing is true, this will cause the comparator to
* report a normal definition of less than; otherwise, it will
* reverse the normal ordering.
*/
void
sort::CompInt_impl::setSortIncreasing_impl (
/* in */bool increasing )
throw ()
{
#line 61 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt.setSortIncreasing)
d_increasing = increasing;
// DO-NOT-DELETE splicer.end(sort.CompInt.setSortIncreasing)
#line 73 "sort_CompInt_Impl.cc"
}
/**
* 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.
*/
int32_t
sort::CompInt_impl::compare_impl (
/* in */::ucxx::sidl::BaseInterface i1,
/* in */::ucxx::sidl::BaseInterface i2 )
throw ()
{
#line 76 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt.compare)
int32_t result = 0;
ucxx::sort::Integer int1 = ucxx::sidl::babel_cast<ucxx::sort::Integer>(i1);
ucxx::sort::Integer int2 = ucxx::sidl::babel_cast<ucxx::sort::Integer>(i2);
if (int1._not_nil() && int2._not_nil()) {
const int32_t val1 = int1.getValue();
const int32_t val2 = int2.getValue();
if (val1 < val2) result = -1;
if (val1 > val2) result = 1;
if (!d_increasing) result = -result;
}
return result;
// DO-NOT-DELETE splicer.end(sort.CompInt.compare)
#line 100 "sort_CompInt_Impl.cc"
}
#line 92 "../../../../babel/regression/sort/libUCxx/sort_CompInt_Impl.cc"
// DO-NOT-DELETE splicer.begin(sort.CompInt._misc)
// Put miscellaneous code here
// DO-NOT-DELETE splicer.end(sort.CompInt._misc)
#line 108 "sort_CompInt_Impl.cc"
|