ByteInBuffer.cc

Go to the documentation of this file.
00001 // $Id: ByteInBuffer.cc 179 2006-06-07 06:04:17Z bingmann $
00002 
00003 #include "ByteInBuffer.h"
00004 #include "AnyType.h"
00005 
00006 #include <stdlib.h>
00007 #include <string.h>
00008 
00009 namespace VGServer {
00010 
00011 void ByteInBuffer::fetchAnyType(class AnyType &v)
00012 {
00013     switch(v.getType())
00014     {
00015     case ATTRTYPE_INVALID: assert(0); return;
00016 
00017     case ATTRTYPE_BOOL:
00018         // this is a special case: bit values are stored within the
00019         // default bitfield, this must be handeled differently.
00020         assert(0);
00021         return;
00022 
00023     case ATTRTYPE_CHAR:
00024         v.setInteger(fetch<char>());
00025         return;
00026 
00027     case ATTRTYPE_SHORT:
00028         v.setInteger(fetch<short>());
00029         return;
00030 
00031     case ATTRTYPE_INTEGER:
00032         v.setInteger(fetch<int>());
00033         return;
00034 
00035     case ATTRTYPE_LONG:
00036         v.setLong(fetch<long long>());
00037         return;
00038 
00039     case ATTRTYPE_BYTE:
00040         v.setInteger(fetch<unsigned char>());
00041         return;
00042 
00043     case ATTRTYPE_WORD:
00044         v.setInteger(fetch<unsigned short>());
00045         return;
00046 
00047     case ATTRTYPE_DWORD:
00048         v.setInteger(fetch<unsigned int>());
00049         return;
00050 
00051     case ATTRTYPE_QWORD:
00052         v.setLong(fetch<unsigned long long>());
00053         return;
00054 
00055     case ATTRTYPE_FLOAT:
00056         v.setDouble(fetch<float>());
00057         return;
00058 
00059     case ATTRTYPE_DOUBLE:
00060         v.setDouble(fetch<double>());
00061         return;
00062 
00063     case ATTRTYPE_STRING:
00064         v.setString(fetchString());
00065         return;
00066 
00067     case ATTRTYPE_LONGSTRING:
00068         v.setString(fetchLongString());
00069         return;
00070     }
00071     assert(0);
00072 }
00073 
00074 } // namespace VGServer

Generated on Wed Sep 27 14:34:00 2006 for VGServer by  doxygen 1.4.7