DynXX-Cxx
Loading...
Searching...
No Matches
Concepts | Macros | Typedefs | Functions | Variables
Types.hxx File Reference
#include "../C/Types.h"
#include <cstdint>
#include <cstring>
#include <string_view>
#include <string>
#include <optional>
#include <span>
#include <vector>
#include <variant>
#include <unordered_map>
#include <functional>
#include <limits>
#include <type_traits>

Go to the source code of this file.

Concepts

concept  ConstT
 
concept  VoidT
 
concept  NumberT
 
concept  IntegerT
 
concept  FloatT
 
concept  EnumT
 
concept  CharacterT
 
concept  CStringT
 
concept  KeyT
 
concept  DerivedT
 
concept  PolymorphicConvertible
 
concept  MemcpyableT
 
concept  HashableT
 
concept  CompletelyComparableT
 
concept  EqualityComparableT
 
concept  IterableT
 
concept  InRangeT
 
concept  OutRangeT
 
concept  RunnableT
 

Macros

#define AssertMove(T)
 

Typedefs

using Num = std::variant< int64_t, double >
 
using Any = std::variant< int64_t, double, std::string >
 
using Dict = std::unordered_map< std::string, std::string >
 
using DictAny = std::unordered_map< std::string, Any >
 
using DictKeyT = const std::string &
 
using BytesView = std::span< const byte >
 
using Bytes = std::vector< byte >
 

Functions

template<EnumT E>
constexpr auto underlying (E e) noexcept -> std::underlying_type_t< E >
 
template<typename To , typename From >
requires PolymorphicConvertible<To, From>
TodynamicCastX (From *ptr) noexcept
 
template<HashableT T>
std::size_t getHash (const T &value)
 
template<IterableT T>
void iterate (const T &container, std::function< void(const typename T::value_type &)> &&func)
 
template<NumberT T>
constexpr T MinV ()
 
template<NumberT T>
constexpr T MaxV ()
 
int32_t str2int32 (const std::string &str, int32_t defaultI=MinInt32)
 
int64_t str2int64 (const std::string &str, int64_t defaultI=MinInt64)
 
float str2float32 (const std::string &str, float defaultF=MinFloat32)
 
double str2float64 (const std::string &str, double defaultF=MinFloat64)
 
long double str2float128 (const std::string &str, long double defaultF=MinFloat128)
 
auto Any2String (const Any &v)
 
auto Any2Integer (const Any &a, int64_t defaultI=MinInt64)
 
auto Any2Float (const Any &a, double defaultF=MinFloat64)
 
std::optional< std::stringdictAnyReadString (const DictAny &dict, DictKeyT key)
 
auto dictAnyReadString (const DictAny &dict, DictKeyT key, const std::string &defaultS)
 
std::optional< int64_tdictAnyReadInteger (const DictAny &dict, DictKeyT key)
 
auto dictAnyReadInteger (const DictAny &dict, DictKeyT key, int64_t defaultI)
 
std::optional< doubledictAnyReadFloat (const DictAny &dict, DictKeyT key)
 
auto dictAnyReadFloat (const DictAny &dict, DictKeyT key, double defaultF)
 
BytesView makeBytesView (const byte *data, size_t len)
 
Bytes makeBytes (const byte *data, size_t len)
 
template<CharacterT T>
std::string makeStr (const T *ptr, size_t len=0)
 
std::optional< const char * > nullTerminatedCStr (std::string_view str)
 

Variables

constexpr auto MinInt32 = MinV<int32_t>()
 
constexpr auto MaxInt32 = MaxV<int32_t>()
 
constexpr auto MinInt64 = MinV<int64_t>()
 
constexpr auto MaxInt64 = MaxV<int64_t>()
 
constexpr auto MinFloat32 = MinV<float>()
 
constexpr auto MaxFloat32 = MaxV<float>()
 
constexpr auto MinFloat64 = MinV<double>()
 
constexpr auto MaxFloat64 = MaxV<double>()
 
constexpr auto MinFloat128 = MinV<long double>()
 
constexpr auto MaxFloat128 = MaxV<long double>()
 

Macro Definition Documentation

◆ AssertMove

#define AssertMove (   T)
Value:
static_assert(std::is_move_constructible_v<T>, #T " MUST BE MOVE CONSTRUCTIBLE!"); \
static_assert(std::is_move_assignable_v<T>, #T " MUST BE MOVE ASSIGNABLE!"); \
static_assert(std::is_nothrow_move_constructible_v<T>, #T " MUST BE NOTHROW MOVE CONSTRUCTIBLE!"); \
static_assert(std::is_nothrow_move_assignable_v<T>, #T " MUST BE NOTHROW MOVE ASSIGNABLE!")
constexpr T MinV()
Definition Types.hxx:151

Typedef Documentation

◆ Any

◆ Bytes

◆ BytesView

◆ Dict

◆ DictAny

◆ DictKeyT

◆ Num

Function Documentation

◆ Any2Float()

auto Any2Float ( const Any a,
double  defaultF = MinFloat64 
)
inline

◆ Any2Integer()

auto Any2Integer ( const Any a,
int64_t  defaultI = MinInt64 
)
inline

◆ Any2String()

auto Any2String ( const Any v)
inline

◆ dictAnyReadFloat() [1/2]

std::optional< double > dictAnyReadFloat ( const DictAny dict,
DictKeyT  key 
)
inline

◆ dictAnyReadFloat() [2/2]

auto dictAnyReadFloat ( const DictAny dict,
DictKeyT  key,
double  defaultF 
)
inline

◆ dictAnyReadInteger() [1/2]

std::optional< int64_t > dictAnyReadInteger ( const DictAny dict,
DictKeyT  key 
)
inline

◆ dictAnyReadInteger() [2/2]

auto dictAnyReadInteger ( const DictAny dict,
DictKeyT  key,
int64_t  defaultI 
)
inline

◆ dictAnyReadString() [1/2]

std::optional< std::string > dictAnyReadString ( const DictAny dict,
DictKeyT  key 
)
inline

◆ dictAnyReadString() [2/2]

auto dictAnyReadString ( const DictAny dict,
DictKeyT  key,
const std::string defaultS 
)
inline

◆ dynamicCastX()

To * dynamicCastX ( From ptr)
noexcept

◆ getHash()

template<HashableT T>
std::size_t getHash ( const T value)

◆ iterate()

template<IterableT T>
void iterate ( const T container,
std::function< void(const typename T::value_type &)> &&  func 
)

◆ makeBytes()

Bytes makeBytes ( const byte data,
size_t  len 
)
inline

◆ makeBytesView()

BytesView makeBytesView ( const byte data,
size_t  len 
)
inline

◆ makeStr()

template<CharacterT T>
std::string makeStr ( const T ptr,
size_t  len = 0 
)

◆ MaxV()

template<NumberT T>
constexpr T MaxV ( )
constexpr

◆ MinV()

template<NumberT T>
constexpr T MinV ( )
constexpr

◆ nullTerminatedCStr()

std::optional< const char * > nullTerminatedCStr ( std::string_view  str)
inline

◆ str2float128()

long double str2float128 ( const std::string str,
long double  defaultF = MinFloat128 
)

◆ str2float32()

float str2float32 ( const std::string str,
float  defaultF = MinFloat32 
)

◆ str2float64()

double str2float64 ( const std::string str,
double  defaultF = MinFloat64 
)

◆ str2int32()

int32_t str2int32 ( const std::string str,
int32_t  defaultI = MinInt32 
)

◆ str2int64()

int64_t str2int64 ( const std::string str,
int64_t  defaultI = MinInt64 
)

◆ underlying()

template<EnumT E>
constexpr auto underlying ( E  e) -> std::underlying_type_t<E>
constexprnoexcept

Variable Documentation

◆ MaxFloat128

constexpr auto MaxFloat128 = MaxV<long double>()
constexpr

◆ MaxFloat32

constexpr auto MaxFloat32 = MaxV<float>()
constexpr

◆ MaxFloat64

constexpr auto MaxFloat64 = MaxV<double>()
constexpr

◆ MaxInt32

constexpr auto MaxInt32 = MaxV<int32_t>()
constexpr

◆ MaxInt64

constexpr auto MaxInt64 = MaxV<int64_t>()
constexpr

◆ MinFloat128

constexpr auto MinFloat128 = MinV<long double>()
constexpr

◆ MinFloat32

constexpr auto MinFloat32 = MinV<float>()
constexpr

◆ MinFloat64

constexpr auto MinFloat64 = MinV<double>()
constexpr

◆ MinInt32

constexpr auto MinInt32 = MinV<int32_t>()
constexpr

◆ MinInt64

constexpr auto MinInt64 = MinV<int64_t>()
constexpr