Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1Conversion.html
Дата изменения: Unknown
Дата индексирования: Mon Feb 14 21:33:38 2011
Кодировка:
casacore: casa::Conversion Class Reference
Public Types | Static Public Member Functions

casa::Conversion Class Reference
[OS_module]

A class with general conversion definitions. More...

#include <Conversion.h>

List of all members.

Public Types

typedef unsigned int ValueFunction (void *to, const void *from, unsigned int nvalues)
 Define the signature of a function converting nvalues values from internal to external format or vice-versa.
typedef void * ByteFunction (void *to, const void *from, unsigned int nbytes)
 Define the signature of a function converting from one format to another providing the number of bytes.

Static Public Member Functions

static unsigned int boolToBit (void *to, const void *from, unsigned int nvalues)
 Convert a stream of Bools to output format (as bits).
static void boolToBit (void *to, const void *from, unsigned int startBit, unsigned int nvalues)
static unsigned int bitToBool (void *to, const void *from, unsigned int nvalues)
 Convert a stream of Bools to output format (as bits).
static void bitToBool (void *to, const void *from, unsigned int startBit, unsigned int nvalues)
static unsigned int valueCopy (void *to, const void *from, unsigned int nbytes)
 Copy a value using memcpy.
static ByteFunctiongetmemcpy ()
 Get a pointer to the memcpy function.
static void * mymemcpy (void *to, const void *from, unsigned int nbytes)
 A placeholder for the ObjectCenter or DEC-alpha memcpy or 64bit SGI Also added this for HPUX11 (2b provided in the makedefs) (because they do not use an unsigned int for nbytes).

Detailed Description

A class with general conversion definitions.

Intended use:

Public interface

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1996/11/06
Test programs:
tConversion

Synopsis

This class contains the general definitions for the Conversion classes.

Static functions in the classes CanonicalConversion , VAXConversion , and IBMConversion convert data from/to canonical, VAX, and IBM/360 format, resp.\.
Classes derived from DataConversion provide the same functionality in a polymorphic way.

Motivation

This provides a common place for definitions used elsewhere. It also provides a uniform interface to memcpy.

Definition at line 84 of file Conversion.h.


Member Typedef Documentation

typedef void* casa::Conversion::ByteFunction(void *to, const void *from, unsigned int nbytes)

Define the signature of a function converting from one format to another providing the number of bytes.

It returns the to pointer (similar to memcpy). (For example the byteTo/FromLocalXXX functions in class CanonicalConversion .

Definition at line 107 of file Conversion.h.

typedef unsigned int casa::Conversion::ValueFunction(void *to, const void *from, unsigned int nvalues)

Define the signature of a function converting nvalues values from internal to external format or vice-versa.

These functions are used in the IO framework , but are also used in the table system. Examples of such conversions are:
- local <-> canonical (when storing in canonical format)
- local <-> local (when storing in local format)
- binary <-> ASCII
It returns the number of bytes in external format. (For example the ToLocal/FromLocal functions in class CanonicalConversion return the number of bytes in canonical format).

Definition at line 99 of file Conversion.h.


Member Function Documentation

static unsigned int casa::Conversion::bitToBool ( void *  to,
const void *  from,
unsigned int  nvalues 
) [static]

Convert a stream of Bools to output format (as bits).

The variable startBit (0-relative) indicates where to start in the from buffer.

static void casa::Conversion::bitToBool ( void *  to,
const void *  from,
unsigned int  startBit,
unsigned int  nvalues 
) [static]
static void casa::Conversion::boolToBit ( void *  to,
const void *  from,
unsigned int  startBit,
unsigned int  nvalues 
) [static]
static unsigned int casa::Conversion::boolToBit ( void *  to,
const void *  from,
unsigned int  nvalues 
) [static]

Convert a stream of Bools to output format (as bits).

The variable startBit (0-relative) indicates where to start in the to buffer.

Conversion::ByteFunction * casa::Conversion::getmemcpy (  )  [inline, static]

Get a pointer to the memcpy function.

Definition at line 150 of file Conversion.h.

static void* casa::Conversion::mymemcpy ( void *  to,
const void *  from,
unsigned int  nbytes 
) [static]

A placeholder for the ObjectCenter or DEC-alpha memcpy or 64bit SGI Also added this for HPUX11 (2b provided in the makedefs) (because they do not use an unsigned int for nbytes).

static unsigned int casa::Conversion::valueCopy ( void *  to,
const void *  from,
unsigned int  nbytes 
) [static]

Copy a value using memcpy.

It differs from memcpy in the return value.
Note: This version has the ValueFunction signature, but it expects as input the number of bytes;


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines