00001 //# ValType.h: The id-string of a value type 00002 //# Copyright (C) 1993,1994,1995,1996,1998,2000 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef CASA_VALTYPEID_H 00029 #define CASA_VALTYPEID_H 00030 00031 #include <casacore/casa/aips.h> 00032 #include <casacore/casa/Utilities/ValType.h> 00033 00034 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00035 00036 // <summary> 00037 // The id-string of a value type 00038 // </summary> 00039 00040 // <use visibility=export> 00041 // <reviewed reviewer="Friso Olnon" date="1995/03/20" tests="" demos=""> 00042 // </reviewed> 00043 00044 // <prerequisite> 00045 // <li> class <linkto class=ValType">ValType</linkto> 00046 // </prerequisite> 00047 00048 // <synopsis> 00049 // The templated global functions valDataTypeId get the data type id string 00050 // of the given type. 00051 // For standard types this is the ValType data type string. 00052 // For other types (i.e. classes) it is the result of the class dataTypeId 00053 // function. 00054 // </synopsis> 00055 00056 // <group name=typeid> 00057 00058 template<class T> inline String valDataTypeId (const T*) 00059 { return T::dataTypeId(); } 00060 inline String valDataTypeId (const Bool* obj) 00061 { return ValType::getTypeStr (obj); } 00062 inline String valDataTypeId (const Char* obj) 00063 { return ValType::getTypeStr (obj); } 00064 inline String valDataTypeId (const uChar* obj) 00065 { return ValType::getTypeStr (obj); } 00066 inline String valDataTypeId (const Short* obj) 00067 { return ValType::getTypeStr (obj); } 00068 inline String valDataTypeId (const uShort* obj) 00069 { return ValType::getTypeStr (obj); } 00070 inline String valDataTypeId (const Int* obj) 00071 { return ValType::getTypeStr (obj); } 00072 inline String valDataTypeId (const uInt* obj) 00073 { return ValType::getTypeStr (obj); } 00074 inline String valDataTypeId (const float* obj) 00075 { return ValType::getTypeStr (obj); } 00076 inline String valDataTypeId (const double* obj) 00077 { return ValType::getTypeStr (obj); } 00078 inline String valDataTypeId (const Complex* obj) 00079 { return ValType::getTypeStr (obj); } 00080 inline String valDataTypeId (const DComplex* obj) 00081 { return ValType::getTypeStr (obj); } 00082 inline String valDataTypeId (const String* obj) 00083 { return ValType::getTypeStr (obj); } 00084 inline String valDataTypeId (const TableRecord* obj) 00085 { return ValType::getTypeStr (obj); } 00086 00087 // </group> 00088 00089 } //# NAMESPACE CASACORE - END 00090 00091 #endif 00092 00093 00094