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>
57inline String valDataTypeId(const T*) {
58 return T::dataTypeId();
59}
60inline String valDataTypeId(const Bool* obj) { return ValType::getTypeStr(obj); }
61inline String valDataTypeId(const Char* obj) { return ValType::getTypeStr(obj); }
62inline String valDataTypeId(const uChar* obj) { return ValType::getTypeStr(obj); }
63inline String valDataTypeId(const Short* obj) { return ValType::getTypeStr(obj); }
64inline String valDataTypeId(const uShort* obj) { return ValType::getTypeStr(obj); }
65inline String valDataTypeId(const Int* obj) { return ValType::getTypeStr(obj); }
66inline String valDataTypeId(const uInt* obj) { return ValType::getTypeStr(obj); }
67inline String valDataTypeId(const Int64* obj) { return ValType::getTypeStr(obj); }
68inline String valDataTypeId(const float* obj) { return ValType::getTypeStr(obj); }
69inline String valDataTypeId(const double* obj) { return ValType::getTypeStr(obj); }
70inline String valDataTypeId(const Complex* obj) { return ValType::getTypeStr(obj); }
71inline String valDataTypeId(const DComplex* obj) { return ValType::getTypeStr(obj); }
72inline String valDataTypeId(const String* obj) { return ValType::getTypeStr(obj); }
73inline String valDataTypeId(const TableRecord* obj) { return ValType::getTypeStr(obj); }
74
75// </group>
76
77} // namespace casacore
78
79#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
static const String & getTypeStr(DataType)
Get the name of the data type.
For temporary backward namespace compatibility, use casa as alias for casacore.
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:63
String valDataTypeId(const float *obj)
Definition ValTypeId.h:68
String valDataTypeId(const String *obj)
Definition ValTypeId.h:72
String valDataTypeId(const Int64 *obj)
Definition ValTypeId.h:67
String valDataTypeId(const TableRecord *obj)
Definition ValTypeId.h:73
String valDataTypeId(const uInt *obj)
Definition ValTypeId.h:66
String valDataTypeId(const Complex *obj)
Definition ValTypeId.h:70
String valDataTypeId(const Char *obj)
Definition ValTypeId.h:61
String valDataTypeId(const Bool *obj)
Definition ValTypeId.h:60
String valDataTypeId(const double *obj)
Definition ValTypeId.h:69
String valDataTypeId(const uChar *obj)
Definition ValTypeId.h:62
String valDataTypeId(const uShort *obj)
Definition ValTypeId.h:64
String valDataTypeId(const DComplex *obj)
Definition ValTypeId.h:71