NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::uinteger128结构体 参考

128位无符号整数包装类 更多...

#include <packages.hpp>

类 neforce::uinteger128 继承关系图:
[图例]

Public 成员函数

constexpr uinteger128 (const value_type value) noexcept
 从基础类型构造
constexpr uinteger128 & operator= (const value_type value) noexcept
 从基础类型赋值
constexpr uinteger128 (const string &str, const int base=10)
 从字符串构造
constexpr uinteger128 (string_view str, int base=10)
 从字符串视图构造
constexpr string to_string () const
 将当前对象转换为字符串
constexpr uinteger128 & operator<<= (const uint32_t shift) noexcept
 重写左移赋值以支持128位移位
constexpr uinteger128 & operator>>= (const uint32_t shift) noexcept
 重写右移赋值以支持128位移位
Public 成员函数 继承自 neforce::iobject< uinteger128 >
constexpr bool try_parse (const string_view str) noexcept
 尝试从字符串解析对象
Public 成员函数 继承自 neforce::istringify< uinteger128 >
constexpr string to_string () const
 转换为字符串
Public 成员函数 继承自 neforce::ipackage< uinteger128, uint128_t >
constexpr ipackage (package_type value) noexcept
 构造函数
constexpr operator package_type () const noexcept
 类型转换操作符
constexpr package_type value () const noexcept
 获取数值
constexpr int64_t to_int64 () const noexcept
 转换为64位整数
constexpr size_t to_hash () const noexcept
 计算哈希值
constexpr void swap (uinteger128 &other) noexcept
 交换内容
constexpr bool equal_to (const uinteger128 &other) const noexcept
 相等比较操作符
constexpr bool less_than (const uinteger128 &other) const noexcept
 小于比较操作符
constexpr uinteger128operator+= (const uinteger128 &other) noexcept
 加法赋值操作符
constexpr uinteger128operator-= (const uinteger128 &other) noexcept
 减法赋值操作符
constexpr uinteger128operator*= (const uinteger128 &other) noexcept
 乘法赋值操作符
constexpr uinteger128operator/= (const uinteger128 &other)
 除法赋值操作符
constexpr uinteger128operator%= (const uinteger128 &other)
 取模赋值操作符
constexpr uinteger128operator++ () noexcept
 前置递增操作符
constexpr uinteger128operator-- () noexcept
 前置递减操作符
constexpr uinteger128 operator~ () const noexcept
 按位取反操作符
constexpr uinteger128operator&= (const uinteger128 &other) noexcept
 按位与赋值操作符
constexpr uinteger128operator|= (const uinteger128 &other) noexcept
 按位或赋值操作符
constexpr uinteger128operator^= (const uinteger128 &other) noexcept
 按位异或赋值操作符
constexpr uinteger128operator<<= (const uint32_t shift)
 左移赋值操作符
constexpr uinteger128operator>>= (const uint32_t shift)
 右移赋值操作符
Public 成员函数 继承自 neforce::icomparable< T >
constexpr bool operator== (const T &rhs) const noexcept(noexcept(derived().equal_to(rhs)))
 相等比较运算符
constexpr bool operator!= (const T &rhs) const noexcept(noexcept(!(derived().equal_to(rhs))))
 不等比较运算符
constexpr bool operator< (const T &rhs) const noexcept(noexcept(derived().less_than(rhs)))
 小于比较运算符
constexpr bool operator> (const T &rhs) const noexcept(noexcept(rhs.less_than(derived())))
 大于比较运算符
constexpr bool operator<= (const T &rhs) const noexcept(noexcept(!(rhs.less_than(derived()))))
 小于等于比较运算符
constexpr bool operator>= (const T &rhs) const noexcept(noexcept(!(derived().less_than(rhs))))
 大于等于比较运算符
Public 成员函数 继承自 neforce::ihashable< T >
constexpr size_t to_ihash () const noexcept(noexcept(derived().to_hash()))
 获取对象的哈希值
Public 成员函数 继承自 neforce::iarithmetic< T >
constexpr T operator+ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator+=(other)))
 加法运算符
constexpr T operator- (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator-=(other)))
 减法运算符
constexpr T operator* (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator*=(other)))
 乘法运算符
constexpr T operator/ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator/=(other)))
 除法运算符
constexpr T operator% (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator%=(other)))
 取模运算符
constexpr T & operator+= (const T &other) noexcept(noexcept(derived().operator+=(other)))
 加法赋值运算符
constexpr T & operator-= (const T &other) noexcept(noexcept(derived().operator-=(other)))
 减法赋值运算符
constexpr T & operator*= (const T &other) noexcept(noexcept(derived().operator*=(other)))
 乘法赋值运算符
constexpr T & operator/= (const T &other)
 除法赋值运算符
constexpr T & operator%= (const T &other)
 取模赋值运算符
constexpr T & operator++ () noexcept(noexcept(derived().operator++()))
 前置自增运算符
constexpr T operator++ (int) noexcept(noexcept(derived().operator++()))
 后置自增运算符
constexpr T & operator-- () noexcept(noexcept(derived().operator--()))
 前置自减运算符
constexpr T operator-- (int) noexcept(noexcept(derived().operator--()))
 后置自减运算符
Public 成员函数 继承自 neforce::ibinary< T >
constexpr T operator& (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator&=(other)))
 按位与运算符
constexpr T operator| (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator|=(other)))
 按位或运算符
constexpr T operator^ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator^=(other)))
 按位异或运算符
constexpr T operator~ () const noexcept(noexcept(derived().operator~()))
 按位取反运算符
constexpr T operator<< (const uint32_t shift) const
 左移运算符
constexpr T operator>> (const uint32_t shift) const
 右移运算符
constexpr T & operator&= (const T &other) noexcept(noexcept(derived().operator&=(other)))
 按位与赋值运算符
constexpr T & operator|= (const T &other) noexcept(noexcept(derived().operator|=(other)))
 按位或赋值运算符
constexpr T & operator^= (const T &other) noexcept(noexcept(derived().operator^=(other)))
 按位异或赋值运算符
constexpr T & operator<<= (const uint32_t shift)
 左移赋值运算符
constexpr T & operator>>= (const uint32_t shift)
 右移赋值运算符

静态 Public 成员函数

static constexpr string to_string (const value_type value)
 将基础类型值转换为字符串
static constexpr uinteger128 parse (const string_view str)
 从字符串解析
静态 Public 成员函数 继承自 neforce::iobject< uinteger128 >
static constexpr uinteger128 parse (const string_view str)
 从字符串解析对象
静态 Public 成员函数 继承自 neforce::ipackage< uinteger128, uint128_t >
static constexpr size_t bytes () noexcept
 获取类型字节大小
static constexpr size_t bits () noexcept
 获取类型位大小

额外继承的成员函数

Public 类型 继承自 neforce::ipackage< uinteger128, uint128_t >
using package_type
 包装类型
Protected 成员函数 继承自 neforce::ipackage< uinteger128, uint128_t >
constexpr ~ipackage ()=default
 受保护的析构函数
Protected 属性 继承自 neforce::ipackage< uinteger128, uint128_t >
package_type value_
 存储的数值

详细描述

128位无符号整数包装类

提供128位无符号整数的包装,支持类型转换、字符串表示、解析等功能。

在文件 packages.hpp260 行定义.

构造及析构函数说明

◆ uinteger128() [1/2]

neforce::uinteger128::uinteger128 ( const value_type value)
inlineexplicitconstexprnoexcept

从基础类型构造

参数
value128位无符号整数值

在文件 packages.hpp277 行定义.

引用了 neforce::ipackage< uinteger128, uint128_t >::value().

◆ uinteger128() [2/2]

neforce::uinteger128::uinteger128 ( const string & str,
const int base = 10 )
inlineexplicitconstexpr

从字符串构造

参数
str数字字符串
base进制基数(默认10)
异常
typecast_exception字符串格式无效时抛出

在文件 packages.hpp296 行定义.

成员函数说明

◆ operator<<=()

uinteger128 & neforce::uinteger128::operator<<= ( const uint32_t shift)
inlineconstexprnoexcept

重写左移赋值以支持128位移位

参数
shift移位量
返回
自身引用

在文件 packages.hpp339 行定义.

引用了 neforce::ipackage< uinteger128, uint128_t >::value_.

◆ operator=()

uinteger128 & neforce::uinteger128::operator= ( const value_type value)
inlineconstexprnoexcept

从基础类型赋值

参数
value128位无符号整数值
返回
自身引用

在文件 packages.hpp285 行定义.

引用了 neforce::ipackage< uinteger128, uint128_t >::value() , 以及 neforce::ipackage< uinteger128, uint128_t >::value_.

◆ operator>>=()

uinteger128 & neforce::uinteger128::operator>>= ( const uint32_t shift)
inlineconstexprnoexcept

重写右移赋值以支持128位移位

参数
shift移位量
返回
自身引用

在文件 packages.hpp349 行定义.

引用了 neforce::ipackage< uinteger128, uint128_t >::value_.

◆ parse()

constexpr uinteger128 neforce::uinteger128::parse ( const string_view str)
inlinestaticnodiscardconstexpr

从字符串解析

参数
str字符串视图
返回
解析结果
异常
typecast_exception字符串格式无效时抛出

在文件 packages.hpp330 行定义.

引用了 neforce::to_uint128().

◆ to_string() [1/2]

string neforce::uinteger128::to_string ( ) const
inlinenodiscardconstexpr

将当前对象转换为字符串

返回
字符串表示

在文件 packages.hpp322 行定义.

引用了 neforce::ipackage< uinteger128, uint128_t >::value_.

◆ to_string() [2/2]

constexpr string neforce::uinteger128::to_string ( const value_type value)
inlinestaticnodiscardconstexpr

将基础类型值转换为字符串

参数
value基础类型值
返回
字符串表示

在文件 packages.hpp314 行定义.

引用了 neforce::ipackage< uinteger128, uint128_t >::value().


该结构体的文档由以下文件生成: