Dev Essential  1.6.3
Loading...
Searching...
No Matches
bitserializer.h File Reference
#include <a_util/memory.h>
#include <a_util/result.h>
#include <algorithm>
Include dependency graph for bitserializer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  a_util::memory::detail::ConverterBase< T >
 
class  a_util::memory::detail::Converter< T, 0, 0 >
 Partially specialized class for Unsigned Integers. More...
 
class  a_util::memory::detail::Converter< T, 1, 0 >
 Partially specialized class for Signed Integers. More...
 
class  a_util::memory::detail::Converter< T, 1, 1 >
 Specialized class for Floats (Floats are always signed!) More...
 
class  a_util::memory::BitSerializer
 Bit Serializer Class. More...
 

Namespaces

namespace  a_util
 Serves as the root component, with common functionality documented in core functionality.
 
namespace  a_util::memory
 Serves as component for memory access and management.
 

Enumerations

enum  a_util::memory::Endianess { bit_little_endian = 1 , bit_big_endian = 2 }
 Enum describing the endianess.
 

Functions

Endianess a_util::memory::get_platform_endianess ()
 
std::string a_util::memory::detail::formatBits (uint64_t value)
 
a_util::result::Result a_util::memory::detail::convertSignalEndianess (uint64_t *signal, Endianess endianess, size_t bit_length)
 

Detailed Description

Raw memory related functionality

Function Documentation

◆ convertSignalEndianess()

a_util::result::Result a_util::memory::detail::convertSignalEndianess ( uint64_t * signal,
Endianess endianess,
size_t bit_length )

Convert the endianess of a signal by correctly swapping the byte order if required. The variable signal is a uint64_t, but the value that needs conversion might be smaller. The parameter bit_length determines if a 16, 32 or 64 value should be swapped. For a LE system, reading BE signals of 3, 5, 6 or 7 bytes length the value will be aligned within a 4 or 8 byte value before swapping bytes.

Parameters
[in,out]signalPointer to the variable to store the read value in.
[in]endianessParameter describing the endianess of the bitfield to convert.
[in]bit_lengthNumber of bits to read.
Returns
Returns a standard result code.

◆ formatBits()

std::string a_util::memory::detail::formatBits ( uint64_t value)

Format the bit pattern of a uint64_t value to a string Used for debug purposes.

Parameters
[in]valueThe value to print.
Return values
Thebitstring