MrSID Decode SDK for LiDAR Reference Manual 1.1.4.4709

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Endian Class Reference

Endian is a helper class that figures out the host's byte order. More...

`#include <Endian.h>`

## Public Member Functions
| Endian (void)
bool | isHostBigEndian (void) const
| Determine if the host is big endian. More...
bool | isHostLittleEndian (void) const
| Determine if the host is little endian. More...

## Static Public Member Functions
template<size_t size>
static void | swap (void *buffer)
| Swap byte order. More...
static void | swap (void *buffer, size_t size)
| Swap byte order. More...

## Protected Attributes
union {
int word
char byte [sizeof(int)]
}; |

## Detailed Description

The Endian class is used to figure out if the host is big or little endian and swap between byte orders.

Definition at line 30 of file Endian.h.

## Constructor & Destructor Documentation

Endian::Endian | ( | void | ) |  |
| inline

Definition at line 33 of file Endian.h.

## Member Function Documentation

bool Endian::isHostBigEndian | ( | void | ) |  | const
| inline

This method returns true when the host is big endian. The compiler should be able the optimize this function call away.

Definition at line 41 of file Endian.h.

References byte.

bool Endian::isHostLittleEndian | ( | void | ) |  | const
| inline

This method returns true when the host is little endian. The compiler should be able the optimize this function call away.

Definition at line 48 of file Endian.h.

References byte.

template<size_t size>

static void Endian::swap | ( | void * | buffer) |  |
| inline static

This method swaps the byte order of the buffer.

Parameters

  size | the length of the buffer (in most cases it is a power of 2)
  buffer | the data to be swapped

Definition at line 59 of file Endian.h.

static void Endian::swap | ( | void * | buffer,
|  | size_t | size
| ) |  |
| inline static

This method swaps the byte order of the buffer.

Parameters

  buffer | the data to be swapped
  size | the length of the buffer (in most cases it is a power of 2)

Definition at line 79 of file Endian.h.

## Member Data Documentation

union { ... }

char Endian::byte[sizeof(int)]

Definition at line 92 of file Endian.h.

Referenced by isHostBigEndian(), and isHostLittleEndian().

int Endian::word

Definition at line 92 of file Endian.h.

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

- Endian.h

LizardTech