- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Configs/TI_DSP_BIOS/stl/stl_hash_fun.h

    00001 /*
    00002  * Copyright (c) 1996-1998
    00003  * Silicon Graphics Computer Systems, Inc.
    00004  *
    00005  * Permission to use, copy, modify, distribute and sell this software
    00006  * and its documentation for any purpose is hereby granted without fee,
    00007  * provided that the above copyright notice appear in all copies and
    00008  * that both that copyright notice and this permission notice appear
    00009  * in supporting documentation.  Silicon Graphics makes no
    00010  * representations about the suitability of this software for any
    00011  * purpose.  It is provided "as is" without express or implied warranty.
    00012  *
    00013  *
    00014  * Copyright (c) 1994
    00015  * Hewlett-Packard Company
    00016  *
    00017  * Permission to use, copy, modify, distribute and sell this software
    00018  * and its documentation for any purpose is hereby granted without fee,
    00019  * provided that the above copyright notice appear in all copies and
    00020  * that both that copyright notice and this permission notice appear
    00021  * in supporting documentation.  Hewlett-Packard Company makes no
    00022  * representations about the suitability of this software for any
    00023  * purpose.  It is provided "as is" without express or implied warranty.
    00024  *
    00025  */
    00026
    00027 /* NOTE: This is an internal header file, included by other STL headers.
    00028  *   You should not attempt to use it directly.
    00029  */
    00030
    00031 #ifndef __SGI_STL_HASH_FUN_H
    00032 #define __SGI_STL_HASH_FUN_H
    00033
    00034 #include <stddef.h>
    00035
    00036 __STL_BEGIN_NAMESPACE
    00037
    00038 template <class _Key> struct hash { };
    00039
    00040 inline size_t __stl_hash_string(const char* __s)
    00041 {
    00042   unsigned long __h = 0;
    00043   for ( ; *__s; ++__s)
    00044     __h = 5*__h + *__s;
    00045
    00046   return size_t(__h);
    00047 }
    00048
    00049 __STL_TEMPLATE_NULL struct hash<char*>
    00050 {
    00051   size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
    00052 };
    00053
    00054 __STL_TEMPLATE_NULL struct hash<const char*>
    00055 {
    00056   size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
    00057 };
    00058
    00059 __STL_TEMPLATE_NULL struct hash<char> {
    00060   size_t operator()(char __x) const { return __x; }
    00061 };
    00062 __STL_TEMPLATE_NULL struct hash<unsigned char> {
    00063   size_t operator()(unsigned char __x) const { return __x; }
    00064 };
    00065 __STL_TEMPLATE_NULL struct hash<signed char> {
    00066   size_t operator()(unsigned char __x) const { return __x; }
    00067 };
    00068 __STL_TEMPLATE_NULL struct hash<short> {
    00069   size_t operator()(short __x) const { return __x; }
    00070 };
    00071 __STL_TEMPLATE_NULL struct hash<unsigned short> {
    00072   size_t operator()(unsigned short __x) const { return __x; }
    00073 };
    00074 __STL_TEMPLATE_NULL struct hash<int> {
    00075   size_t operator()(int __x) const { return __x; }
    00076 };
    00077 __STL_TEMPLATE_NULL struct hash<unsigned int> {
    00078   size_t operator()(unsigned int __x) const { return __x; }
    00079 };
    00080 __STL_TEMPLATE_NULL struct hash<long> {
    00081   size_t operator()(long __x) const { return __x; }
    00082 };
    00083 __STL_TEMPLATE_NULL struct hash<unsigned long> {
    00084   size_t operator()(unsigned long __x) const { return __x; }
    00085 };
    00086
    00087 __STL_END_NAMESPACE
    00088
    00089 #endif /* __SGI_STL_HASH_FUN_H */
    00090
    00091 // Local Variables:
    00092 // mode:C++
    00093 // End: