casacore
ValTypeId.h
Go to the documentation of this file.
1//# ValType.h: The id-string of a value type
2//# Copyright (C) 1993,1994,1995,1996,1998,2000
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: aips2-request@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25//#
26//# $Id$
27
28#ifndef CASA_VALTYPEID_H
29#define CASA_VALTYPEID_H
30
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Utilities/ValType.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// The id-string of a value type
38// </summary>
39
40// <use visibility=export>
41// <reviewed reviewer="Friso Olnon" date="1995/03/20" tests="" demos="">
42// </reviewed>
43
44// <prerequisite>
45// <li> class <linkto class=ValType">ValType</linkto>
46// </prerequisite>
47
48// <synopsis>
49// The templated global functions valDataTypeId get the data type id string
50// of the given type.
51// For standard types this is the ValType data type string.
52// For other types (i.e. classes) it is the result of the class dataTypeId
53// function.
54// </synopsis>
55
56// <group name=typeid>
58template<class T> inline String valDataTypeId (const T*)
59 { return T::dataTypeId(); }
60inline String valDataTypeId (const Bool* obj)
61 { return ValType::getTypeStr (obj); }
62inline String valDataTypeId (const Char* obj)
63 { return ValType::getTypeStr (obj); }
64inline String valDataTypeId (const uChar* obj)
65 { return ValType::getTypeStr (obj); }
66inline String valDataTypeId (const Short* obj)
67 { return ValType::getTypeStr (obj); }
68inline String valDataTypeId (const uShort* obj)
69 { return ValType::getTypeStr (obj); }
70inline String valDataTypeId (const Int* obj)
71 { return ValType::getTypeStr (obj); }
72inline String valDataTypeId (const uInt* obj)
73 { return ValType::getTypeStr (obj); }
74inline String valDataTypeId (const Int64* obj)
75 { return ValType::getTypeStr (obj); }
76inline String valDataTypeId (const float* obj)
77 { return ValType::getTypeStr (obj); }
78inline String valDataTypeId (const double* obj)
79 { return ValType::getTypeStr (obj); }
80inline String valDataTypeId (const Complex* obj)
81 { return ValType::getTypeStr (obj); }
82inline String valDataTypeId (const DComplex* obj)
83 { return ValType::getTypeStr (obj); }
84inline String valDataTypeId (const String* obj)
85 { return ValType::getTypeStr (obj); }
86inline String valDataTypeId (const TableRecord* obj)
87 { return ValType::getTypeStr (obj); }
88
89// </group>
90
91} //# NAMESPACE CASACORE - END
92
93#endif
94
95
96
String: the storage and methods of handling collections of characters.
Definition: String.h:225
static const String & getTypeStr(DataType)
Get the name of the data type.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned char uChar
Definition: aipstype.h:47
short Short
Definition: aipstype.h:48
unsigned int uInt
Definition: aipstype.h:51
unsigned short uShort
Definition: aipstype.h:49
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
int Int
Definition: aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
char Char
Definition: aipstype.h:46
String valDataTypeId(const Int *obj)
Definition: ValTypeId.h:70
String valDataTypeId(const Short *obj)
Definition: ValTypeId.h:66
String valDataTypeId(const float *obj)
Definition: ValTypeId.h:76
String valDataTypeId(const String *obj)
Definition: ValTypeId.h:84
String valDataTypeId(const Int64 *obj)
Definition: ValTypeId.h:74
String valDataTypeId(const TableRecord *obj)
Definition: ValTypeId.h:86
String valDataTypeId(const uInt *obj)
Definition: ValTypeId.h:72
String valDataTypeId(const Complex *obj)
Definition: ValTypeId.h:80
String valDataTypeId(const Char *obj)
Definition: ValTypeId.h:62
String valDataTypeId(const Bool *obj)
Definition: ValTypeId.h:60
String valDataTypeId(const double *obj)
Definition: ValTypeId.h:78
String valDataTypeId(const uChar *obj)
Definition: ValTypeId.h:64
String valDataTypeId(const uShort *obj)
Definition: ValTypeId.h:68
String valDataTypeId(const DComplex *obj)
Definition: ValTypeId.h:82