Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

vprTypes.h

Go to the documentation of this file.
00001 /****************** <VPR heading BEGIN do not edit this line> *****************
00002  *
00003  * VR Juggler Portable Runtime
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Patrick Hartling, Kevin Meinert, Carolina Cruz-Neira
00007  *
00008  * -----------------------------------------------------------------
00009  * File:          $RCSfile: vprTypes.h,v $
00010  * Date modified: $Date: 2003/02/21 22:59:13 $
00011  * Version:       $Revision: 1.16 $
00012  * -----------------------------------------------------------------
00013  *
00014  ****************** <VPR heading END do not edit this line> ******************/
00015 
00016 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00017  *
00018  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00019  *
00020  * Original Authors:
00021  *   Allen Bierbaum, Christopher Just,
00022  *   Patrick Hartling, Kevin Meinert,
00023  *   Carolina Cruz-Neira, Albert Baker
00024  *
00025  * This library is free software; you can redistribute it and/or
00026  * modify it under the terms of the GNU Library General Public
00027  * License as published by the Free Software Foundation; either
00028  * version 2 of the License, or (at your option) any later version.
00029  *
00030  * This library is distributed in the hope that it will be useful,
00031  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00032  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00033  * Library General Public License for more details.
00034  *
00035  * You should have received a copy of the GNU Library General Public
00036  * License along with this library; if not, write to the
00037  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00038  * Boston, MA 02111-1307, USA.
00039  *
00040  *************** <auto-copyright.pl END do not edit this line> ***************/
00041 
00042 #ifndef _VPR_TYPES_H_
00043 #define _VPR_TYPES_H_
00044 
00045 #include <vpr/vprConfig.h>
00046 
00047 #ifdef VPR_USE_NSPR
00048 #  include <vpr/md/NSPR/vprTypesNSPR.h>
00049 #else
00050 namespace vpr
00051 {
00052 #if SIZEOF_CHAR == 1
00053    typedef char Int8;
00054    typedef unsigned char Uint8;
00055 #endif
00056 
00057 #if SIZEOF_SHORT == 2
00058    typedef short Int16;
00059    typedef unsigned short Uint16;
00060 #elif SIZEOF_INT == 2
00061    typedef int Int16;
00062    typedef unsigned int Uint16;
00063 #endif
00064 
00065 #if SIZEOF_INT == 4
00066    typedef int Int32;
00067    typedef unsigned int Uint32;
00068 #elif SIZEOF_LONG == 4
00069    typedef long Int32;
00070    typedef unsigned long Uint32;
00071 #endif
00072 
00073 #if SIZEOF_LONG == 8
00074    typedef long Int64;
00075    typedef unsigned long Uint64;
00076 #elif SIZEOF_LONG_LONG == 8
00077    typedef long long Int64;
00078    typedef unsigned long long Uint64;
00079 #elif SIZEOF_INT == 8
00080    typedef int Int64;
00081    typedef unsigned int Uint64;
00082 #endif
00083 };
00084 #endif
00085 
00086 
00087 
00088 // --- HASH Functions ---- //
00089 namespace vpr
00090 {
00091 
00093 struct Unit64Hash
00094 {
00095    union Uint64_val
00096    {
00097       vpr::Uint64 full;
00098       struct
00099       {
00100          vpr::Uint32 low32;
00101          vpr::Uint32 high32;
00102       } nested;
00103    };
00104 
00105    vpr::Uint32 operator() (vpr::Uint64 val) const
00106    {
00107       Uint64_val temp;
00108       temp.full = val;
00109       return temp.nested.low32 + temp.nested.high32;
00110    }
00111 };
00112 
00113 } // End of vpr namespace
00114 
00115 // XXX: The following is a hack to deal with GCC 3.0.1 on IRIX not knowing how
00116 // to deal with an unsigned long long being passed to operator<<.  This code
00117 // should be removed as soon as possible!
00118 #if defined(VPR_OS_IRIX) && defined(__GNUC__) &&                        \
00119     __GNUC__ == 3 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ <= 1
00120 
00121 #include <iostream>
00122 
00123 namespace std
00124 {
00125 
00126 inline std::ostream& operator<< (std::ostream& out, const vpr::Uint64& v)
00127 {
00128    out << (vpr::Uint32) v;
00129    return out;
00130 }
00131 
00132 }
00133 #endif /* defined(VPR_OS_IRIX) && defined(__GNUC__) */
00134 
00135 
00136 #endif   /* _VPR_TYPES_H_ */

Generated on Sun May 2 14:43:03 2004 for VR Juggler Portable Runtime by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002