28 static uint64_t getTimeMillis(boost::posix_time::ptime time);
31 static uint64_t currentTimeMillis();
37 static int32_t getNextSize(int32_t targetSize);
41 static int32_t getShrinkSize(int32_t currentSize, int32_t targetSize);
48 static int32_t bytesDifference(uint8_t* bytes1, int32_t len1, uint8_t* bytes2, int32_t len2);
50 template <
typename TYPE>
53 return type->hashCode();
56 template <
typename TYPE>
62 template <
typename ITER,
typename PRED>
63 static int32_t
hashCode(ITER first, ITER last, PRED pred)
66 for (ITER hash = first; hash != last; ++hash)
67 code = code * 31 + pred(*hash);
72 static int32_t hashCode(
const wchar_t* array, int32_t start, int32_t end);
75 static int32_t hashCode(
const uint8_t* array, int32_t start, int32_t end);
78 static int32_t hashCode(
bool value);
81 template <
typename SOURCE,
typename DEST>
82 static void arrayCopy(SOURCE source, int32_t sourceOffset, DEST dest, int32_t destOffset, int32_t length)
84 std::copy(source + sourceOffset, source + sourceOffset + length, dest + destOffset);
88 template <
typename DEST,
typename FILL>
89 static void arrayFill(DEST dest, int32_t destFrom, int32_t destTo, FILL value)
91 std::fill(dest + destFrom, dest + destTo, value);
96 static int32_t doubleToIntBits(
double value);
100 static int32_t doubleToRawIntBits(
double value);
104 static double intBitsToDouble(int32_t bits);
108 static int64_t doubleToLongBits(
double value);
112 static int64_t doubleToRawLongBits(
double value);
116 static double longBitsToDouble(int64_t bits);
119 static bool isInfinite(
double value);
122 static bool isNaN(
double value);
125 template <
typename TYPE>
128 return boost::dynamic_pointer_cast<TYPE>(object);
135 static int64_t unsignedShift(int64_t num, int64_t shift);
138 static int32_t unsignedShift(int32_t num, int32_t shift);