casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
33 
34 namespace 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>
57 
58 template<class T> inline String valDataTypeId (const T*)
59  { return T::dataTypeId(); }
60 inline String valDataTypeId (const Bool* obj)
61  { return ValType::getTypeStr (obj); }
62 inline String valDataTypeId (const Char* obj)
63  { return ValType::getTypeStr (obj); }
64 inline String valDataTypeId (const uChar* obj)
65  { return ValType::getTypeStr (obj); }
66 inline String valDataTypeId (const Short* obj)
67  { return ValType::getTypeStr (obj); }
68 inline String valDataTypeId (const uShort* obj)
69  { return ValType::getTypeStr (obj); }
70 inline String valDataTypeId (const Int* obj)
71  { return ValType::getTypeStr (obj); }
72 inline String valDataTypeId (const uInt* obj)
73  { return ValType::getTypeStr (obj); }
74 inline String valDataTypeId (const Int64* obj)
75  { return ValType::getTypeStr (obj); }
76 inline String valDataTypeId (const float* obj)
77  { return ValType::getTypeStr (obj); }
78 inline String valDataTypeId (const double* obj)
79  { return ValType::getTypeStr (obj); }
80 inline String valDataTypeId (const Complex* obj)
81  { return ValType::getTypeStr (obj); }
82 inline String valDataTypeId (const DComplex* obj)
83  { return ValType::getTypeStr (obj); }
84 inline String valDataTypeId (const String* obj)
85  { return ValType::getTypeStr (obj); }
86 inline 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 valDataTypeId(const uInt *obj)
Definition: ValTypeId.h:72
static const String & getTypeStr(DataType)
Get the name of the data type.
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
String valDataTypeId(const String *obj)
Definition: ValTypeId.h:84
String valDataTypeId(const uShort *obj)
Definition: ValTypeId.h:68
unsigned char uChar
Definition: aipstype.h:47
char Char
Definition: aipstype.h:46
String valDataTypeId(const Int64 *obj)
Definition: ValTypeId.h:74
String valDataTypeId(const Bool *obj)
Definition: ValTypeId.h:60
String valDataTypeId(const TableRecord *obj)
Definition: ValTypeId.h:86
String valDataTypeId(const Complex *obj)
Definition: ValTypeId.h:80
short Short
Definition: aipstype.h:48
String valDataTypeId(const Short *obj)
Definition: ValTypeId.h:66
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
String valDataTypeId(const DComplex *obj)
Definition: ValTypeId.h:82
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:182
String valDataTypeId(const float *obj)
Definition: ValTypeId.h:76
String valDataTypeId(const uChar *obj)
Definition: ValTypeId.h:64
String: the storage and methods of handling collections of characters.
Definition: String.h:223
String valDataTypeId(const Char *obj)
Definition: ValTypeId.h:62
String valDataTypeId(const Int *obj)
Definition: ValTypeId.h:70
String valDataTypeId(const double *obj)
Definition: ValTypeId.h:78
unsigned int uInt
Definition: aipstype.h:51
unsigned short uShort
Definition: aipstype.h:49
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42