跳至内容

Helpers

导航: 示例Cauldron杂项

Helpers

Cauldron 中使用的辅助函数。

Defines

不可复制

#define NO_COPY(typeName) typeName(const typeName&) = delete; \
typeName& operator=(const typeName&) = delete;

从 \typeName 类中删除复制构造函数,从而无法复制该类。

来源: framework/cauldron/framework/inc/misc/helpers.h (第 44 行, 第 9 列)

不可移动

#define NO_MOVE(typeName) typeName(const typeName&&) = delete; \
typeName& operator=(const typeName&&) = delete;

从 \typeName 类中删除移动构造函数,从而无法移动该类。

来源: framework/cauldron/framework/inc/misc/helpers.h (第 52 行, 第 9 列)

函数

WStringToString

inline std::string WStringToString(const std::wstring &string)

将 std::wstring 转换为 std::string。

返回值: std::wstring 的 std::string 表示。

参数

  • string (const std::wstring &) – [输入] 要转换为 std::string 的 std::wstring。

返回值: std::string

属性: inline

来源: framework/cauldron/framework/inc/misc/helpers.h (第 76 行, 第 20 列)

StringToWString

inline std::wstring StringToWString(const std::string &string)

将 std::string 转换为 std::wstring。

返回值: std::string 的 std::wstring 表示。

参数

  • string (const std::string &) – [输入] 要转换为 std::wstring 的 std::string。

返回值: std::wstring

属性: inline

来源: framework/cauldron/framework/inc/misc/helpers.h (第 100 行, 第 21 列)

AlignUp

inline T AlignUp(T val, T alignment)

将大小向上对齐到指定量。

返回值: 新的对齐值(如果尚未对齐)。

参数

  • val (T) – [输入] 要对齐的值。
  • alignment (T) – [输入] 要对齐到的对齐量。

返回值: T

属性: inline

来源: framework/cauldron/framework/inc/misc/helpers.h (第 125 行, 第 21 列)

DivideRoundingUp

constexpr uint32_t DivideRoundingUp(uint32_t a, uint32_t b)

计算两个无符号整数的向上取整的整数除法。

返回值: 大于或等于 a 和 b 精确除法的最小整数。

参数

  • a (uint32_t) – [输入] 被除数。
  • b (uint32_t) – [输入] 除数。

返回值: constexpr uint32_t

来源: framework/cauldron/framework/inc/misc/helpers.h (第 138 行, 第 20 列)

CountBitsSet

inline uint8_t CountBitsSet(uint32_t val) noexcept

计算整数中设置为 1 的位数。

返回值: 所提供 val 中设置为 1 的位数。

参数

  • val (uint32_t) – [输入] 整数掩码。

返回值: uint8_t

属性: inline

来源: framework/cauldron/framework/inc/misc/helpers.h (第 155 行, 第 16 列)

© . This site is unofficial and not affiliated with AMD.