Utilities¶
This page documents some of the utilities found in oead/util/.
Warning
Anything that is not explicitly documented on this page should be considered an implementation detail that is not to be relied upon.
Swap utils¶
#include <oead/util/swap.h>
-
template<typename
T, EndiannessEndian>
structEndianInt¶ A wrapper that stores an integer in the specified endianness and automatically bytes swap when reading/writing the value.
-
using
oead::util::BeInt= EndianInt<T, Endianness::Big>¶
-
using
oead::util::LeInt= EndianInt<T, Endianness::Little>¶
For the Python API:
Variant utils¶
#include <oead/util/variant_utils.h>
-
template<typename
EnumType, typename ...Types>
structVariant¶ A std::variant wrapper that transparently dereferences unique_ptrs. This is intended for be used for variants that can contain possibly large values.
Public Types
-
template<>
usingStorage= std::variant<Types...>¶
Public Functions
-
Variant()¶
-
template<typename
T, std::enable_if_t<IsAnyOfType<std::decay_t<T>, Types...>() || IsAnyOfType<std::unique_ptr<std::decay_t<T>>, Types...>()> * = nullptr>Variant(const T &value)¶
-
template<typename
T, std::enable_if_t<IsAnyOfType<std::decay_t<T>, Types...>() || IsAnyOfType<std::unique_ptr<std::decay_t<T>>, Types...>()> * = nullptr>Variant(T &&value)¶
-
Variant &
operator=(const Variant &other)¶
-
Variant &
operator=(Variant &&other)¶
-
constexpr EnumType
GetType() const¶
-
template<EnumType
type>
const auto &Get() const¶
-
template<EnumType
type>
auto &Get()¶
Public Members
-
Storage
v¶
-
template<>