switchOnEncoding.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef SWITCHONENCODING_H
00011 #define SWITCHONENCODING_H
00012 
00013 #include "ComplexData.h"
00014 
00015 #define switchOnEncoding(encoding,function,...) \
00016    switch (encoding) \
00017    { \
00018    case INT1UBYTE: \
00019       function((unsigned char*)__VA_ARGS__); \
00020       break; \
00021    case INT1SBYTE: \
00022       function((signed char*)__VA_ARGS__); \
00023       break; \
00024    case INT2UBYTES: \
00025       function((unsigned short*)__VA_ARGS__); \
00026       break; \
00027    case INT2SBYTES: \
00028       function((signed short*)__VA_ARGS__); \
00029       break; \
00030    case INT4UBYTES: \
00031       function((unsigned int*)__VA_ARGS__); \
00032       break; \
00033    case INT4SBYTES: \
00034       function((signed int*)__VA_ARGS__); \
00035       break; \
00036    case FLT4BYTES: \
00037       function((float*)__VA_ARGS__); \
00038       break; \
00039    case FLT8BYTES: \
00040       function((double*)__VA_ARGS__); \
00041       break; \
00042    default: \
00043       break; \
00044    }
00045 
00046 #define switchOnComplexEncoding(encoding,function,...) \
00047    switch (encoding) \
00048    { \
00049    case INT1UBYTE: \
00050       function((unsigned char*)__VA_ARGS__); \
00051       break; \
00052    case INT1SBYTE: \
00053       function((signed char*)__VA_ARGS__); \
00054       break; \
00055    case INT2UBYTES: \
00056       function((unsigned short*)__VA_ARGS__); \
00057       break; \
00058    case INT2SBYTES: \
00059       function((signed short*)__VA_ARGS__); \
00060       break; \
00061    case INT4SCOMPLEX: \
00062       function((IntegerComplex*)__VA_ARGS__); \
00063       break; \
00064    case INT4UBYTES: \
00065       function((unsigned int*)__VA_ARGS__); \
00066       break; \
00067    case INT4SBYTES: \
00068       function((signed int*)__VA_ARGS__); \
00069       break; \
00070    case FLT4BYTES: \
00071       function((float*)__VA_ARGS__); \
00072       break; \
00073    case FLT8COMPLEX: \
00074       function((FloatComplex*)__VA_ARGS__); \
00075       break; \
00076    case FLT8BYTES: \
00077       function((double*)__VA_ARGS__); \
00078       break; \
00079    default: \
00080       break; \
00081    }
00082 
00083 #endif

Software Development Kit - Opticks 4.9.0 Build 16218