LLVM API Documentation

hash_set.h

Go to the documentation of this file.
00001 /* include/llvm/ADT/hash_set.h.  Generated from hash_set.h.in by configure.  */
00002 //==-- llvm/ADT/hash_set.h - "Portable" wrapper around hash_set --*- C++ -*-==//
00003 //
00004 //                     The LLVM Compiler Infrastructure
00005 //
00006 // This file is distributed under the University of Illinois Open Source
00007 // License. See LICENSE.TXT for details.
00008 //
00009 //===----------------------------------------------------------------------===//
00010 // vim:ft=cpp
00011 //
00012 // This file provides a wrapper around the mysterious <hash_set> header file
00013 // that seems to move around between GCC releases into and out of namespaces at
00014 // will.  #including this header will cause hash_set to be available in the
00015 // global namespace.
00016 //
00017 //===----------------------------------------------------------------------===//
00018 
00019 #ifndef LLVM_ADT_HASH_SET_H
00020 #define LLVM_ADT_HASH_SET_H
00021 
00022 // Compiler Support Matrix
00023 //
00024 // Version   Namespace   Header File
00025 //  2.95.x       ::        hash_set
00026 //  3.0.4       std      ext/hash_set
00027 //  3.1      __gnu_cxx   ext/hash_set
00028 //  HP aCC6     std      stdex/rw/hashset.h
00029 //  MS VC++    stdext      hash_set
00030 
00031 #define HAVE_GNU_EXT_HASH_SET 1
00032 #define HAVE_STD_EXT_HASH_SET 0
00033 #define HAVE_GLOBAL_HASH_SET 0
00034 /* #undef HAVE_RW_STDEX_HASH_SET_H */
00035 
00036 // GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
00037 // the __gnu_cxx namespace.
00038 #if HAVE_GNU_EXT_HASH_SET
00039 # include <ext/hash_set>
00040 # ifndef HASH_NAMESPACE
00041 #  define HASH_NAMESPACE __gnu_cxx
00042 # endif
00043 
00044 // GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
00045 #elif HAVE_STD_EXT_HASH_SET
00046 # include <ext/hash_set>
00047 # ifndef HASH_NAMESPACE
00048 #  define HASH_NAMESPACE std
00049 # endif
00050 
00051 // Older compilers such as GCC before version 3.0 do not keep
00052 // extensions in the `ext' directory, and ignore the `std' namespace.
00053 #elif HAVE_GLOBAL_HASH_SET
00054 # include <hash_set>
00055 # ifndef HASH_NAMESPACE
00056 #  define HASH_NAMESPACE std
00057 # endif
00058 
00059 // HP aCC doesn't include an SGI-like hash_set. For this platform (or
00060 // any others using Rogue Wave Software's Tools.h++ library), we wrap
00061 // around them in std::
00062 #elif HAVE_RW_STDEX_HASH_SET_H
00063 # include <rw/stdex/hashset.h>
00064 # ifndef HASH_NAMESPACE
00065 #  define HASH_NAMESPACE std
00066 # endif
00067 
00068 // Support Microsoft VC++.
00069 #elif defined(_MSC_VER)
00070 # include <hash_set>
00071 # ifndef HASH_NAMESPACE
00072 #  define HASH_NAMESPACE stdext
00073 # endif
00074 
00075 // Give a warning if we couldn't find it, instead of (or in addition to)
00076 // randomly doing something dumb.
00077 #else
00078 # warning "Autoconfiguration failed to find the hash_set header file."
00079 #endif
00080 
00081 // we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
00082 #ifdef HAVE_RW_STDEX_HASH_SET_H
00083 namespace HASH_NAMESPACE {
00084 
00085 /*
00086 template <class DataType> struct hash {
00087     unsigned int operator()(const unsigned int& x) const {
00088       return x;
00089     }
00090 };
00091 */
00092 
00093 template <typename ValueType,
00094   class _HashFcn = hash<ValueType>,
00095   class _EqualKey = equal_to<ValueType>,
00096   class _A = allocator <ValueType> >
00097 class hash_set :
00098   public rw_hashset<ValueType, class _HashFcn, class _EqualKey, class _A> {
00099 };
00100 
00101 } // end HASH_NAMESPACE;
00102 #endif
00103 
00104 using HASH_NAMESPACE::hash_set;
00105 
00106 // Include vector because ext/hash_set includes stl_vector.h and leaves
00107 // out specializations like stl_bvector.h, causing link conflicts.
00108 #include <vector>
00109 
00110 #include "llvm/ADT/HashExtras.h"
00111 
00112 #endif // LLVM_ADT_HASH_SET_H