casacore
Loading...
Searching...
No Matches
ModcompDataConversion.h
Go to the documentation of this file.
1//# ModcompDataConversion.h: A DataConversion class to convert Modcomp format.
2//# Copyright (C) 1999,2001
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_MODCOMPDATACONVERSION_H
27#define CASA_MODCOMPDATACONVERSION_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/OS/DataConversion.h>
31
32namespace casacore { //# NAMESPACE CASACORE - BEGIN
33
34// <summary>A DataConversion class to convert between Modcomp format.</summary>
35
36// <use visibility=export>
37
38// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
39// </reviewed>
40
41// <synopsis>
42// This class is a specialization of the abstract base class
43// <linkto class=DataConversion>DataConversion</linkto>.
44// It contains functions to convert data from/to the Modcomp format
45// using the static functions in class <linkto class=ModcompConversion>
46// ModcompConversion</linkto>.
47// </synopsis>
48
49// <example>
50// See example in class <linkto class=DataConversion>DataConversion</linkto>.
51// </example>
52
53// <motivation>
54// This class is an addition to <linkto class=ModcompConversion>
55// ModcompConversion</linkto>
56// to be able to use the conversion functions in a polymorphic way.
57// </motivation>
58
59// <todo asof="$DATE$">
60// <li> Support data type long Double.
61// </todo>
62
63
65{
66public:
67 // Construct the object.
69
71
72 // Convert one value from Modcomp format to local format.
73 // The from and to buffer should not overlap.
74 // <group>
75 virtual size_t toLocal (Char& to, const void* from) const;
76 virtual size_t toLocal (uChar& to, const void* from) const;
77 virtual size_t toLocal (Short& to, const void* from) const;
78 virtual size_t toLocal (uShort& to, const void* from) const;
79 virtual size_t toLocal (Int& to, const void* from) const;
80 virtual size_t toLocal (uInt& to, const void* from) const;
81 virtual size_t toLocal (Int64& to, const void* from) const;
82 virtual size_t toLocal (uInt64& to, const void* from) const;
83 virtual size_t toLocal (Float& to, const void* from) const;
84 virtual size_t toLocal (Double& to, const void* from) const;
85 // </group>
86
87 // Convert nr values from Modcomp format to local format.
88 // The from and to buffer should not overlap.
89 // <group>
90 virtual size_t toLocal (Char* to, const void* from, size_t nr) const;
91 virtual size_t toLocal (uChar* to, const void* from, size_t nr) const;
92 virtual size_t toLocal (Short* to, const void* from, size_t nr) const;
93 virtual size_t toLocal (uShort* to, const void* from, size_t nr) const;
94 virtual size_t toLocal (Int* to, const void* from, size_t nr) const;
95 virtual size_t toLocal (uInt* to, const void* from, size_t nr) const;
96 virtual size_t toLocal (Int64* to, const void* from, size_t nr) const;
97 virtual size_t toLocal (uInt64* to, const void* from, size_t nr) const;
98 virtual size_t toLocal (Float* to, const void* from, size_t nr) const;
99 virtual size_t toLocal (Double* to, const void* from, size_t nr) const;
100 // </group>
101
102 // Convert one value from local format to Modcomp format.
103 // The from and to buffer should not overlap.
104 // <group>
105 virtual size_t fromLocal (void* to, Char from) const;
106 virtual size_t fromLocal (void* to, uChar from) const;
107 virtual size_t fromLocal (void* to, Short from) const;
108 virtual size_t fromLocal (void* to, uShort from) const;
109 virtual size_t fromLocal (void* to, Int from) const;
110 virtual size_t fromLocal (void* to, uInt from) const;
111 virtual size_t fromLocal (void* to, Int64 from) const;
112 virtual size_t fromLocal (void* to, uInt64 from) const;
113 virtual size_t fromLocal (void* to, Float from) const;
114 virtual size_t fromLocal (void* to, Double from) const;
115 // </group>
116
117 // Convert nr values from local format to ModComp format.
118 // The from and to buffer should not overlap.
119 // <group>
120 virtual size_t fromLocal (void* to, const Char* from, size_t nr) const;
121 virtual size_t fromLocal (void* to, const uChar* from, size_t nr) const;
122 virtual size_t fromLocal (void* to, const Short* from, size_t nr) const;
123 virtual size_t fromLocal (void* to, const uShort* from, size_t nr) const;
124 virtual size_t fromLocal (void* to, const Int* from, size_t nr) const;
125 virtual size_t fromLocal (void* to, const uInt* from, size_t nr) const;
126 virtual size_t fromLocal (void* to, const Int64* from, size_t nr) const;
127 virtual size_t fromLocal (void* to, const uInt64* from, size_t nr) const;
128 virtual size_t fromLocal (void* to, const Float* from, size_t nr) const;
129 virtual size_t fromLocal (void* to, const Double* from, size_t nr) const;
130 // </group>
131
132 // Determine if the data for a data type can be simply copied, thus
133 // if no conversion is needed.
134 // <group>
135 virtual Bool canCopy (const Char*) const;
136 virtual Bool canCopy (const uChar*) const;
137 virtual Bool canCopy (const Short*) const;
138 virtual Bool canCopy (const uShort*) const;
139 virtual Bool canCopy (const Int*) const;
140 virtual Bool canCopy (const uInt*) const;
141 virtual Bool canCopy (const Int64*) const;
142 virtual Bool canCopy (const uInt64*) const;
143 virtual Bool canCopy (const Float*) const;
144 virtual Bool canCopy (const Double*) const;
145 // </group>
146
147 // Get the external size of the data type.
148 // <group>
149 virtual uInt externalSize (const Char*) const;
150 virtual uInt externalSize (const uChar*) const;
151 virtual uInt externalSize (const Short*) const;
152 virtual uInt externalSize (const uShort*) const;
153 virtual uInt externalSize (const Int*) const;
154 virtual uInt externalSize (const uInt*) const;
155 virtual uInt externalSize (const Int64*) const;
156 virtual uInt externalSize (const uInt64*) const;
157 virtual uInt externalSize (const Float*) const;
158 virtual uInt externalSize (const Double*) const;
159 // </group>
160};
161
162
165
166} //# NAMESPACE CASACORE - END
167
168#endif
virtual size_t fromLocal(void *to, const uShort *from, size_t nr) const
virtual size_t toLocal(Int64 &to, const void *from) const
virtual Bool canCopy(const Int *) const
virtual size_t fromLocal(void *to, Int64 from) const
virtual size_t toLocal(Double *to, const void *from, size_t nr) const
virtual size_t fromLocal(void *to, const uInt64 *from, size_t nr) const
virtual uInt externalSize(const Char *) const
Get the external size of the data type.
virtual Bool canCopy(const Float *) const
virtual Bool canCopy(const uInt *) const
virtual size_t fromLocal(void *to, Char from) const
Convert one value from local format to Modcomp format.
virtual size_t toLocal(uInt64 *to, const void *from, size_t nr) const
virtual size_t toLocal(uInt &to, const void *from) const
virtual Bool canCopy(const uChar *) const
virtual uInt externalSize(const Int *) const
virtual size_t fromLocal(void *to, const Int *from, size_t nr) const
virtual size_t fromLocal(void *to, const Short *from, size_t nr) const
virtual size_t toLocal(Float &to, const void *from) const
virtual size_t toLocal(Short &to, const void *from) const
virtual size_t fromLocal(void *to, uChar from) const
virtual size_t fromLocal(void *to, uInt from) const
virtual size_t fromLocal(void *to, uInt64 from) const
virtual size_t fromLocal(void *to, Int from) const
virtual size_t fromLocal(void *to, Short from) const
virtual size_t toLocal(Short *to, const void *from, size_t nr) const
virtual size_t toLocal(Int &to, const void *from) const
virtual size_t fromLocal(void *to, const uChar *from, size_t nr) const
virtual size_t toLocal(uChar &to, const void *from) const
virtual uInt externalSize(const uInt64 *) const
virtual size_t fromLocal(void *to, const Char *from, size_t nr) const
Convert nr values from local format to ModComp format.
virtual size_t fromLocal(void *to, const Int64 *from, size_t nr) const
virtual Bool canCopy(const Int64 *) const
virtual size_t toLocal(Double &to, const void *from) const
virtual size_t toLocal(Char *to, const void *from, size_t nr) const
Convert nr values from Modcomp format to local format.
virtual Bool canCopy(const Char *) const
Determine if the data for a data type can be simply copied, thus if no conversion is needed.
virtual size_t toLocal(Int64 *to, const void *from, size_t nr) const
virtual size_t fromLocal(void *to, uShort from) const
virtual uInt externalSize(const Double *) const
virtual uInt externalSize(const Short *) const
virtual size_t toLocal(uInt *to, const void *from, size_t nr) const
virtual size_t toLocal(Float *to, const void *from, size_t nr) const
virtual size_t fromLocal(void *to, const Double *from, size_t nr) const
virtual size_t fromLocal(void *to, const Float *from, size_t nr) const
virtual uInt externalSize(const uChar *) const
virtual uInt externalSize(const uInt *) const
virtual size_t toLocal(uShort *to, const void *from, size_t nr) const
virtual uInt externalSize(const uShort *) const
virtual size_t toLocal(uShort &to, const void *from) const
virtual Bool canCopy(const uInt64 *) const
virtual size_t toLocal(Char &to, const void *from) const
Convert one value from Modcomp format to local format.
ModcompDataConversion()
Construct the object.
virtual size_t toLocal(Int *to, const void *from, size_t nr) const
virtual Bool canCopy(const Short *) const
virtual size_t toLocal(uInt64 &to, const void *from) const
virtual size_t toLocal(uChar *to, const void *from, size_t nr) const
virtual size_t fromLocal(void *to, Float from) const
virtual size_t fromLocal(void *to, Double from) const
virtual Bool canCopy(const uShort *) const
virtual Bool canCopy(const Double *) const
virtual size_t fromLocal(void *to, const uInt *from, size_t nr) const
virtual uInt externalSize(const Float *) const
virtual uInt externalSize(const Int64 *) const
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
float Float
Definition aipstype.h:52
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53
char Char
Definition aipstype.h:44
unsigned long long uInt64
Definition aipsxtype.h:37