18#ifndef _DECAF_UTIL_HASHCODE_H_
19#define _DECAF_UTIL_HASHCODE_H_
53 return arg.getHashCode();
60 return arg.getHashCode();
68 return arg->getHashCode();
78 return arg->getHashCode();
87 return arg ? 1231 : 1237;
91 #if defined(HAVE_WCHAR_T)
93 struct HashCode<unsigned char> :
public HashCodeUnaryBase<unsigned char> {
145 return (
int) (arg ^ (arg >> 32));
152 return (
int) ((
unsigned long long) arg ^ ((
unsigned long long) arg >> 32));
167 return (
int) ((
unsigned long long) value ^ ((
unsigned long long) value >> 32));
175 if (h == 0 && arg.length() > 0) {
176 std::string::const_iterator iter = arg.begin();
177 for (; iter != arg.end(); ++iter) {
178 h = 31 * h + (*iter);
189 if (h == 0 && arg.length() > 0) {
190 std::string::const_iterator iter = arg.begin();
191 for (; iter != arg.end(); ++iter) {
192 h = 31 * h + (*iter);
static long long doubleToLongBits(double value)
Returns a representation of the specified floating-point value according to the IEEE 754 floating-poi...
static int floatToIntBits(float value)
Returns a representation of the specified floating-point value according to the IEEE 754 floating-poi...
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
#define NULL
Definition Config.h:33
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25
Definition ArrayPointer.h:432
int operator()(const T *arg) const
Definition HashCode.h:66
int operator()(bool arg) const
Definition HashCode.h:86
int operator()(char arg) const
Definition HashCode.h:102
int operator()(const T &arg) const
Definition HashCode.h:59
int operator()(const T *arg) const
Definition HashCode.h:76
int operator()(const std::string &arg) const
Definition HashCode.h:187
int operator()(decaf::lang::Pointer< T > arg) const
Definition HashCode.h:201
int operator()(double arg) const
Definition HashCode.h:165
int operator()(float arg) const
Definition HashCode.h:158
int operator()(int arg) const
Definition HashCode.h:137
int operator()(long long arg) const
Definition HashCode.h:151
int operator()(short arg) const
Definition HashCode.h:123
int operator()(const std::string &arg) const
Definition HashCode.h:173
int operator()(unsigned int arg) const
Definition HashCode.h:130
int operator()(unsigned long long arg) const
Definition HashCode.h:144
int operator()(unsigned short arg) const
Definition HashCode.h:116
int operator()(wchar_t arg) const
Definition HashCode.h:109
Base HashCode template, specializations are created from this to account for the various native types...
Definition HashCode.h:50
int operator()(const T &arg) const
Definition HashCode.h:52
virtual ~HashCodeUnaryBase()
Definition HashCode.h:40
int result_type
Definition HashCode.h:38
T argument_type
Definition HashCode.h:37
#define const
Definition zconf.h:198