FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Pack Namespace Reference

Data Array Pack namespace. More...

Classes

struct  SwapHelper
 auxiliary helper class: swaps the bytes of an 8/16/32/64/128 byte type More...
 
struct  SwapHelper< 1 >
 
struct  SwapHelper< 16 >
 
struct  SwapHelper< 2 >
 
struct  SwapHelper< 4 >
 
struct  SwapHelper< 8 >
 
struct  TypeHelper
 
struct  TypeHelper< FEAT::Type::FloatingClass, true >
 
struct  TypeHelper< FEAT::Type::IntegralClass, false >
 
struct  TypeHelper< FEAT::Type::IntegralClass, true >
 

Typedefs

using f16 = Half
 16-bit floating point type More...
 
using f32 = float
 32-bit floating point type More...
 
using f64 = double
 64-bit floating point type More...
 
using i16 = std::int16_t
 16-bit signed integer type More...
 
using i32 = std::int32_t
 32-bit signed integer type More...
 
using i64 = std::int64_t
 64-bit signed integer type More...
 
using i8 = std::int8_t
 8-bit signed integer type More...
 
using u16 = std::uint16_t
 16-bit unsigned integer type More...
 
using u32 = std::uint32_t
 32-bit unsigned integer type More...
 
using u64 = std::uint64_t
 64-bit unsigned integer type More...
 
using u8 = std::uint8_t
 8-bit unsigned integer type More...
 

Enumerations

enum class  Type : u16 {
  None = 0x0000 , Mask_T = 0x0FFF , Mask_Z = 0x8000 , Mask_P = 0x2000 ,
  Type_I = 0x0010 , Type_U = 0x0020 , Type_F = 0x0030 , I8 = 0x0011 ,
  I16 = 0x0012 , I32 = 0x0013 , I64 = 0x0014 , U8 = 0x0021 ,
  U16 = 0x0022 , U32 = 0x0023 , U64 = 0x0024 , F16 = 0x0032 ,
  F32 = 0x0033 , F64 = 0x0034 , F128 = 0x0035 , ZI8 = 0x8011 ,
  ZI16 = 0x8012 , ZI32 = 0x8013 , ZI64 = 0x8014 , ZU8 = 0x8021 ,
  ZU16 = 0x8022 , ZU32 = 0x8023 , ZU64 = 0x8024 , ZF16 = 0x8032 ,
  ZF32 = 0x8033 , ZF64 = 0x8034 , ZF128 = 0x8035 , PF32 = 0x2033 ,
  PF64 = 0x2034
}
 Type enumeration. More...
 

Functions

std::vector< Pack::u8base64_decode (const String &s)
 Decodes a Base64 string into bytes. More...
 
String base64_encode (const Pack::u8 *begin, const Pack::u8 *end)
 Encodes bytes into a Base64 string. More...
 
template<typename T_ >
std::size_t decode (T_ *dst, void *buf, std::size_t count, std::size_t buf_size, Pack::Type pack_type, bool swap_bytes)
 Decodes an array from a packed buffer. More...
 
template std::size_t decode< f32 > (f32 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< f64 > (f64 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< i16 > (i16 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< i32 > (i32 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< i64 > (i64 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< i8 > (i8 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< long long > (long long *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< u16 > (u16 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< u32 > (u32 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< u64 > (u64 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
template std::size_t decode< u8 > (u8 *, void *, std::size_t, std::size_t, Pack::Type, bool)
 
static void decode_base64_quantum (std::array< Pack::u8, 3 > &quantum, const std::array< Pack::u8, 4 > &chars)
 Decodes a group of four Base64 characters into a group of three bytes. More...
 
template<typename T_ >
static std::size_t decode_raw (T_ *dst, const void *buf, const std::size_t count, const Pack::Type pack_type, bool swap_bytes)
 Decodes an array from a packed buffer without compression support. More...
 
template<typename T_ >
Pack::Type deduct_type ()
 Deduct the (raw) Pack::Type from a given data type T_. More...
 
template Pack::Type deduct_type< f32 > ()
 
template Pack::Type deduct_type< f64 > ()
 
template Pack::Type deduct_type< i16 > ()
 
template Pack::Type deduct_type< i32 > ()
 
template Pack::Type deduct_type< i64 > ()
 
template Pack::Type deduct_type< i8 > ()
 
template Pack::Type deduct_type< long long > ()
 
template Pack::Type deduct_type< u16 > ()
 
template Pack::Type deduct_type< u32 > ()
 
template Pack::Type deduct_type< u64 > ()
 
template Pack::Type deduct_type< u8 > ()
 
std::size_t element_size (const Pack::Type type)
 Returns the size of a Pack::Type element in bytes. More...
 
template<typename T_ >
std::size_t encode (void *buf, const T_ *src, std::size_t buf_size, std::size_t count, Pack::Type pack_type, bool swap_bytes, double tolerance=1e-16)
 Encodes an array into a packed buffer. More...
 
template std::size_t encode< f32 > (void *, const f32 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< f64 > (void *, const f64 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< i16 > (void *, const i16 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< i32 > (void *, const i32 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< i64 > (void *, const i64 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< i8 > (void *, const i8 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< long long > (void *, const long long *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< u16 > (void *, const u16 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< u32 > (void *, const u32 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< u64 > (void *, const u64 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
template std::size_t encode< u8 > (void *, const u8 *, std::size_t, std::size_t, Pack::Type, bool, double)
 
static void encode_base64_quantum (const std::array< Pack::u8, 3 > &quantum, std::array< Pack::u8, 4 > &chars)
 Encodes a group of three bytes into four Base64 characters. More...
 
template<typename T_ >
static std::size_t encode_raw (void *buf, const T_ *src, const std::size_t count, const Pack::Type pack_type, bool swap_bytes)
 Encodes an array into a packed buffer without compression support. More...
 
std::size_t estimate_size (std::size_t count, Pack::Type type, double tolerance=1e-16)
 Computes the estimated (upper bound) pack buffer size for an array. More...
 
static bool is_valid_base64_char (const char c)
 Checks if the given characters is a valid Base64 character. More...
 
bool is_valid_base64_string (const String &s)
 
template<typename T_ >
static std::size_t lossless_decode (T_ *dst, const void *buf, const std::size_t count, const std::size_t buf_size, const Pack::Type pack_type, bool swap_bytes)
 Decodes an array from a packed buffer. More...
 
template<typename T_ >
static std::size_t lossless_encode (void *buf, const T_ *src, const std::size_t buf_size, const std::size_t count, const Pack::Type pack_type, bool swap_bytes)
 Encodes an array into a packed buffer. More...
 
template<typename T_ >
static std::size_t lossy_decode (T_ *dst, void *buf, const std::size_t count, const std::size_t buf_size, const Pack::Type pack_type, bool swap_bytes)
 Decodes an array from a packed buffer with lossy saved compression data. More...
 
template<typename T_ >
static std::size_t lossy_encode (void *buf, T_ *src, const std::size_t buf_size, const std::size_t count, const Pack::Type pack_type, bool swap_bytes, const double tolerance)
 Encodes an array into a packed buffer. More...
 
static std::size_t lossy_estimate_size (const std::size_t count, const Pack::Type type, const double tolerance)
 Computes the estimated (upper bound) pack buffer size for an array for lossy compression. More...
 
Pack::Type operator& (Pack::Type a, Pack::Type b)
 bit-wise AND operator for Pack::Type More...
 
std::ostream & operator<< (std::ostream &os, Pack::Type t)
 stream output operator for Pack::Type More...
 
std::istream & operator>> (std::istream &is, Pack::Type &t)
 stream input operator for Pack::Type More...
 
Pack::Type operator| (Pack::Type a, Pack::Type b)
 bit-wise OR operator for Pack::Type More...
 
template<typename X_ , typename T_ >
static std::size_t xdecode (T_ *dest, const void *buf, const std::size_t count, bool swap_bytes)
 Encodes an array by converting each of its elements to a desired type. More...
 
template<typename X_ , typename T_ >
static std::size_t xencode (void *buf, const T_ *src, const std::size_t count, bool swap_bytes)
 bitmask for zfp header More...
 
template<typename X_ >
X_ xswap (X_ x)
 Swaps the bytes of an object. More...
 

Variables

static constexpr std::string_view base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 
static constexpr char base64_padding = '='
 

Detailed Description

Data Array Pack namespace.

This namespace encapsulates various functions than provide means of packing and unpacking data arrays as well as compression and decompression of buffers using the third-party library zlib or lossy compression and decompression of buffers using the third-party library zfp.

Typedef Documentation

◆ f16

using FEAT::Pack::f16 = typedef Half

16-bit floating point type

Definition at line 47 of file pack.hpp.

◆ f32

using FEAT::Pack::f32 = typedef float

32-bit floating point type

Definition at line 54 of file pack.hpp.

◆ f64

using FEAT::Pack::f64 = typedef double

64-bit floating point type

Definition at line 56 of file pack.hpp.

◆ i16

using FEAT::Pack::i16 = typedef std::int16_t

16-bit signed integer type

Definition at line 29 of file pack.hpp.

◆ i32

using FEAT::Pack::i32 = typedef std::int32_t

32-bit signed integer type

Definition at line 31 of file pack.hpp.

◆ i64

using FEAT::Pack::i64 = typedef std::int64_t

64-bit signed integer type

Definition at line 33 of file pack.hpp.

◆ i8

using FEAT::Pack::i8 = typedef std::int8_t

8-bit signed integer type

Definition at line 27 of file pack.hpp.

◆ u16

using FEAT::Pack::u16 = typedef std::uint16_t

16-bit unsigned integer type

Definition at line 38 of file pack.hpp.

◆ u32

using FEAT::Pack::u32 = typedef std::uint32_t

32-bit unsigned integer type

Definition at line 40 of file pack.hpp.

◆ u64

using FEAT::Pack::u64 = typedef std::uint64_t

64-bit unsigned integer type

Definition at line 42 of file pack.hpp.

◆ u8

using FEAT::Pack::u8 = typedef std::uint8_t

8-bit unsigned integer type

Definition at line 36 of file pack.hpp.

Enumeration Type Documentation

◆ Type

enum class FEAT::Pack::Type : u16
strong

Type enumeration.

Definition at line 69 of file pack.hpp.

Function Documentation

◆ base64_decode()

std::vector< Pack::u8 > FEAT::Pack::base64_decode ( const String s)

Decodes a Base64 string into bytes.

Parameters
[in]sString to decode
Returns
A vector containing the bytes encoded by s

See RFC 4648 for details

Parameters
[in]sString to decode
Returns
A vector containing the bytes encoded by s

See RFC 4648 for details

Definition at line 1204 of file pack.cpp.

References decode_base64_quantum(), and is_valid_base64_char().

◆ base64_encode()

String FEAT::Pack::base64_encode ( const Pack::u8 begin,
const Pack::u8 end 
)

Encodes bytes into a Base64 string.

Template Parameters
ByteIterIterator of Pack::u8s. Must support operator* and operator++(int)
Parameters
[in]beginStart of bytes
[in]endEnd of bytes
Returns
A string containing the given bytes as a Base64 string

See RFC 4648 for details

Parameters
[in]beginStart of bytes
[in]endEnd of bytes
Returns
A string containing the given bytes as a Base64 string

See RFC 4648 for details

Definition at line 1115 of file pack.cpp.

References encode_base64_quantum().

Referenced by FEAT::Geometry::ExportVTK< Mesh_, cell_dim_ >::_write_data_array().

◆ decode()

template<typename T_ >
std::size_t FEAT::Pack::decode ( T_ *  dst,
void *  buf,
std::size_t  count,
std::size_t  buf_size,
Pack::Type  pack_type,
bool  swap_bytes 
)

Decodes an array from a packed buffer.

Instantiated for i{8,16,32,64}, u{8,16,32,64}, f{16,32,64,128}.

Parameters
[out]dstA pointer to the output array that is to be unpacked. Must not be nullptr.
[in]bufA pointer to the input buffer. Must not be nullptr.
[in]countThe number of output array elements.
[in]buf_sizeThe size of the input buffer buf in bytes.
[in]pack_typeThe input buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
Returns
The total number of bytes consumed from the input buffer.

Definition at line 694 of file pack.cpp.

References decode_raw(), lossless_decode(), lossy_decode(), and XASSERT.

Referenced by FEAT::LAFEM::Container< DT_, IT_ >::_deserialize().

◆ decode_base64_quantum()

static void FEAT::Pack::decode_base64_quantum ( std::array< Pack::u8, 3 > &  quantum,
const std::array< Pack::u8, 4 > &  chars 
)
static

Decodes a group of four Base64 characters into a group of three bytes.

Definition at line 1072 of file pack.cpp.

Referenced by base64_decode().

◆ decode_raw()

template<typename T_ >
static std::size_t FEAT::Pack::decode_raw ( T_ *  dst,
const void *  buf,
const std::size_t  count,
const Pack::Type  pack_type,
bool  swap_bytes 
)
static

Decodes an array from a packed buffer without compression support.

Attention
This function does not decode compressed pack types.
Parameters
[out]dstA pointer to the output array that is to be unpacked. Must not be nullptr.
[in]bufA pointer to the input buffer. Must not be nullptr.
[in]countThe number of output array elements.
[in]pack_typeThe input buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
Returns
The total number of bytes consumed from the input buffer.

Definition at line 457 of file pack.cpp.

References XASSERT, and XASSERTM.

Referenced by decode(), lossless_decode(), and lossy_decode().

◆ deduct_type()

template<typename T_ >
Pack::Type FEAT::Pack::deduct_type ( )

Deduct the (raw) Pack::Type from a given data type T_.

Instantiated for i{8,16,32,64}, u{8,16,32,64}, f{16,32,64,128}.

Template Parameters
T_The type whose Pack::Type value is to be determined.
Returns
The (raw) Pack::Type value for the given type T_ or Pack::Type::None, if T_ does not represent a type from the Pack::Type enum.

Definition at line 376 of file pack.cpp.

◆ element_size()

std::size_t FEAT::Pack::element_size ( const Pack::Type  type)
inline

Returns the size of a Pack::Type element in bytes.

Parameters
[in]typeThe type whose element size is to be determined
Returns
The size of the type in bytes or 0, if type is not a valid data type

Definition at line 256 of file pack.hpp.

Referenced by estimate_size(), lossless_decode(), lossless_encode(), lossy_decode(), and lossy_encode().

◆ encode()

template<typename T_ >
std::size_t FEAT::Pack::encode ( void *  buf,
const T_ *  src,
std::size_t  buf_size,
std::size_t  count,
Pack::Type  pack_type,
bool  swap_bytes,
double  tolerance = 1e-16 
)

Encodes an array into a packed buffer.

Instantiated for i{8,16,32,64}, u{8,16,32,64}, f{16,32,64,128}.

Parameters
[out]bufA pointer to the output buffer. Must not be nullptr.
[in]srcA pointer to the input array that is to be packed. Must not be nullptr.
[in]buf_sizeThe size of the output buffer buf in bytes. Must be at least as big as the estimated buffer size.
[in]countThe number of input array elements.
[in]pack_typeThe desired output buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
[in]toleranceOptional paramter: The desired maximum error for lossy compression.
Returns
The total number of bytes written into the output buffer.

Definition at line 580 of file pack.cpp.

References encode_raw(), lossless_encode(), lossy_encode(), and XASSERT.

Referenced by FEAT::Geometry::ExportVTK< Mesh_, cell_dim_ >::_write_data_array().

◆ encode_base64_quantum()

static void FEAT::Pack::encode_base64_quantum ( const std::array< Pack::u8, 3 > &  quantum,
std::array< Pack::u8, 4 > &  chars 
)
static

Encodes a group of three bytes into four Base64 characters.

Definition at line 1050 of file pack.cpp.

Referenced by base64_encode().

◆ encode_raw()

template<typename T_ >
static std::size_t FEAT::Pack::encode_raw ( void *  buf,
const T_ *  src,
const std::size_t  count,
const Pack::Type  pack_type,
bool  swap_bytes 
)
static

Encodes an array into a packed buffer without compression support.

Attention
This function does not encode compressed pack types.
Parameters
[out]bufA pointer to the output buffer. Must not be nullptr.
[in]srcA pointer to the input array that is to be packed. Must not be nullptr.
[in]countThe number of input array elements.
[in]pack_typeThe desired output buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
Returns
The total number of bytes written into the output buffer.

Definition at line 408 of file pack.cpp.

References XASSERT, and XASSERTM.

Referenced by encode(), lossless_encode(), and lossy_encode().

◆ estimate_size()

std::size_t FEAT::Pack::estimate_size ( std::size_t  count,
Pack::Type  type,
double  tolerance = 1e-16 
)

Computes the estimated (upper bound) pack buffer size for an array.

Parameters
[in]countThe number of array elements to be packed.
[in]typeThe packed type of the array elements.
Returns
An estimated (upper bound) array buffer size.

Definition at line 557 of file pack.cpp.

References element_size(), lossy_estimate_size(), and XASSERTM.

Referenced by FEAT::LAFEM::Container< DT_, IT_ >::_serialize(), FEAT::LAFEM::Container< DT_, IT_ >::_serialized_size(), and FEAT::Geometry::ExportVTK< Mesh_, cell_dim_ >::_write_data_array().

◆ is_valid_base64_char()

static bool FEAT::Pack::is_valid_base64_char ( const char  c)
static

Checks if the given characters is a valid Base64 character.

Definition at line 1044 of file pack.cpp.

Referenced by base64_decode().

◆ is_valid_base64_string()

bool FEAT::Pack::is_valid_base64_string ( const String s)

\briefs Checks whether a string is valid Base64 data

Parameters
[in]sString to check
Returns
True, if s contains valid Base64 data

Definition at line 1098 of file pack.cpp.

◆ lossless_decode()

template<typename T_ >
static std::size_t FEAT::Pack::lossless_decode ( T_ *  dst,
const void *  buf,
const std::size_t  count,
const std::size_t  buf_size,
const Pack::Type  pack_type,
bool  swap_bytes 
)
static

Decodes an array from a packed buffer.

Parameters
[out]dstA pointer to the output array that is to be unpacked. Must not be nullptr.
[in]bufA pointer to the input buffer. Must not be nullptr.
[in]countThe number of output array elements.
[in]buf_sizeThe size of the input buffer buf in bytes.
[in]pack_typeThe input buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
Returns
The total number of bytes consumed from the input buffer.

Definition at line 759 of file pack.cpp.

References decode_raw(), element_size(), and XABORTM.

Referenced by decode().

◆ lossless_encode()

template<typename T_ >
static std::size_t FEAT::Pack::lossless_encode ( void *  buf,
const T_ *  src,
const std::size_t  buf_size,
const std::size_t  count,
const Pack::Type  pack_type,
bool  swap_bytes 
)
static

Encodes an array into a packed buffer.

Parameters
[out]bufA pointer to the output buffer. Must not be nullptr.
[in]srcA pointer to the input array that is to be packed. Must not be nullptr.
[in]buf_sizeThe size of the output buffer buf in bytes. Must be at least as big as the estimated buffer size.
[in]countThe number of input array elements.
[in]pack_typeThe desired output buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
Returns
The total number of bytes written into the output buffer.

Definition at line 647 of file pack.cpp.

References element_size(), encode_raw(), and XABORTM.

Referenced by encode().

◆ lossy_decode()

template<typename T_ >
static std::size_t FEAT::Pack::lossy_decode ( T_ *  dst,
void *  buf,
const std::size_t  count,
const std::size_t  buf_size,
const Pack::Type  pack_type,
bool  swap_bytes 
)
static

Decodes an array from a packed buffer with lossy saved compression data.

Parameters
[out]dstA pointer to the output array that is to be unpacked. Must not be nullptr.
[in]bufA pointer to the input buffer. Must not be nullptr.
[in]countThe number of output array elements.
[in]buf_sizeThe size of the input buffer buf in bytes.
[in]pack_typeThe input buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
Returns
The total number of bytes consumed from the input buffer.

Definition at line 951 of file pack.cpp.

References decode_raw(), element_size(), FEAT::stringify(), XABORTM, XASSERT, and XASSERTM.

Referenced by decode().

◆ lossy_encode()

template<typename T_ >
static std::size_t FEAT::Pack::lossy_encode ( void *  buf,
T_ *  src,
const std::size_t  buf_size,
const std::size_t  count,
const Pack::Type  pack_type,
bool  swap_bytes,
const double  tolerance 
)
static

Encodes an array into a packed buffer.

Parameters
[out]bufA pointer to the output buffer. Must not be nullptr.
[in]srcA pointer to the input array that is to be packed. Must not be nullptr.
[in]buf_sizeThe size of the output buffer buf in bytes. Must be at least as big as the estimated buffer size.
[in]countThe number of input array elements.
[in]pack_typeThe desired output buffer pack type.
[in]swap_bytesSpecifies whether to swap the pack type bytes.
[in]toleranceThe desired maximum error of compressed data.
Warning
Tolerance can be exceeded in fringe cases. If data set is highly uncontinuous, error testing is recommended.
Returns
The total number of bytes written into the output buffer.

Definition at line 839 of file pack.cpp.

References element_size(), encode_raw(), XABORTM, and XASSERT.

Referenced by encode().

◆ lossy_estimate_size()

static std::size_t FEAT::Pack::lossy_estimate_size ( const std::size_t  count,
const Pack::Type  type,
const double  tolerance 
)
static

Computes the estimated (upper bound) pack buffer size for an array for lossy compression.

Warning
Lossless estimation and lossy estimation of buffer size are different!
Parameters
[in]srcA pointer to the input array that is to be packed. Must not be nullptr.
[in]countThe number of input array elements.
[in]toleranceThe desired maximum error of compressed data.
Returns
An estimated (upper bound) array buffer size.

Definition at line 500 of file pack.cpp.

References XABORTM, and XASSERT.

Referenced by estimate_size().

◆ operator&()

Pack::Type FEAT::Pack::operator& ( Pack::Type  a,
Pack::Type  b 
)
inline

bit-wise AND operator for Pack::Type

Definition at line 129 of file pack.hpp.

◆ operator<<()

std::ostream & FEAT::Pack::operator<< ( std::ostream &  os,
Pack::Type  t 
)
inline

stream output operator for Pack::Type

Definition at line 141 of file pack.hpp.

◆ operator>>()

std::istream & FEAT::Pack::operator>> ( std::istream &  is,
Pack::Type t 
)
inline

stream input operator for Pack::Type

Definition at line 178 of file pack.hpp.

References FEAT::String::compare_no_case().

◆ operator|()

Pack::Type FEAT::Pack::operator| ( Pack::Type  a,
Pack::Type  b 
)
inline

bit-wise OR operator for Pack::Type

Definition at line 135 of file pack.hpp.

◆ xdecode()

template<typename X_ , typename T_ >
static std::size_t FEAT::Pack::xdecode ( T_ *  dest,
const void *  buf,
const std::size_t  count,
bool  swap_bytes 
)
static

Encodes an array by converting each of its elements to a desired type.

Effectively, this function performs dest[i] = T_(((X_*)buf)[i]) for all i < count.

Template Parameters
X_The type of the encoded source array buffer buf whose elements are to be converted
T_The type of the destination array dest
Parameters
[out]destThe destination array that receives the converted array elements
[in]bufThe source buffer whose elements of type X_ are to be converted. This buffer is assumed to be at least sizeof(X_)*count bytes in size.
[in]countThe number of elements in the destination array dest.
[in]swap_bytesSpecifies whether the bytes in the source buffer buf are to be swapped before conversion.
Returns
The number bytes read from the source buffer, i.e. sizeof(X_)*count.

Definition at line 198 of file pack.cpp.

References xswap().

◆ xencode()

template<typename X_ , typename T_ >
static std::size_t FEAT::Pack::xencode ( void *  buf,
const T_ *  src,
const std::size_t  count,
bool  swap_bytes 
)
static

bitmask for zfp header

//0x1u HEADER_MAGIC -> for version control--> only checks codec... in last 8 bits of first 32 bits... //0x2u HEADER_META //0x4u HEADER_MODE

Encodes an array by converting each of its elements to a desired type

Effectively, this function performs ((X_*)buf)[i] = X_(src[i]) for all i < count.

Template Parameters
X_The desired type of the encoded destination array buffer buf
T_The type of the source array src whose elements are to be converted.
Parameters
[out]bufThe destination buffer that receives the array elements of type X_. This buffer is assumed to be at least sizeof(X_)*count bytes in size.
[in]srcThe source array whose elements of type T_ are to be converted
[in]countThe number of elements in the source array src.
[in]swap_bytesSpecifies whether the bytes in the destination buffer buf are to be swapped after conversion.
Returns
The number bytes written to the destination buffer, i.e. sizeof(X_)*count.

Definition at line 147 of file pack.cpp.

References xswap().

◆ xswap()

template<typename X_ >
X_ FEAT::Pack::xswap ( X_  x)
inline

Swaps the bytes of an object.

Definition at line 98 of file pack.cpp.

Referenced by xdecode(), and xencode().

Variable Documentation

◆ base64_alphabet

constexpr std::string_view FEAT::Pack::base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
staticconstexpr

Definition at line 1040 of file pack.cpp.

◆ base64_padding

constexpr char FEAT::Pack::base64_padding = '='
staticconstexpr

Definition at line 1041 of file pack.cpp.