PLCnext API Documentation  22.9.0.33
Static Public Member Functions | List of all members
Arp::ByteConverter Class Reference

This pure static class provides operation sfor byte converting from little to big endian and vice versa. More...

#include <ByteConverter.hpp>

Static Public Member Functions

template<class T >
static void Swap (T &value)
 Swaps the bytes of the as argument passed value of any primitive type. More...
 
static void Swap (byte *pBuffer, size_t size)
 Swaps the bytes of the as argument buffer of the given size. More...
 
static void Swap (int8 &value)
 Swaps the bytes of the as argument passed value. More...
 
static void Swap (byte &value)
 Swaps the bytes of the as argument passed value. More...
 
static void Swap (int16 &value)
 Swaps the bytes of the as argument passed value. More...
 
static void Swap (uint16 &value)
 Swaps the bytes of the as argument passed value. More...
 
template<class T >
static void ReverseCopy (const T &source, T &target)
 Copies the reverted bytes of the source argument to the target argument. More...
 
static void ReverseCopy (const byte *pSource, byte *pTarget, size_t size)
 Copies the reverted bytes of the source argument to the target argument. More...
 

Detailed Description

This pure static class provides operation sfor byte converting from little to big endian and vice versa.

Member Function Documentation

◆ ReverseCopy() [1/2]

void Arp::ByteConverter::ReverseCopy ( const byte pSource,
byte pTarget,
size_t  size 
)
inlinestatic

Copies the reverted bytes of the source argument to the target argument.

Parameters
pSourceThe source buffer to revert and copy.
pTargetThe target buffer to copy the reverted bytes to.
sizeThe size of the source and target buffers.

◆ ReverseCopy() [2/2]

template<class T >
void Arp::ByteConverter::ReverseCopy ( const T &  source,
T &  target 
)
inlinestatic

Copies the reverted bytes of the source argument to the target argument.

Parameters
sourceThe source value to revert and copy.
targetThe target value to copy the reverted value to.

◆ Swap() [1/6]

void Arp::ByteConverter::Swap ( byte value)
inlinestatic

Swaps the bytes of the as argument passed value.

Parameters
valueThe value to swap the byets from.

This operation does nothing, but is overloaded to enable the Swap operation to be used generically.

◆ Swap() [2/6]

void Arp::ByteConverter::Swap ( byte pBuffer,
size_t  size 
)
inlinestatic

Swaps the bytes of the as argument buffer of the given size.

Parameters
pBufferThe buffer to swap the bytes from.
sizeThe size of the as argument passed buffer.

◆ Swap() [3/6]

void Arp::ByteConverter::Swap ( int16 value)
inlinestatic

Swaps the bytes of the as argument passed value.

Parameters
valueThe value to swap the byets from.

◆ Swap() [4/6]

void Arp::ByteConverter::Swap ( int8 value)
inlinestatic

Swaps the bytes of the as argument passed value.

Parameters
valueThe value to swap the byets from.

◆ Swap() [5/6]

template<class T >
void Arp::ByteConverter::Swap ( T &  value)
inlinestatic

Swaps the bytes of the as argument passed value of any primitive type.

Parameters
valueThe value to swap.
Template Parameters
TThe tppe of the as argument passed value (should be a primitive type).

◆ Swap() [6/6]

void Arp::ByteConverter::Swap ( uint16 value)
inlinestatic

Swaps the bytes of the as argument passed value.

Parameters
valueThe value to swap the byets from.

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