Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

Std.h

Go to the documentation of this file.
00001 #ifndef Impala_Basis_Std_h
00002 #define Impala_Basis_Std_h
00003 
00004 #include "Basis/LibConfig.h"
00005 
00006 
00007 // IMPALA_VERSION / 10000 is the major version
00008 // IMPALA_VERSION / 100 % 100 is the minor version
00009 // IMPALA_VERSION % 100 is the sub-minor version
00010 #define IMPALA_VERSION 080100
00011 
00012 // Same as IMPALA_VERSION but then as a string
00013 #define IMPALA_VERSION_STR "08.01.00"
00014 
00015 // Svn version as a string, relies on -DSVN_VERSION="..."
00016 #define IMPALA_STRING2(x) #x
00017 #define IMPALA_STRING(x) IMPALA_STRING2(x)
00018 #ifdef SVN_VERSION
00019 #define SVN_VERSION_STR IMPALA_STRING(SVN_VERSION)
00020 #else
00021 #define SVN_VERSION_STR "unknown"
00022 #endif
00023 
00024 
00025 #ifdef _MSC_VER
00026 // MSCV 6.0 (cl version 12) doesn't support typename, so remove it:
00027 #if _MSC_VER <= 1200
00028 #define typename
00029 #endif
00030 #endif
00031 
00032 namespace Impala
00033 {
00034 
00035 
00036 template<class T>
00037 inline T
00038 Max(T x, T y)
00039 {
00040     return (x > y) ? x : y;
00041 }
00042 
00043 template<class T>
00044 inline T
00045 Min(T x, T y)
00046 {
00047     return (x < y) ? x : y;
00048 }
00049 
00050 //Align a to nearest higher multiple of b
00051 template<class T>
00052 inline T
00053 IntAlignUp(T a, T b)
00054 {
00055     return (a % b != 0) ?  (a - a % b + b) : a;
00056 }
00057 
00058 //Align a to nearest lower multiple of b
00059 template<class T>
00060 inline T
00061 IntAlignDown(T a, T b)
00062 {
00063     return a - a % b;
00064 }
00065 
00066 } // namespace Impala
00067 
00068 #endif

Generated on Thu Jan 13 09:03:59 2011 for ImpalaSrc by  doxygen 1.5.1