|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
POD-compatible fixed-size bitflag storage (jh::pod::bitflags<N>).
More...
#include <cstdint>#include <type_traits>#include "jh/pods/array.h"#include "jh/macros/platform.h"#include <bit>Go to the source code of this file.
Classes | |
| struct | jh::pod::bitflags< N > |
| POD-compatible fixed-size bitflags structure.Generic fallback specialization for non-native sizes (e.g. 24, 120 bits, etc). More... | |
| struct | jh::pod::bitflags< 8 > |
| Specialization for 8-bit bitflags. More... | |
| struct | jh::pod::bitflags< 16 > |
| Specialization for 16-bit bitflags. More... | |
| struct | jh::pod::bitflags< 32 > |
| Specialization for 32-bit bitflags. More... | |
| struct | jh::pod::bitflags< 64 > |
| Specialization for 64-bit bitflags. More... | |
Namespaces | |
| namespace | jh::pod |
| Aggregated entry point for Plain-Old-Data and layout-stable value utilities. | |
Concepts | |
| concept | jh::pod::std_uint |
| Internal constraint for native unsigned integer types. | |
Functions | |
| template<std_uint UInt> | |
| constexpr auto | jh::pod::uint_to_bytes (const UInt val) |
| Convert an unsigned integer into a little-endian byte array. | |
| template<std::uint16_t N> | |
| constexpr auto | jh::pod::bytes_to_uint (const array< std::uint8_t, N > &arr) |
| Convert a little-endian byte array into an unsigned integer. | |
| template<std::uint16_t N> | |
| constexpr bitflags< N > | jh::pod::operator| (const bitflags< N > &lhs, const bitflags< N > &rhs) noexcept |
| template<std::uint16_t N> | |
| constexpr bitflags< N > | jh::pod::operator& (const bitflags< N > &lhs, const bitflags< N > &rhs) noexcept |
| template<std::uint16_t N> | |
| constexpr bitflags< N > | jh::pod::operator^ (const bitflags< N > &lhs, const bitflags< N > &rhs) noexcept |
| template<std::uint16_t N> | |
| constexpr bitflags< N > | jh::pod::operator~ (const bitflags< N > &v) noexcept |
| template<std::uint16_t N> | |
| constexpr array< std::uint8_t, N/8 > | jh::pod::to_bytes (bitflags< N > f) |
Serialize a bitflags<N> into a little-endian byte array (snapshot). | |
| template<std::uint16_t N> | |
| constexpr bitflags< N > | jh::pod::from_bytes (array< std::uint8_t, N/8 > arr) |
Deserialize a bitflags<N> from a byte array (snapshot). | |
POD-compatible fixed-size bitflag storage (jh::pod::bitflags<N>).
N/8 bytes of storage (or one native integer) memcpy, file mapping, and raw buffers std::bitset, this type: