ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkByteSwapper.h>
Public Types | |
typedef SizeValueType | BufferSizeType |
typedef SmartPointer< const Self > | ConstPointer |
typedef std::ostream | OStreamType |
typedef SmartPointer< Self > | Pointer |
typedef ByteSwapper | Self |
typedef Object | Superclass |
Public Member Functions | |
virtual const char * | GetNameOfClass () const |
Static Public Member Functions | |
static void | SwapFromSystemToBigEndian (T *p) |
static void | SwapFromSystemToLittleEndian (T *p) |
static void | SwapRangeFromSystemToBigEndian (T *p, BufferSizeType num) |
static void | SwapRangeFromSystemToLittleEndian (T *p, BufferSizeType num) |
static bool | SystemIsBE () |
static bool | SystemIsBigEndian () |
static bool | SystemIsLE () |
static bool | SystemIsLittleEndian () |
static void | SwapWriteRangeFromSystemToBigEndian (T *p, int num, OStreamType *fp) |
static void | SwapWriteRangeFromSystemToLittleEndian (T *p, int num, OStreamType *fp) |
Protected Member Functions | |
ByteSwapper () | |
~ByteSwapper () | |
Static Protected Member Functions | |
static void | Swap2 (void *p) |
static void | Swap2Range (void *p, BufferSizeType num) |
static void | Swap4 (void *p) |
static void | Swap4Range (void *p, BufferSizeType num) |
static void | Swap8 (void *p) |
static void | Swap8Range (void *p, BufferSizeType num) |
static void | SwapWrite2Range (void *p, BufferSizeType num, OStreamType *fp) |
static void | SwapWrite4Range (void *p, BufferSizeType num, OStreamType *fp) |
static void | SwapWrite8Range (void *p, BufferSizeType num, OStreamType *fp) |
Private Member Functions | |
ByteSwapper (const ByteSwapper &) | |
void | operator= (const ByteSwapper &) |
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 50 of file itkByteSwapper.h.
typedef SizeValueType itk::ByteSwapper< T >::BufferSizeType |
Type for representing large buffers, including those in 64bits architectures
Definition at line 82 of file itkByteSwapper.h.
typedef SmartPointer< const Self > itk::ByteSwapper< T >::ConstPointer |
Reimplemented from itk::Object.
Definition at line 57 of file itkByteSwapper.h.
typedef std::ostream itk::ByteSwapper< T >::OStreamType |
Work around MSVC bug (including ByteSwapper.h in a templated class).
Definition at line 60 of file itkByteSwapper.h.
typedef SmartPointer< Self > itk::ByteSwapper< T >::Pointer |
Reimplemented from itk::Object.
Definition at line 56 of file itkByteSwapper.h.
typedef ByteSwapper itk::ByteSwapper< T >::Self |
Standard class typedefs.
Reimplemented from itk::Object.
Definition at line 54 of file itkByteSwapper.h.
typedef Object itk::ByteSwapper< T >::Superclass |
Reimplemented from itk::Object.
Definition at line 55 of file itkByteSwapper.h.
itk::ByteSwapper< T >::ByteSwapper | ( | ) | [inline, protected] |
Definition at line 128 of file itkByteSwapper.h.
itk::ByteSwapper< T >::~ByteSwapper | ( | ) | [inline, protected] |
Definition at line 129 of file itkByteSwapper.h.
itk::ByteSwapper< T >::ByteSwapper | ( | const ByteSwapper< T > & | ) | [private] |
virtual const char* itk::ByteSwapper< T >::GetNameOfClass | ( | ) | const [virtual] |
Run-time type information (and related methods).
Reimplemented from itk::Object.
void itk::ByteSwapper< T >::operator= | ( | const ByteSwapper< T > & | ) | [private] |
static void itk::ByteSwapper< T >::Swap2 | ( | void * | p | ) | [static, protected] |
Swap 2 bytes.
static void itk::ByteSwapper< T >::Swap2Range | ( | void * | p, |
BufferSizeType | num | ||
) | [static, protected] |
Swap a range of two-byte words. Num is the number of two-byte words to swap.
static void itk::ByteSwapper< T >::Swap4 | ( | void * | p | ) | [static, protected] |
Swap four bytes.
static void itk::ByteSwapper< T >::Swap4Range | ( | void * | p, |
BufferSizeType | num | ||
) | [static, protected] |
Swap a range of four-byte words. Num is the number of four-byte words to swap.
static void itk::ByteSwapper< T >::Swap8 | ( | void * | p | ) | [static, protected] |
Swap 8 bytes.
static void itk::ByteSwapper< T >::Swap8Range | ( | void * | p, |
BufferSizeType | num | ||
) | [static, protected] |
Swap a range of 8-byte words. Num is the number of four-byte words to swap.
static void itk::ByteSwapper< T >::SwapFromSystemToBigEndian | ( | T * | p | ) | [static] |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 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.
static void itk::ByteSwapper< T >::SwapFromSystemToLittleEndian | ( | T * | p | ) | [static] |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 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.
static void itk::ByteSwapper< T >::SwapRangeFromSystemToBigEndian | ( | T * | p, |
BufferSizeType | num | ||
) | [static] |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 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.
static void itk::ByteSwapper< T >::SwapRangeFromSystemToLittleEndian | ( | T * | p, |
BufferSizeType | num | ||
) | [static] |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 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.
static void itk::ByteSwapper< T >::SwapWrite2Range | ( | void * | p, |
BufferSizeType | 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.
static void itk::ByteSwapper< T >::SwapWrite4Range | ( | void * | p, |
BufferSizeType | 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.
static void itk::ByteSwapper< T >::SwapWrite8Range | ( | void * | p, |
BufferSizeType | 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.
static 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. 2, 4 and 8 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.
static 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. 2, 4 and 8 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.
static bool itk::ByteSwapper< T >::SystemIsBE | ( | ) | [inline, static] |
Definition at line 68 of file itkByteSwapper.h.
static bool itk::ByteSwapper< T >::SystemIsBigEndian | ( | ) | [static] |
Query the machine Endian-ness.
static bool itk::ByteSwapper< T >::SystemIsLE | ( | ) | [inline, static] |
Definition at line 71 of file itkByteSwapper.h.
static bool itk::ByteSwapper< T >::SystemIsLittleEndian | ( | ) | [static] |