casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
generic.h
Go to the documentation of this file.
00001 //# generic.h:  some defines, from the GNU C++ Library
00002 //# This may look like C code, but it is really -*- C++ -*-
00003 //#
00004 //# Copyright (C) 1988 Free Software Foundation
00005 //#     written by Doug Lea (dl@rocky.oswego.edu)
00006 //# 
00007 //# This file is part of the GNU C++ Library.  This library is free
00008 //# software; you can redistribute it and/or modify it under the terms of
00009 //# the GNU Library General Public License as published by the Free
00010 //# Software Foundation; either version 2 of the License, or (at your
00011 //# option) any later version.  This library is distributed in the hope
00012 //# that it will be useful, but WITHOUT ANY WARRANTY; without even the
00013 //# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014 //# PURPOSE.  See the GNU Library General Public License for more details.
00015 //# You should have received a copy of the GNU Library General Public
00016 //# License along with this library; if not, write to the Free Software
00017 //# Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 //# $Id: generic.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
00020 
00021 #ifndef CASA_GENERIC_H
00022 #define CASA_GENERIC_H
00023 
00024 namespace casa { //# NAMESPACE CASA - BEGIN
00025 
00026 /*
00027  *      See the CPP manual, argument prescan section for explanation
00028  */
00029 
00030 // <summary>Generic gnu macros</summary>
00031 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
00032 // </reviewed>
00033 // <group name=def>
00034 
00035 #define g_name2(a,b) gEnErIc2(a,b)
00036 #define gEnErIc2(a,b) a ## b
00037 
00038 #define g_name3(a,b,c) gEnErIc3(a,b,c)
00039 #define gEnErIc3(a,b,c) a ## b ## c
00040 
00041 #define g_name4(a,b,c,d) gEnErIc4(a,b,c,d)
00042 #define gEnErIc4(a,b,c,d) a ## b ## c ## d
00043 
00044 #define GENERIC_STRING(a) gEnErIcStRiNg(a)
00045 #define gEnErIcStRiNg(a) #a
00046 
00047 #define g_declare(clas,t)        g_name2(clas,declare)(t)
00048 #define g_declare2(clas,t1,t2)   g_name2(clas,declare2)(t1,t2)
00049 
00050 #define g_implement(clas,t)      g_name2(clas,implement)(t)
00051 #define g_implement2(clas,t1,t2) g_name2(clas,implement2)(t1,t2)
00052 
00053 //extern genericerror(int,char*);
00054 typedef int (*GPT)(int,char*);
00055 
00056 #define g_set_handler(gen,type,x) g_name4(set_,type,gen,_handler)(x)
00057 
00058 #define g_errorhandler(gen,type)  g_name3(type,gen,handler)
00059 
00060 #define g_callerror(gen,type,a,b) (*g_errorhandler(gen,type))(a,b)
00061 
00062 // </group>
00063 
00064 
00065 } //# NAMESPACE CASA - END
00066 
00067 #endif