ModcompConversion.h

Classes

ModcompConversion -- Static functions to convert Modcomp numeric formats (full description)

class ModcompConversion

Interface

Public Members
static uInt toLocal(Char& to, const void* from)
static uInt toLocal(uChar& to, const void* from)
static uInt toLocal(Short& to, const void* from)
static uInt toLocal(uShort& to, const void* from)
static uInt toLocal(Int& to, const void* from)
static uInt toLocal(uInt& to, const void* from)
static uInt toLocal(Int64& to, const void* from)
static uInt toLocal(uInt64& to, const void* from)
static uInt toLocal(Float& to, const void* from)
static uInt toLocal(Double& to, const void* from)
static uInt toLocal(Char* to, const void* from, uInt nr)
static uInt toLocal(uChar* to, const void* from, uInt nr)
static uInt toLocal(Short* to, const void* from, uInt nr)
static uInt toLocal(uShort* to, const void* from, uInt nr)
static uInt toLocal(Int* to, const void* from, uInt nr)
static uInt toLocal(uInt* to, const void* from, uInt nr)
static uInt toLocal(Int64* to, const void* from, uInt nr)
static uInt toLocal(uInt64* to, const void* from, uInt nr)
static uInt toLocal(Float* to, const void* from, uInt nr)
static uInt toLocal(Double* to, const void* from, uInt nr)
static uInt fromLocal(void* to, Char from)
static uInt fromLocal(void* to, uChar from)
static uInt fromLocal(void* to, Short from)
static uInt fromLocal(void* to, uShort from)
static uInt fromLocal(void* to, Int from)
static uInt fromLocal(void* to, uInt from)
static uInt fromLocal(void* to, Int64 from)
static uInt fromLocal(void* to, uInt64 from)
static uInt fromLocal(void* to, Float from)
static uInt fromLocal(void* to, Double from)
static uInt fromLocal(void* to, const Char* from, uInt nr)
static uInt fromLocal(void* to, const uChar* from, uInt nr)
static uInt fromLocal(void* to, const Short* from, uInt nr)
static uInt fromLocal(void* to, const uShort* from, uInt nr)
static uInt fromLocal(void* to, const Int* from, uInt nr)
static uInt fromLocal(void* to, const uInt* from, uInt nr)
static uInt fromLocal(void* to, const Int64* from, uInt nr)
static uInt fromLocal(void* to, const uInt64* from, uInt nr)
static uInt fromLocal(void* to, const Float* from, uInt nr)
static uInt fromLocal(void* to, const Double* from, uInt nr)
Private Members
ModcompConversion()

Description

Review Status

Date Reviewed:
yyyy/mm/dd
Programs:
Tests:

Synopsis

This class contains static toLocal functions to convert data from Modcomp format to local format and vice-versa.

The functions work on both big-endian and little-endian machines. They convert between Modcomp 2-byte integers and Shorts (or uShorts) and Modcomp 4-byte integers and Ints (or uInts, Int64s or uInt64s).

It is currently not possible to convert floating point numbers from local format to Modcomp. Attempting to do so will throw an exception (AipsError).

Motivation

The VLA data is stored using Modcomp numeric data formats and needs to be converted to the local format to be manipulated.

To Do

Member Description

static uInt toLocal(Char& to, const void* from)
static uInt toLocal(uChar& to, const void* from)
static uInt toLocal(Short& to, const void* from)
static uInt toLocal(uShort& to, const void* from)
static uInt toLocal(Int& to, const void* from)
static uInt toLocal(uInt& to, const void* from)
static uInt toLocal(Int64& to, const void* from)
static uInt toLocal(uInt64& to, const void* from)
static uInt toLocal(Float& to, const void* from)
static uInt toLocal(Double& to, const void* from)

Convert one value from Modcomp format to local format. The from and to buffer should not overlap.

static uInt toLocal(Char* to, const void* from, uInt nr)
static uInt toLocal(uChar* to, const void* from, uInt nr)
static uInt toLocal(Short* to, const void* from, uInt nr)
static uInt toLocal(uShort* to, const void* from, uInt nr)
static uInt toLocal(Int* to, const void* from, uInt nr)
static uInt toLocal(uInt* to, const void* from, uInt nr)
static uInt toLocal(Int64* to, const void* from, uInt nr)
static uInt toLocal(uInt64* to, const void* from, uInt nr)
static uInt toLocal(Float* to, const void* from, uInt nr)
static uInt toLocal(Double* to, const void* from, uInt nr)

Convert nr values from Modcomp format to local format. The from and to buffer should not overlap.

static uInt fromLocal(void* to, Char from)
static uInt fromLocal(void* to, uChar from)
static uInt fromLocal(void* to, Short from)
static uInt fromLocal(void* to, uShort from)
static uInt fromLocal(void* to, Int from)
static uInt fromLocal(void* to, uInt from)
static uInt fromLocal(void* to, Int64 from)
static uInt fromLocal(void* to, uInt64 from)
static uInt fromLocal(void* to, Float from)
static uInt fromLocal(void* to, Double from)

Convert one value from local format to Modcomp format. The from and to buffer should not overlap. The floating point functions will throw exceptions as they are not implemented yet.

static uInt fromLocal(void* to, const Char* from, uInt nr)
static uInt fromLocal(void* to, const uChar* from, uInt nr)
static uInt fromLocal(void* to, const Short* from, uInt nr)
static uInt fromLocal(void* to, const uShort* from, uInt nr)
static uInt fromLocal(void* to, const Int* from, uInt nr)
static uInt fromLocal(void* to, const uInt* from, uInt nr)
static uInt fromLocal(void* to, const Int64* from, uInt nr)
static uInt fromLocal(void* to, const uInt64* from, uInt nr)
static uInt fromLocal(void* to, const Float* from, uInt nr)
static uInt fromLocal(void* to, const Double* from, uInt nr)

Convert nr values from local format to Modcomp format. The from and to buffer should not overlap. The floating point functions will throw exceptions as they are not implemented yet.

ModcompConversion()

This class should not be constructed (so declare the constructor private).