class EE::System::BitOp

Overview

#include <bitop.hpp>

class BitOp {
public:
    // methods

    template <typename T>
    static void writeBitKey(T* Key, unsigned int Pos, unsigned int BitWrite);

    template <typename T>
    static bool readBitKey(T* Key, Uint32 Pos);

    template <typename T>
    static void setBitFlagValue(T* Key, Uint32 Val, Uint32 BitWrite);

    static Uint16 swap16(Uint16 Key);
    static Uint32 swap32(Uint32 Key);
    static Uint64 swap64(Uint64 Key);
    static Uint32 swapBE16(Uint32 Key);
    static Uint32 swapLE16(Uint32 Key);
    static Uint32 swapBE32(Uint32 Key);
    static Uint32 swapLE32(Uint32 Key);
    static Uint32 swapBE64(Uint32 Key);
    static Uint32 swapLE64(Uint32 Key);
};

Detailed Documentation

Methods

template <typename T>
static void writeBitKey(T* Key, unsigned int Pos, unsigned int BitWrite)

Write a bit into the Key in the position defined.

Parameters:

Key

The Key to write

Pos

The Position of the bit

BitWrite

0 for write 0, any other to write 1.

template <typename T>
static bool readBitKey(T* Key, Uint32 Pos)

Read a bit from a 32 bit key, in the position defined

Parameters:

Key

The Key to read

Pos

The Position in the key to read

Returns:

True if the bit is 1

template <typename T>
static void setBitFlagValue(T* Key, Uint32 Val, Uint32 BitWrite)

Write a bit flag value

Parameters:

Key

The Key to write or remove

Val

The Value to write or remove

BitWrite

0 to remove, any value to write

static Uint16 swap16(Uint16 Key)

Swap the bytes order for a 16 bit value

static Uint32 swap32(Uint32 Key)

Swap the bytes order for a 32 bit value

static Uint64 swap64(Uint64 Key)

Swap the bytes order for a 64 bit value

static Uint32 swapBE16(Uint32 Key)

Swap little endian 16 bit value to big endian

static Uint32 swapLE16(Uint32 Key)

Swap big endian 16 bit value to little endian

static Uint32 swapBE32(Uint32 Key)

Swap little endian 32 bit value to big endian

static Uint32 swapLE32(Uint32 Key)

Swap big endian 32 bit value to little endian

static Uint32 swapBE64(Uint32 Key)

Swap little endian 64 bit value to big endian

static Uint32 swapLE64(Uint32 Key)

Swap big endian 64 bit value to little endian