InstructionRegisterSwitch.h

Go to the documentation of this file.
00001 /*
00002 // $Id: //open/dev/fennel/calculator/InstructionRegisterSwitch.h#2 $
00003 // Fennel is a library of data storage and processing components.
00004 // Copyright (C) 2005-2009 The Eigenbase Project
00005 // Copyright (C) 2004-2009 SQLstream, Inc.
00006 // Copyright (C) 2009-2009 LucidEra, Inc.
00007 //
00008 // This program is free software; you can redistribute it and/or modify it
00009 // under the terms of the GNU General Public License as published by the Free
00010 // Software Foundation; either version 2 of the License, or (at your option)
00011 // any later version approved by The Eigenbase Project.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 //
00022 // InstructionRegisterSwitch.h
00023 // Include this file if you intend to manipulate instructions directly,
00024 // otherwise include Calculator.h
00025 //
00026 */
00027 
00028 // Note: Must ifdef out unused code, as a c++ compiler will
00029 // instantiate all paths and not attempt to do constant reduction or
00030 // otherwise follow the logic of the program.  Without this technique,
00031 // or something similar, the compiler would try to instantiate a
00032 // BoolAnd(RegisterRef<float>) which trips other compile-time
00033 // checks. (And is just generally a bad idea.
00034 
00035 // Do not prevent multiple includes of this file.
00036 
00037 #ifdef Fennel_InstructionRegisterSwitch_NativeNotBool
00038 #define Fennel_InstructionRegisterSwitch_Integral 1
00039 #define Fennel_InstructionRegisterSwitch_Approx 1
00040 #endif
00041 
00042 #ifdef Fennel_InstructionRegisterSwitch_Array
00043 #define Fennel_InstructionRegisterSwitch_Array_Text 1
00044 #define Fennel_InstructionRegisterSwitch_Array_Binary 1
00045 #endif
00046 
00047 #if 0
00048 switch (foo) { // Feed/fool emacs auto-indent
00049 #endif
00050 
00051 #ifdef Fennel_InstructionRegisterSwitch_Integral
00052 case STANDARD_TYPE_INT_8:
00053     InstructionRegister::registerInstance<int8_t, INSTCLASS2>(type);
00054     break;
00055 case STANDARD_TYPE_UINT_8:
00056     InstructionRegister::registerInstance<uint8_t, INSTCLASS2>(type);
00057     break;
00058 case STANDARD_TYPE_INT_16:
00059     InstructionRegister::registerInstance<int16_t, INSTCLASS2>(type);
00060     break;
00061 case STANDARD_TYPE_UINT_16:
00062     InstructionRegister::registerInstance<uint16_t, INSTCLASS2>(type);
00063     break;
00064 case STANDARD_TYPE_INT_32:
00065     InstructionRegister::registerInstance<int32_t, INSTCLASS2>(type);
00066     break;
00067 case STANDARD_TYPE_UINT_32:
00068     InstructionRegister::registerInstance<uint32_t, INSTCLASS2>(type);
00069     break;
00070 case STANDARD_TYPE_INT_64:
00071     InstructionRegister::registerInstance<int64_t, INSTCLASS2>(type);
00072     break;
00073 case STANDARD_TYPE_UINT_64:
00074     InstructionRegister::registerInstance<uint64_t, INSTCLASS2>(type);
00075     break;
00076 #endif
00077 
00078 
00079 #ifdef Fennel_InstructionRegisterSwitch_Bool
00080 case STANDARD_TYPE_BOOL:
00081     InstructionRegister::registerInstance<bool, INSTCLASS2>(type);
00082     break;
00083 #endif
00084 
00085 
00086 #ifdef Fennel_InstructionRegisterSwitch_Approx
00087 case STANDARD_TYPE_REAL:
00088     InstructionRegister::registerInstance<float, INSTCLASS2>(type);
00089     break;
00090 case STANDARD_TYPE_DOUBLE:
00091     InstructionRegister::registerInstance<double, INSTCLASS2>(type);
00092     break;
00093 #endif
00094 
00095 
00096 #ifdef Fennel_InstructionRegisterSwitch_Array_Text
00097 case STANDARD_TYPE_CHAR:
00098     InstructionRegister::registerInstance<char*, INSTCLASS2>(type);
00099     break;
00100 case STANDARD_TYPE_VARCHAR:
00101     InstructionRegister::registerInstance<char*, INSTCLASS2>(type);
00102     break;
00103 #endif
00104 
00105 
00106 #ifdef Fennel_InstructionRegisterSwitch_Array_Binary
00107 case STANDARD_TYPE_BINARY:
00108     InstructionRegister::registerInstance<char*, INSTCLASS2>(type);
00109     break;
00110 case STANDARD_TYPE_VARBINARY:
00111     InstructionRegister::registerInstance<char*, INSTCLASS2>(type);
00112     break;
00113 #endif
00114 
00115 
00116      // Be sure all defines are undefined as this file tends to be
00117      // included multiple times.
00118 #undef Fennel_InstructionRegisterSwitch_NativeNotBool
00119 #undef Fennel_InstructionRegisterSwitch_Array
00120 #undef Fennel_InstructionRegisterSwitch_Integral
00121 #undef Fennel_InstructionRegisterSwitch_Bool
00122 #undef Fennel_InstructionRegisterSwitch_Approx
00123 #undef Fennel_InstructionRegisterSwitch_Array_Text
00124 #undef Fennel_InstructionRegisterSwitch_Array_Binary
00125 
00126 #if 0
00127 }   // Feed/fool emacs auto-indent
00128 #endif
00129 
00130 
00131 // End InstructionRegisterSwitch.h
00132 

Generated on Mon Jun 22 04:00:17 2009 for Fennel by  doxygen 1.5.1