casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef CASA_VALTYPEID_H
27#define CASA_VALTYPEID_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Utilities/ValType.h>
31
32namespace casacore { //# NAMESPACE CASACORE - BEGIN
33
34// <summary>
35// The id-string of a value type
36// </summary>
37
38// <use visibility=export>
39// <reviewed reviewer="Friso Olnon" date="1995/03/20" tests="" demos="">
40// </reviewed>
41
42// <prerequisite>
43// <li> class <linkto class=ValType">ValType</linkto>
44// </prerequisite>
45
46// <synopsis>
47// The templated global functions valDataTypeId get the data type id string
48// of the given type.
49// For standard types this is the ValType data type string.
50// For other types (i.e. classes) it is the result of the class dataTypeId
51// function.
52// </synopsis>
53
54// <group name=typeid>
56template<class T> inline String valDataTypeId (const T*)
57 { return T::dataTypeId(); }
58inline String valDataTypeId (const Bool* obj)
59 { return ValType::getTypeStr (obj); }
60inline String valDataTypeId (const Char* obj)
61 { return ValType::getTypeStr (obj); }
62inline String valDataTypeId (const uChar* obj)
63 { return ValType::getTypeStr (obj); }
64inline String valDataTypeId (const Short* obj)
65 { return ValType::getTypeStr (obj); }
66inline String valDataTypeId (const uShort* obj)
67 { return ValType::getTypeStr (obj); }
68inline String valDataTypeId (const Int* obj)
69 { return ValType::getTypeStr (obj); }
70inline String valDataTypeId (const uInt* obj)
71 { return ValType::getTypeStr (obj); }
72inline String valDataTypeId (const Int64* obj)
73 { return ValType::getTypeStr (obj); }
74inline String valDataTypeId (const float* obj)
75 { return ValType::getTypeStr (obj); }
76inline String valDataTypeId (const double* obj)
77 { return ValType::getTypeStr (obj); }
78inline String valDataTypeId (const Complex* obj)
79 { return ValType::getTypeStr (obj); }
80inline String valDataTypeId (const DComplex* obj)
81 { return ValType::getTypeStr (obj); }
82inline String valDataTypeId (const String* obj)
83 { return ValType::getTypeStr (obj); }
84inline String valDataTypeId (const TableRecord* obj)
85 { return ValType::getTypeStr (obj); }
86
87// </group>
88
89} //# NAMESPACE CASACORE - END
90
91#endif
92
93
94
String: the storage and methods of handling collections of characters.
Definition String.h:223
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:45
short Short
Definition aipstype.h:46
unsigned int uInt
Definition aipstype.h:49
unsigned short uShort
Definition aipstype.h:47
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition aipsxtype.h:36
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
char Char
Definition aipstype.h:44
String valDataTypeId(const Short *obj)
Definition ValTypeId.h:64
String valDataTypeId(const float *obj)
Definition ValTypeId.h:74
String valDataTypeId(const String *obj)
Definition ValTypeId.h:82
String valDataTypeId(const Int64 *obj)
Definition ValTypeId.h:72
String valDataTypeId(const TableRecord *obj)
Definition ValTypeId.h:84
String valDataTypeId(const uInt *obj)
Definition ValTypeId.h:70
String valDataTypeId(const Complex *obj)
Definition ValTypeId.h:78
String valDataTypeId(const Char *obj)
Definition ValTypeId.h:60
String valDataTypeId(const Bool *obj)
Definition ValTypeId.h:58
String valDataTypeId(const double *obj)
Definition ValTypeId.h:76
String valDataTypeId(const uChar *obj)
Definition ValTypeId.h:62
String valDataTypeId(const uShort *obj)
Definition ValTypeId.h:66
String valDataTypeId(const DComplex *obj)
Definition ValTypeId.h:80