vtkByteSwap Class Reference

#include <vtkByteSwap.h>

Inheritance diagram for vtkByteSwap:

vtkObject vtkObjectBase List of all members.

Detailed Description

perform machine dependent byte swapping

vtkByteSwap is used by other classes to perform machine dependent byte swapping. Byte swapping is often used when reading or writing binary files.

Tests:
vtkByteSwap (Tests)

Definition at line 31 of file vtkByteSwap.h.

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)

Static Public Member Functions

static vtkByteSwapNew ()
static int IsTypeOf (const char *type)
static vtkByteSwapSafeDownCast (vtkObject *o)
static void SwapVoidRange (void *buffer, int numWords, int wordSize)
static void Swap2LE (short *s)
static void Swap2LE (unsigned short *s)
static void Swap4LE (char *c)
static void Swap4LE (float *p)
static void Swap4LE (int *i)
static void Swap4LE (unsigned int *i)
static void Swap4LE (long *i)
static void Swap4LE (unsigned long *i)
static void Swap8LE (char *c)
static void Swap8LE (double *d)
static void Swap2LERange (char *c, int num)
static void Swap2LERange (short *i, int num)
static void Swap4LERange (char *c, int num)
static void Swap4LERange (unsigned char *c, int num)
static void Swap4LERange (float *p, int num)
static void Swap4LERange (int *i, int num)
static void Swap4LERange (unsigned int *i, int num)
static void Swap4LERange (long *i, int num)
static void Swap4LERange (unsigned long *i, int num)
static void Swap8LERange (char *c, int num)
static void Swap8LERange (double *d, int num)
static void Swap2BE (short *s)
static void Swap2BE (unsigned short *s)
static void Swap4BE (char *c)
static void Swap4BE (float *p)
static void Swap4BE (int *i)
static void Swap4BE (unsigned int *i)
static void Swap4BE (long *i)
static void Swap4BE (unsigned long *i)
static void Swap8BE (char *c)
static void Swap8BE (double *d)
static void Swap2BERange (char *c, int num)
static void Swap2BERange (short *i, int num)
static void Swap4BERange (char *c, int num)
static void Swap4BERange (float *p, int num)
static void Swap4BERange (int *i, int num)
static void Swap4BERange (unsigned int *i, int num)
static void Swap4BERange (long *i, int num)
static void Swap4BERange (unsigned long *i, int num)
static void Swap8BERange (char *c, int num)
static void Swap8BERange (double *d, int num)
static void SwapWrite2BERange (char *c, int num, FILE *fp)
static void SwapWrite2BERange (short *i, int num, FILE *fp)
static void SwapWrite4BERange (char *c, int num, FILE *fp)
static void SwapWrite4BERange (float *p, int num, FILE *fp)
static void SwapWrite4BERange (int *i, int num, FILE *fp)
static void SwapWrite4BERange (unsigned int *i, int num, FILE *fp)
static void SwapWrite4BERange (unsigned long *i, int num, FILE *fp)
static void SwapWrite4BERange (long *i, int num, FILE *fp)
static void SwapWrite8BERange (char *c, int num, FILE *fp)
static void SwapWrite8BERange (double *d, int num, FILE *fp)
static void SwapWrite2BERange (char *c, int num, ostream *fp)
static void SwapWrite2BERange (short *i, int num, ostream *fp)
static void SwapWrite4BERange (char *c, int num, ostream *fp)
static void SwapWrite4BERange (float *p, int num, ostream *fp)
static void SwapWrite4BERange (int *i, int num, ostream *fp)
static void SwapWrite4BERange (unsigned int *i, int num, ostream *fp)
static void SwapWrite4BERange (unsigned long *i, int num, ostream *fp)
static void SwapWrite4BERange (long *i, int num, ostream *fp)
static void SwapWrite8BERange (char *c, int num, ostream *fp)
static void SwapWrite8BERange (double *d, int num, ostream *fp)

Protected Member Functions

 vtkByteSwap ()
 ~vtkByteSwap ()


Member Typedef Documentation

typedef vtkObject vtkByteSwap::Superclass
 

Reimplemented from vtkObject.

Definition at line 35 of file vtkByteSwap.h.


Constructor & Destructor Documentation

vtkByteSwap::vtkByteSwap  )  [inline, protected]
 

Definition at line 237 of file vtkByteSwap.h.

vtkByteSwap::~vtkByteSwap  )  [inline, protected]
 

Definition at line 238 of file vtkByteSwap.h.


Member Function Documentation

static vtkByteSwap* vtkByteSwap::New  )  [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual const char* vtkByteSwap::GetClassName  )  [virtual]
 

Reimplemented from vtkObject.

static int vtkByteSwap::IsTypeOf const char *  type  )  [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkByteSwap::IsA const char *  type  )  [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

static vtkByteSwap* vtkByteSwap::SafeDownCast vtkObject o  )  [static]
 

Reimplemented from vtkObject.

static void vtkByteSwap::Swap2LE short *  s  )  [static]
 

Swap 2 byte word to be LE.

static void vtkByteSwap::Swap2LE unsigned short *  s  )  [static]
 

Swap 2 byte word to be LE.

static void vtkByteSwap::Swap4LE char *  c  )  [static]
 

Swap four byte word to be LE.

Referenced by Swap4LE().

static void vtkByteSwap::Swap4LE float *  p  )  [inline, static]
 

Swap four byte word to be LE.

Definition at line 46 of file vtkByteSwap.h.

References Swap4LE().

static void vtkByteSwap::Swap4LE int *  i  )  [inline, static]
 

Swap four byte word to be LE.

Definition at line 47 of file vtkByteSwap.h.

References Swap4LE().

static void vtkByteSwap::Swap4LE unsigned int *  i  )  [inline, static]
 

Swap four byte word to be LE.

Definition at line 48 of file vtkByteSwap.h.

References Swap4LE().

static void vtkByteSwap::Swap4LE long *  i  )  [inline, static]
 

Swap four byte word to be LE.

Definition at line 49 of file vtkByteSwap.h.

References Swap4LE().

static void vtkByteSwap::Swap4LE unsigned long *  i  )  [inline, static]
 

Swap four byte word to be LE.

Definition at line 50 of file vtkByteSwap.h.

References Swap4LE().

static void vtkByteSwap::Swap8LE char *  c  )  [static]
 

Swap eight byte word to be LE. Currently implemented for doubles, but will be necessary for 64bit integers? 16bit chars?

Referenced by Swap8LE().

static void vtkByteSwap::Swap8LE double *  d  )  [inline, static]
 

Swap eight byte word to be LE. Currently implemented for doubles, but will be necessary for 64bit integers? 16bit chars?

Definition at line 57 of file vtkByteSwap.h.

References Swap8LE().

static void vtkByteSwap::Swap2LERange char *  c,
int  num
[static]
 

Swap bunch of bytes to LE. Num is the number of two byte words to swap.

Referenced by Swap2LERange().

static void vtkByteSwap::Swap2LERange short *  i,
int  num
[inline, static]
 

Swap bunch of bytes to LE. Num is the number of two byte words to swap.

Definition at line 64 of file vtkByteSwap.h.

References Swap2LERange().

static void vtkByteSwap::Swap4LERange char *  c,
int  num
[static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Referenced by Swap4LERange().

static void vtkByteSwap::Swap4LERange unsigned char *  c,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Definition at line 72 of file vtkByteSwap.h.

References Swap4LERange().

static void vtkByteSwap::Swap4LERange float *  p,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Definition at line 74 of file vtkByteSwap.h.

References Swap4LERange().

static void vtkByteSwap::Swap4LERange int *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Definition at line 76 of file vtkByteSwap.h.

References Swap4LERange().

static void vtkByteSwap::Swap4LERange unsigned int *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Definition at line 78 of file vtkByteSwap.h.

References Swap4LERange().

static void vtkByteSwap::Swap4LERange long *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Definition at line 80 of file vtkByteSwap.h.

References Swap4LERange().

static void vtkByteSwap::Swap4LERange unsigned long *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of four byte words to swap.

Definition at line 82 of file vtkByteSwap.h.

References Swap4LERange().

static void vtkByteSwap::Swap8LERange char *  c,
int  num
[static]
 

Swap bunch of bytes to be LE. Num is the number of eight byte words to swap. Currently implemented for doubles...

Referenced by Swap8LERange().

static void vtkByteSwap::Swap8LERange double *  d,
int  num
[inline, static]
 

Swap bunch of bytes to be LE. Num is the number of eight byte words to swap. Currently implemented for doubles...

Definition at line 90 of file vtkByteSwap.h.

References Swap8LERange().

static void vtkByteSwap::Swap2BE short *  s  )  [static]
 

Swap 2 byte word to BE.

static void vtkByteSwap::Swap2BE unsigned short *  s  )  [static]
 

Swap 2 byte word to BE.

static void vtkByteSwap::Swap4BE char *  c  )  [static]
 

For writing, swap four byte word to be BE. For reading, swap four byte word from BE to machine's internal representation.

Referenced by Swap4BE().

static void vtkByteSwap::Swap4BE float *  p  )  [inline, static]
 

For writing, swap four byte word to be BE. For reading, swap four byte word from BE to machine's internal representation.

Definition at line 104 of file vtkByteSwap.h.

References Swap4BE().

static void vtkByteSwap::Swap4BE int *  i  )  [inline, static]
 

For writing, swap four byte word to be BE. For reading, swap four byte word from BE to machine's internal representation.

Definition at line 105 of file vtkByteSwap.h.

References Swap4BE().

static void vtkByteSwap::Swap4BE unsigned int *  i  )  [inline, static]
 

For writing, swap four byte word to be BE. For reading, swap four byte word from BE to machine's internal representation.

Definition at line 106 of file vtkByteSwap.h.

References Swap4BE().

static void vtkByteSwap::Swap4BE long *  i  )  [inline, static]
 

For writing, swap four byte word to be BE. For reading, swap four byte word from BE to machine's internal representation.

Definition at line 107 of file vtkByteSwap.h.

References Swap4BE().

static void vtkByteSwap::Swap4BE unsigned long *  i  )  [inline, static]
 

For writing, swap four byte word to be BE. For reading, swap four byte word from BE to machine's internal representation.

Definition at line 108 of file vtkByteSwap.h.

References Swap4BE().

static void vtkByteSwap::Swap8BE char *  c  )  [static]
 

For writing, swap eight byte word to be BE. For reading, swap eight byte word from BE to machine's internal representation.

Referenced by Swap8BE().

static void vtkByteSwap::Swap8BE double *  d  )  [inline, static]
 

For writing, swap eight byte word to be BE. For reading, swap eight byte word from BE to machine's internal representation.

Definition at line 115 of file vtkByteSwap.h.

References Swap8BE().

static void vtkByteSwap::Swap2BERange char *  c,
int  num
[static]
 

Swap bunch of bytes to BE. Num is the number of two byte words to swap.

Referenced by Swap2BERange().

static void vtkByteSwap::Swap2BERange short *  i,
int  num
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of two byte words to swap.

Definition at line 122 of file vtkByteSwap.h.

References Swap2BERange().

static void vtkByteSwap::Swap4BERange char *  c,
int  num
[static]
 

Swap bunch of bytes to be BE. Num is the number of four byte words to swap.

Referenced by Swap4BERange().

static void vtkByteSwap::Swap4BERange float *  p,
int  num
[inline, static]
 

Swap bunch of bytes to be BE. Num is the number of four byte words to swap.

Definition at line 130 of file vtkByteSwap.h.

References Swap4BERange().

static void vtkByteSwap::Swap4BERange int *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be BE. Num is the number of four byte words to swap.

Definition at line 132 of file vtkByteSwap.h.

References Swap4BERange().

static void vtkByteSwap::Swap4BERange unsigned int *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be BE. Num is the number of four byte words to swap.

Definition at line 134 of file vtkByteSwap.h.

References Swap4BERange().

static void vtkByteSwap::Swap4BERange long *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be BE. Num is the number of four byte words to swap.

Definition at line 136 of file vtkByteSwap.h.

References Swap4BERange().

static void vtkByteSwap::Swap4BERange unsigned long *  i,
int  num
[inline, static]
 

Swap bunch of bytes to be BE. Num is the number of four byte words to swap.

Definition at line 138 of file vtkByteSwap.h.

References Swap4BERange().

static void vtkByteSwap::Swap8BERange char *  c,
int  num
[static]
 

Swap bunch of bytes to be BE. Num is the number of eight byte words to swap.

Referenced by Swap8BERange().

static void vtkByteSwap::Swap8BERange double *  d,
int  num
[inline, static]
 

Swap bunch of bytes to be BE. Num is the number of eight byte words to swap.

Definition at line 151 of file vtkByteSwap.h.

References Swap8BERange().

static void vtkByteSwap::SwapWrite2BERange char *  c,
int  num,
FILE *  fp
[static]
 

Swap bunch of bytes to BE. Num is the number of two byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Referenced by SwapWrite2BERange().

static void vtkByteSwap::SwapWrite2BERange short *  i,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of two byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 160 of file vtkByteSwap.h.

References SwapWrite2BERange().

static void vtkByteSwap::SwapWrite4BERange char *  c,
int  num,
FILE *  fp
[static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Referenced by SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange float *  p,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 169 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange int *  i,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 171 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange unsigned int *  i,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 173 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange unsigned long *  i,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 175 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange long *  i,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 177 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite8BERange char *  c,
int  num,
FILE *  fp
[static]
 

Swap bunch of bytes to BE. Num is the number of eight byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory. Implemented for doubles for now.

Referenced by SwapWrite8BERange().

static void vtkByteSwap::SwapWrite8BERange double *  d,
int  num,
FILE *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to file to prevent having to keep the swapped copy in memory.

Definition at line 189 of file vtkByteSwap.h.

References SwapWrite8BERange().

static void vtkByteSwap::SwapWrite2BERange char *  c,
int  num,
ostream *  fp
[static]
 

Swap bunch of bytes to BE. Num is the number of two byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

static void vtkByteSwap::SwapWrite2BERange short *  i,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of two byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 198 of file vtkByteSwap.h.

References SwapWrite2BERange().

static void vtkByteSwap::SwapWrite4BERange char *  c,
int  num,
ostream *  fp
[static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

static void vtkByteSwap::SwapWrite4BERange float *  p,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 207 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange int *  i,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 209 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange unsigned int *  i,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 211 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange unsigned long *  i,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 213 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite4BERange long *  i,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 215 of file vtkByteSwap.h.

References SwapWrite4BERange().

static void vtkByteSwap::SwapWrite8BERange char *  c,
int  num,
ostream *  fp
[static]
 

Swap bunch of bytes to BE. Num is the number of eight byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

static void vtkByteSwap::SwapWrite8BERange double *  d,
int  num,
ostream *  fp
[inline, static]
 

Swap bunch of bytes to BE. Num is the number of four byte words to swap. The results are written out to stream to prevent having to keep the swapped copy in memory.

Definition at line 227 of file vtkByteSwap.h.

References SwapWrite8BERange().

static void vtkByteSwap::SwapVoidRange void *  buffer,
int  numWords,
int  wordSize
[static]
 

Swaps the bytes of a buffer. Uses an arbitrary word size, but assumes the word size is divisible by two.


The documentation for this class was generated from the following file: