/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/gen/qpid/amqp_0_10/TypeForCode.h

00001 #ifndef QPID_AMQP_0_10_TYPEFORCODE_H
00002 #define QPID_AMQP_0_10_TYPEFORCODE_H
00003 /*
00004  *
00005  * Licensed to the Apache Software Foundation (ASF) under one
00006  * or more contributor license agreements.  See the NOTICE file
00007  * distributed with this work for additional information
00008  * regarding copyright ownership.  The ASF licenses this file
00009  * to you under the Apache License, Version 2.0 (the
00010  * "License"); you may not use this file except in compliance
00011  * with the License.  You may obtain a copy of the License at
00012  *
00013  *   http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing,
00016  * software distributed under the License is distributed on an
00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018  * KIND, either express or implied.  See the License for the
00019  * specific language governing permissions and limitations
00020  * under the License.
00021  *
00022  */
00023 
00028 
00029 
00030 #include "qpid/amqp_0_10/built_in_types.h"
00031 #include "qpid/amqp_0_10/UnknownType.h"
00032 
00033 namespace qpid {
00034 namespace amqp_0_10 {
00035 
00036 
00037 template <uint8_t Code> struct TypeForCode;
00038 
00039 template <> struct TypeForCode<0x00> {  typedef Bin8 type; };
00040 template <> struct TypeForCode<0x01> {  typedef Int8 type; };
00041 template <> struct TypeForCode<0x02> {  typedef Uint8 type; };
00042 template <> struct TypeForCode<0x04> {  typedef Char type; };
00043 template <> struct TypeForCode<0x08> {  typedef Boolean type; };
00044 template <> struct TypeForCode<0x10> {  typedef Bin16 type; };
00045 template <> struct TypeForCode<0x11> {  typedef Int16 type; };
00046 template <> struct TypeForCode<0x12> {  typedef Uint16 type; };
00047 template <> struct TypeForCode<0x20> {  typedef Bin32 type; };
00048 template <> struct TypeForCode<0x21> {  typedef Int32 type; };
00049 template <> struct TypeForCode<0x22> {  typedef Uint32 type; };
00050 template <> struct TypeForCode<0x23> {  typedef Float type; };
00051 template <> struct TypeForCode<0x27> {  typedef CharUtf32 type; };
00052 template <> struct TypeForCode<0x30> {  typedef Bin64 type; };
00053 template <> struct TypeForCode<0x31> {  typedef Int64 type; };
00054 template <> struct TypeForCode<0x32> {  typedef Uint64 type; };
00055 template <> struct TypeForCode<0x33> {  typedef Double type; };
00056 template <> struct TypeForCode<0x38> {  typedef Datetime type; };
00057 template <> struct TypeForCode<0x40> {  typedef Bin128 type; };
00058 template <> struct TypeForCode<0x48> {  typedef Uuid type; };
00059 template <> struct TypeForCode<0x50> {  typedef Bin256 type; };
00060 template <> struct TypeForCode<0x60> {  typedef Bin512 type; };
00061 template <> struct TypeForCode<0x70> {  typedef Bin1024 type; };
00062 template <> struct TypeForCode<0x80> {  typedef Vbin8 type; };
00063 template <> struct TypeForCode<0x84> {  typedef Str8Latin type; };
00064 template <> struct TypeForCode<0x85> {  typedef Str8 type; };
00065 template <> struct TypeForCode<0x86> {  typedef Str8Utf16 type; };
00066 template <> struct TypeForCode<0x90> {  typedef Vbin16 type; };
00067 template <> struct TypeForCode<0x94> {  typedef Str16Latin type; };
00068 template <> struct TypeForCode<0x95> {  typedef Str16 type; };
00069 template <> struct TypeForCode<0x96> {  typedef Str16Utf16 type; };
00070 template <> struct TypeForCode<0xa0> {  typedef Vbin32 type; };
00071 template <> struct TypeForCode<0xa8> {  typedef Map type; };
00072 template <> struct TypeForCode<0xa9> {  typedef List type; };
00073 template <> struct TypeForCode<0xaa> {  typedef Array type; };
00074 template <> struct TypeForCode<0xab> {  typedef Struct32 type; };
00075 template <> struct TypeForCode<0xc0> {  typedef Bin40 type; };
00076 template <> struct TypeForCode<0xc8> {  typedef Dec32 type; };
00077 template <> struct TypeForCode<0xd0> {  typedef Bin72 type; };
00078 template <> struct TypeForCode<0xd8> {  typedef Dec64 type; };
00079 template <> struct TypeForCode<0xf0> {  typedef Void type; };
00080 template <> struct TypeForCode<0xf1> {  typedef Bit type; };
00081 
00082 template <class V> typename V::result_type
00083 apply_visitor(V& visitor, uint8_t code) {
00084     switch (code) {
00085         case 0x00: return visitor((Bin8*)0);
00086         case 0x01: return visitor((Int8*)0);
00087         case 0x02: return visitor((Uint8*)0);
00088         case 0x04: return visitor((Char*)0);
00089         case 0x08: return visitor((Boolean*)0);
00090         case 0x10: return visitor((Bin16*)0);
00091         case 0x11: return visitor((Int16*)0);
00092         case 0x12: return visitor((Uint16*)0);
00093         case 0x20: return visitor((Bin32*)0);
00094         case 0x21: return visitor((Int32*)0);
00095         case 0x22: return visitor((Uint32*)0);
00096         case 0x23: return visitor((Float*)0);
00097         case 0x27: return visitor((CharUtf32*)0);
00098         case 0x30: return visitor((Bin64*)0);
00099         case 0x31: return visitor((Int64*)0);
00100         case 0x32: return visitor((Uint64*)0);
00101         case 0x33: return visitor((Double*)0);
00102         case 0x38: return visitor((Datetime*)0);
00103         case 0x40: return visitor((Bin128*)0);
00104         case 0x48: return visitor((Uuid*)0);
00105         case 0x50: return visitor((Bin256*)0);
00106         case 0x60: return visitor((Bin512*)0);
00107         case 0x70: return visitor((Bin1024*)0);
00108         case 0x80: return visitor((Vbin8*)0);
00109         case 0x84: return visitor((Str8Latin*)0);
00110         case 0x85: return visitor((Str8*)0);
00111         case 0x86: return visitor((Str8Utf16*)0);
00112         case 0x90: return visitor((Vbin16*)0);
00113         case 0x94: return visitor((Str16Latin*)0);
00114         case 0x95: return visitor((Str16*)0);
00115         case 0x96: return visitor((Str16Utf16*)0);
00116         case 0xa0: return visitor((Vbin32*)0);
00117         case 0xa8: return visitor((Map*)0);
00118         case 0xa9: return visitor((List*)0);
00119         case 0xaa: return visitor((Array*)0);
00120         case 0xab: return visitor((Struct32*)0);
00121         case 0xc0: return visitor((Bin40*)0);
00122         case 0xc8: return visitor((Dec32*)0);
00123         case 0xd0: return visitor((Bin72*)0);
00124         case 0xd8: return visitor((Dec64*)0);
00125         case 0xf0: return visitor((Void*)0);
00126         case 0xf1: return visitor((Bit*)0);
00127         default: return visitor((UnknownType*)0);
00128     }
00129 }
00130 
00131 std::string typeName(uint8_t code);
00132 
00133 }} // namespace qpid::amqp_0_10
00134 
00135 #endif  

Generated on Thu Apr 10 11:08:15 2008 for Qpid by  doxygen 1.4.7