Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::ByteSwapper< T > Class Template Reference
[Input and Output FiltersOS System Objects]

Perform machine dependent byte swapping. More...

#include <itkByteSwapper.h>

Inheritance diagram for itk::ByteSwapper< T >:

Inheritance graph
[legend]
Collaboration diagram for itk::ByteSwapper< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ByteSwapper Self
typedef Object Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer
typedef std::ostream OStreamType

Public Member Functions

virtual const char * GetClassName () const

Static Public Member Functions

void SwapFromSystemToBigEndian (T *p)
void SwapRangeFromSystemToBigEndian (T *p, unsigned long num)
void SwapFromSystemToLittleEndian (T *p)
void SwapRangeFromSystemToLittleEndian (T *p, unsigned long num)
bool SystemIsBigEndian ()
bool SystemIsBE ()
bool SystemIsLittleEndian ()
bool SystemIsLE ()
void SwapWriteRangeFromSystemToBigEndian (T *p, int num, OStreamType *fp)
void SwapWriteRangeFromSystemToLittleEndian (T *p, int num, OStreamType *fp)

Protected Member Functions

 ByteSwapper ()
 ~ByteSwapper ()

Static Protected Member Functions

void Swap2 (void *p)
void Swap2Range (void *p, unsigned long num)
void SwapWrite2Range (void *p, unsigned long num, OStreamType *fp)
void Swap4 (void *p)
void Swap4Range (void *p, unsigned long num)
void SwapWrite4Range (void *p, unsigned long num, OStreamType *fp)
void Swap8 (void *p)
void Swap8Range (void *p, unsigned long num)
void SwapWrite8Range (void *p, unsigned long num, OStreamType *fp)

Detailed Description

template<class T>
class itk::ByteSwapper< T >

Perform machine dependent byte swapping.

ByteSwapper is used by I/O classes to perform machine dependent byte swapping. Byte swapping is often used when reading or writing binary files. Files can either be Big Endian (BE) or Little Endian (LE).

Definition at line 41 of file itkByteSwapper.h.


Member Typedef Documentation

template<class T>
typedef SmartPointer<const Self> itk::ByteSwapper< T >::ConstPointer
 

Reimplemented from itk::Object.

Definition at line 48 of file itkByteSwapper.h.

template<class T>
typedef std::ostream itk::ByteSwapper< T >::OStreamType
 

Work around MSVC bug (including ByteSwapper.h in a templated class). Definition at line 51 of file itkByteSwapper.h.

Referenced by itk::ByteSwapper< T >::~ByteSwapper().

template<class T>
typedef SmartPointer<Self> itk::ByteSwapper< T >::Pointer
 

Reimplemented from itk::Object.

Definition at line 47 of file itkByteSwapper.h.

template<class T>
typedef ByteSwapper itk::ByteSwapper< T >::Self
 

Standard class typedefs.

Reimplemented from itk::Object.

Definition at line 45 of file itkByteSwapper.h.

template<class T>
typedef Object itk::ByteSwapper< T >::Superclass
 

Reimplemented from itk::Object.

Definition at line 46 of file itkByteSwapper.h.


Constructor & Destructor Documentation

template<class T>
itk::ByteSwapper< T >::ByteSwapper  )  [inline, protected]
 

Definition at line 112 of file itkByteSwapper.h.

template<class T>
itk::ByteSwapper< T >::~ByteSwapper  )  [inline, protected]
 

Definition at line 113 of file itkByteSwapper.h.

References itk::ByteSwapper< T >::OStreamType.


Member Function Documentation

template<class T>
virtual const char* itk::ByteSwapper< T >::GetClassName  )  const [virtual]
 

Run-time type information (and related methods).

Reimplemented from itk::Object.

template<class T>
void itk::ByteSwapper< T >::Swap2 void *  p  )  [static, protected]
 

Swap 2 bytes.

template<class T>
void itk::ByteSwapper< T >::Swap2Range void *  p,
unsigned long  num
[static, protected]
 

Swap a range of two-byte words. Num is the number of two-byte words to swap.

template<class T>
void itk::ByteSwapper< T >::Swap4 void *  p  )  [static, protected]
 

Swap four bytes.

template<class T>
void itk::ByteSwapper< T >::Swap4Range void *  p,
unsigned long  num
[static, protected]
 

Swap a range of four-byte words. Num is the number of four-byte words to swap.

template<class T>
void itk::ByteSwapper< T >::Swap8 void *  p  )  [static, protected]
 

Swap 8 bytes.

template<class T>
void itk::ByteSwapper< T >::Swap8Range void *  p,
unsigned long  num
[static, protected]
 

Swap a range of four-byte words. Num is the number of four-byte words to swap.

template<class T>
void itk::ByteSwapper< T >::SwapFromSystemToBigEndian T *  p  )  [static]
 

Generic swap method handles type T. The swapping is done in-place. Either 2-byte or 4-byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Big Endian.

template<class T>
void itk::ByteSwapper< T >::SwapFromSystemToLittleEndian T *  p  )  [static]
 

Generic swap method handles type T. The swapping is done in-place. Either 2-byte or 4-byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Little Endian.

template<class T>
void itk::ByteSwapper< T >::SwapRangeFromSystemToBigEndian T *  p,
unsigned long  num
[static]
 

Generic swap method handles type T. The swapping is done in-place. Either 2-byte or 4-byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Big Endian.

template<class T>
void itk::ByteSwapper< T >::SwapRangeFromSystemToLittleEndian T *  p,
unsigned long  num
[static]
 

Generic swap method handles type T. The swapping is done in-place. Either 2-byte or 4-byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Little Endian.

template<class T>
void itk::ByteSwapper< T >::SwapWrite2Range void *  p,
unsigned long  num,
OStreamType fp
[static, protected]
 

Swap and write a range of two-byte words. Num is the number of two-byte words to swap and write.

template<class T>
void itk::ByteSwapper< T >::SwapWrite4Range void *  p,
unsigned long  num,
OStreamType fp
[static, protected]
 

Swap and write a range of four-byte words. Num is the number of four-byte words to swap and write.

template<class T>
void itk::ByteSwapper< T >::SwapWrite8Range void *  p,
unsigned long  num,
OStreamType fp
[static, protected]
 

Swap and write a range of 8-byte words. Num is the number of four-byte words to swap and write.

template<class T>
void itk::ByteSwapper< T >::SwapWriteRangeFromSystemToBigEndian T *  p,
int  num,
OStreamType fp
[static]
 

Generic swap method handles type T. The data is swapped and written (in binary) to the ostream given. A total of num values of type T are written and swapped. Either 2-byte or 4-byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Big Endian.

template<class T>
void itk::ByteSwapper< T >::SwapWriteRangeFromSystemToLittleEndian T *  p,
int  num,
OStreamType fp
[static]
 

Generic swap method handles type T. The data is swapped and written (in binary) to the ostream given. A total of num values of type T are written and swapped. Either 2-byte or 4-byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Little Endian.

template<class T>
bool itk::ByteSwapper< T >::SystemIsBE  )  [inline, static]
 

Query the machine Endian-ness. Definition at line 58 of file itkByteSwapper.h.

template<class T>
bool itk::ByteSwapper< T >::SystemIsBigEndian  )  [static]
 

Query the machine Endian-ness.

template<class T>
bool itk::ByteSwapper< T >::SystemIsLE  )  [inline, static]
 

Query the machine Endian-ness. Definition at line 60 of file itkByteSwapper.h.

template<class T>
bool itk::ByteSwapper< T >::SystemIsLittleEndian  )  [static]
 

Query the machine Endian-ness.


The documentation for this class was generated from the following file:
Generated at Sat Mar 31 02:51:31 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000