Helpers
Navigation: Samples → Cauldron → Miscellaneous
Helpers
Helper functions used throughout Cauldron.
Defines
NO_COPY
#define NO_COPY(typeName) typeName(const typeName&) = delete; \ typeName& operator=(const typeName&) = delete;
Deletes copy constructors from \typeName class so the class can not be copied.
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 44, column 9)
NO_MOVE
#define NO_MOVE(typeName) typeName(const typeName&&) = delete; \ typeName& operator=(const typeName&&) = delete;
Deletes move constructors from \typeName class so the class can not be moved.
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 52, column 9)
Functions
WStringToString
inline std::string WStringToString(const std::wstring &string)
Converts an std::wstring to std::string.
Returns: The std::string representation of the std::wstring.
Parameters:
string
(const std::wstring &
) – [in] The std::wstring to convert to std::string.
Returns: std::string
Attributes: inline
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 76, column 20)
StringToWString
inline std::wstring StringToWString(const std::string &string)
Converts an std::string to std::wstring.
Returns: The std::wstring representation of the std::string.
Parameters:
string
(const std::string &
) – [in] The std::string to convert to std::wstring.
Returns: std::wstring
Attributes: inline
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 100, column 21)
AlignUp
inline T AlignUp(T val, T alignment)
Aligns a size up to the specified amount.
Returns: The new aligned (if not already aligned) value.
Parameters:
val
(T
) – [in] The value to align.alignment
(T
) – [in] The alignment to align the value to.
Returns: T
Attributes: inline
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 125, column 21)
DivideRoundingUp
constexpr uint32_t DivideRoundingUp(uint32_t a, uint32_t b)
Computes the rounded-up integer division of two unsigned integers.
Returns: The smallest integer greater than or equal to the exact division of a and b.
Parameters:
a
(uint32_t
) – [in] The dividend.b
(uint32_t
) – [in] The divisor.
Returns: constexpr uint32_t
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 138, column 20)
CountBitsSet
inline uint8_t CountBitsSet(uint32_t val) noexcept
Computes the number of bits set to 1 in a integer.
Returns: Number of bits set to 1 in provided val.
Parameters:
val
(uint32_t
) – [in] Integer mask.
Returns: uint8_t
Attributes: inline
Source: framework/cauldron/framework/inc/misc/helpers.h
(line 155, column 16)