Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxStd.h

00001 /*
00002  *  Copyright (c) 1998, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Dennis Koelma (koelma@science.uva.nl)
00008  *  Edo Poll (poll@science.uva.nl)
00009  *  Andrew Bagdanov (andrew@science.uva.nl)
00010  */
00011 
00012 #ifndef HxStd_h
00013 #define HxStd_h
00014 
00015 #include <stddef.h>
00016 
00017 //
00018 // Define some types.
00019 //
00020 
00021 //typedef enum { hxFalse, hxTrue } HxBool;
00022 
00023 static const bool hxFalse = false;
00024 static const bool hxTrue = true;
00025 typedef bool HxBool;
00026 
00027 typedef unsigned long   uLong;
00028 typedef unsigned char   uChar;
00029 typedef const char*     charPtr;
00030 
00031 #if !defined(_SIZE_T_DEFINED) && !defined(_SIZE_T)
00032 #define _SIZE_T_DEFINED
00033 #define _SIZE_T
00034 typedef unsigned int    size_t;
00035 #endif
00036 
00037 #ifndef NULL
00038 #define NULL    0
00039 #endif
00040 
00041 typedef unsigned short  HxUnInt16; // make sure sizeof(HxUnInt16) == 2
00042 typedef unsigned int    HxUnInt32; // make sure sizeof(HxUInt32) == 4
00043 
00044 //
00045 // Define some predicates.
00046 //
00047 
00048 template<class T>
00049 inline T
00050 HxMax(T x, T y)
00051 {
00052     return (x > y) ? x : y;
00053 }
00054 
00055 template<class T>
00056 inline T
00057 HxMin(T x, T y)
00058 {
00059     return (x < y) ? x : y;
00060 }
00061 
00062 // I have no idea why these are still here. It is very important to SaSystem.
00063 
00064 inline const char*
00065 ClassName(int)
00066 {
00067     return "int";
00068 }
00069 
00070 inline const char*
00071 ClassName(double)
00072 {
00073     return "double";
00074 }
00075 
00076 //
00077 // (Re)Define some troublesome keywords. When will compilers finally be
00078 // compliant to the same standard?
00079 //
00080 
00081 #define TYPENAME typename
00082 
00083 #if defined(_MSC_VER)
00084 
00085 #undef TYPENAME
00086 #define TYPENAME
00087 #define typename
00088 
00089 #endif
00090 
00091 //
00092 // Define linkage specification. This is hopelessly inappropriate.
00093 //
00094 
00095 #ifdef _MSC_VER
00096 
00097 #pragma warning(disable: 4786)
00098 
00099 #ifndef HX_MULT_DLL
00100 #define HX_MULT_DLL
00101 #endif
00102 
00103 #ifdef HX_MULT_DLL
00104 // we are using multiple dll's
00105 
00106 #define DllImport    __declspec( dllimport )
00107 #define DllExport    __declspec( dllexport )
00108 
00109 #ifdef HXBASIS_EXPORTS
00110 // defined when building HxBasis.dll
00111 #define L_HXBASIS DllExport
00112 #else
00113 #define L_HXBASIS DllImport
00114 #endif
00115 
00116 #ifdef HXIMAGEREP_EXPORTS
00117 // defined when building HxImageRep.dll
00118 #define L_HXIMAGEREP DllExport
00119 #define HX_EXPORT_TEMPLATE
00120 #else
00121 #define L_HXIMAGEREP DllImport
00122 #endif
00123 
00124 #else
00125 // HX_MULT_DLL
00126 
00127 #define L_HXBASIS
00128 #define L_HXIMAGEREP
00129 #define HX_EXPORT_TEMPLATE
00130 
00131 #endif
00132 // HX_MULT_DLL
00133 
00134 #else
00135 // _MSC_VER
00136 
00137 #define L_HXBASIS
00138 #define L_HXIMAGEREP
00139 #define HX_EXPORT_TEMPLATE
00140 
00141 #endif
00142 //_MSC_VER
00143 
00145 
00146 #endif
00147 // HxStd_h

Generated on Tue Feb 3 14:18:42 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001