MrSID Decode SDK for LiDAR Reference Manual 1.1.5.5244
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 26 of file Endian.h.

Constructor & Destructor Documentation

◆ Endian()

Endian::Endian ( void  )
inline

Definition at line 29 of file Endian.h.

Member Function Documentation

◆ isHostBigEndian()

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 37 of file Endian.h.

◆ isHostLittleEndian()

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 44 of file Endian.h.

◆ swap() [1/2]

template<size_t size>
static void Endian::swap ( void *  buffer)
inlinestatic

This method swaps the byte order of the buffer.

Parameters
sizethe length of the buffer (in most cases it is a power of 2)
bufferthe data to be swapped

Definition at line 55 of file Endian.h.

◆ swap() [2/2]

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

This method swaps the byte order of the buffer.

Parameters
bufferthe data to be swapped
sizethe length of the buffer (in most cases it is a power of 2)

Definition at line 75 of file Endian.h.

Member Data Documentation

◆ 

const union { ... } Endian::@1

◆ byte

char Endian::byte[sizeof(int)]

Definition at line 88 of file Endian.h.

◆ word

int Endian::word

Definition at line 88 of file Endian.h.


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

Extensis