casa
5.7.0-16
|
A class with general conversion definitions. More...
#include <Conversion.h>
Public Types | |
typedef size_t | ValueFunction (void *to, const void *from, size_t nvalues) |
Define the signature of a function converting nvalues values from internal to external format or vice-versa. More... | |
typedef void * | ByteFunction (void *to, const void *from, size_t nbytes) |
Define the signature of a function converting from one format to another providing the number of bytes. More... | |
Static Public Member Functions | |
static size_t | boolToBit (void *to, const void *from, size_t nvalues) |
Convert a stream of Bools to output format (as bits). More... | |
static void | boolToBit (void *to, const void *from, size_t startBit, size_t nvalues) |
static size_t | bitToBool (void *to, const void *from, size_t nvalues) |
Convert a stream of Bools to output format (as bits). More... | |
static void | bitToBool (void *to, const void *from, size_t startBit, size_t nvalues) |
static size_t | valueCopy (void *to, const void *from, size_t nbytes) |
Copy a value using memcpy. More... | |
static ByteFunction * | getmemcpy () |
Get a pointer to the memcpy function. More... | |
Static Private Member Functions | |
static size_t | bitToBool_ (void *to, const void *from, size_t nvalues) |
Copy bits to Bool in an unoptimized way needed when 'to' is not aligned properly. More... | |
A class with general conversion definitions.
Public interface
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.
This provides a common place for definitions used elsewhere. It also provides a uniform interface to memcpy.
Definition at line 85 of file Conversion.h.
typedef void* casacore::Conversion::ByteFunction(void *to, const void *from, size_t 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 108 of file Conversion.h.
typedef size_t casacore::Conversion::ValueFunction(void *to, const void *from, size_t 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 100 of file Conversion.h.
|
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 |
|
staticprivate |
Copy bits to Bool in an unoptimized way needed when 'to' is not aligned properly.
|
static |
Convert a stream of Bools to output format (as bits).
The variable startBit
(0-relative) indicates where to start in the to
buffer.
|
static |
|
inlinestatic |
Get a pointer to the memcpy function.
Definition at line 152 of file Conversion.h.
|
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;