ldas-tools-al  2.6.6
Macros | Functions
reverse.hh File Reference
#include <assert.h>
#include <byteswap.h>
#include <stdint.h>
#include "ldastoolsal/types.hh"
Include dependency graph for reverse.hh:

Macros

#define BSWAP_8(x)   ( (x)&0xff )
 

Functions

template<typename T >
bswap (T Source)
 
template<>
uint32_t bswap (uint32_t Source)
 
template<size_t SIZE>
void reverse (void *s, size_t n)
 Reverse Byte Order. More...
 
template<>
void reverse< 1 > (void *dest, size_t n)
 Reverse 1 byte. More...
 
template<>
void reverse< 2 > (void *dest, size_t n)
 Reverse 2 bytes. More...
 
template<>
void reverse< 4 > (void *dest, size_t n)
 Reverse 4 bytes. More...
 
template<>
void reverse< 8 > (void *dest, size_t n)
 Reverse 8 bytes. More...
 
template<>
void reverse< 12U > (void *s, size_t n)
 Reverse 12 bytes. More...
 
template<>
void reverse< 16U > (void *s, size_t n)
 Reverse 16 bytes. More...
 
template<>
void reverse< 36U > (void *s, size_t n)
 Reverse 36 bytes. More...
 

Macro Definition Documentation

◆ BSWAP_8

#define BSWAP_8 (   x)    ( (x)&0xff )

Function Documentation

◆ bswap() [1/2]

template<typename T >
T bswap ( Source)

◆ bswap() [2/2]

template<>
uint32_t bswap ( uint32_t  Source)
inline

◆ reverse()

template<size_t SIZE>
void reverse ( void *  s,
size_t  n 
)

Reverse Byte Order.

Parameters
s
n

◆ reverse< 1 >()

template<>
void reverse< 1 > ( void *  dest,
size_t  n 
)
inline

Reverse 1 byte.

This does nothing.

Parameters
dest
n

◆ reverse< 12U >()

template<>
void reverse< 12U > ( void *  s,
size_t  n 
)
inline

Reverse 12 bytes.

Reverses the order of twelve bytes. This is a template specialization.

Parameters
[in,out]sThis is the collection of data on which the bytes need to be swapped.
[in]nThe number of elements in the collection.

◆ reverse< 16U >()

template<>
void reverse< 16U > ( void *  s,
size_t  n 
)
inline

Reverse 16 bytes.

Reverses the order of sixteen bytes. This is a template specialization.

Parameters
[in,out]sThis is the collection of data on which the bytes need to be swapped.
[in]nThe number of elements in the collection.

◆ reverse< 2 >()

template<>
void reverse< 2 > ( void *  dest,
size_t  n 
)
inline

Reverse 2 bytes.

Reverses the order of two bytes. This is a template specialization.

Parameters
[in,out]destThis is the collection of data on which the bytes need to be swapped.
[in]nThe number of elements in the collection.

◆ reverse< 36U >()

template<>
void reverse< 36U > ( void *  s,
size_t  n 
)
inline

Reverse 36 bytes.

Reverses the order of thirty six bytes. This is a template specialization.

Parameters
[in,out]sThis is the collection of data on which the bytes need to be swapped.
[in]nThe number of elements in the collection.

◆ reverse< 4 >()

template<>
void reverse< 4 > ( void *  dest,
size_t  n 
)
inline

Reverse 4 bytes.

Reverses the order of four bytes. This is a template specialization.

Parameters
[in,out]destThis is the collection of data on which the bytes need to be swapped.
[in]nThe number of elements in the collection.

◆ reverse< 8 >()

template<>
void reverse< 8 > ( void *  dest,
size_t  n 
)
inline

Reverse 8 bytes.

Reverses the order of eight bytes. This is a template specialization.

Parameters
[in,out]destThis is the collection of data on which the bytes need to be swapped.
[in]nThe number of elements in the collection.