TSDuck v3.40-4033
MPEG Transport Stream Toolkit
|
Some utilities on enumeration types. More...
Classes | |
struct | ts::EnableBitMaskOperators< T > |
This traits is used to enable bitmask operators on an enumeration type. More... | |
struct | ts::underlying_type< T > |
The meta-type ts::underlying_type is a generalization of std::underlying_type which works on integer types as well. More... | |
Namespaces | |
namespace | ts |
TSDuck namespace, containing all TSDuck classes and functions. | |
Macros | |
#define | TS_ENABLE_BITMASK_OPERATORS(T) |
This macro enables bitmask operators on an enumeration type. | |
Functions | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value constexpr bool | operator! (ENUM a) |
Boolean "not" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value constexpr ENUM | operator& (ENUM a, ENUM b) |
Bitmask "and" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value ENUM & | operator&= (ENUM &a, ENUM b) |
Bitmask "assign and" operator on enumeration types. | |
template<typename ENUM , typename std::enable_if< std::is_enum< ENUM >::value &&ts::EnableBitMaskOperators< ENUM >::value >::type * = nullptr> | |
constexpr ENUM | operator<< (ENUM a, size_t b) |
Bitmask "left shift" operator on enumeration types. | |
template<typename ENUM , typename std::enable_if< std::is_enum< ENUM >::value &&ts::EnableBitMaskOperators< ENUM >::value >::type * = nullptr> | |
ENUM & | operator<<= (ENUM &a, size_t b) |
Bitmask "assign left shift" operator on enumeration types. | |
template<typename ENUM , typename std::enable_if< std::is_enum< ENUM >::value &&ts::EnableBitMaskOperators< ENUM >::value >::type * = nullptr> | |
constexpr ENUM | operator>> (ENUM a, size_t b) |
Bitmask "right shift" operator on enumeration types. | |
template<typename ENUM , typename std::enable_if< std::is_enum< ENUM >::value &&ts::EnableBitMaskOperators< ENUM >::value >::type * = nullptr> | |
ENUM & | operator>>= (ENUM &a, size_t b) |
Bitmask "assign right shift" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value constexpr ENUM | operator^ (ENUM a, ENUM b) |
Bitmask "xor" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value ENUM & | operator^= (ENUM &a, ENUM b) |
Bitmask "assign xor" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value constexpr ENUM | operator| (ENUM a, ENUM b) |
Bitmask "or" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value ENUM & | operator|= (ENUM &a, ENUM b) |
Bitmask "assign or" operator on enumeration types. | |
template<typename ENUM > requires std::is_enum_v<ENUM> && ts::EnableBitMaskOperators<ENUM> | |
::value constexpr ENUM | operator~ (ENUM a) |
Bitmask "not" unary operator on enumeration types. | |
Some utilities on enumeration types.
#define TS_ENABLE_BITMASK_OPERATORS | ( | T | ) |
This macro enables bitmask operators on an enumeration type.
T | An enumeration type or enumeration class. |
Example:
|
inlineconstexpr |
Bitmask "not" unary operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | Operand. |
|
inlineconstexpr |
Boolean "not" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | Enumeration value. Typically an expression uing bitmask "and" or "or" operators on ENUM. |
|
inlineconstexpr |
Bitmask "or" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | First operand. |
[in] | b | Second operand. |
|
inlineconstexpr |
Bitmask "and" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | First operand. |
[in] | b | Second operand. |
|
inlineconstexpr |
Bitmask "xor" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | First operand. |
[in] | b | Second operand. |
|
inline |
Bitmask "assign or" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in,out] | a | Variable to update. |
[in] | b | Second operand. |
|
inline |
Bitmask "assign and" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in,out] | a | Variable to update. |
[in] | b | Second operand. |
|
inline |
Bitmask "assign xor" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in,out] | a | Variable to update. |
[in] | b | Second operand. |
|
inlineconstexpr |
Bitmask "left shift" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | Enum value to shift. |
[in] | b | Number of bits to shift. |
Implementation note: The use of std::enable_if instead of the "requires" directive is a workaround for a bug in clang 19.
|
inlineconstexpr |
Bitmask "right shift" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in] | a | Enum value to shift. |
[in] | b | Number of bits to shift. |
Implementation note: The use of std::enable_if instead of the "requires" directive is a workaround for a bug in clang 19.
|
inline |
Bitmask "assign left shift" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in,out] | a | Enum variable to shift. |
[in] | b | Number of bits to shift. |
Implementation note: The use of std::enable_if instead of the "requires" directive is a workaround for a bug in clang 19.
|
inline |
Bitmask "assign right shift" operator on enumeration types.
ENUM | An enumeration type or enumeration class. |
[in,out] | a | Enum variable to shift. |
[in] | b | Number of bits to shift. |
Implementation note: The use of std::enable_if instead of the "requires" directive is a workaround for a bug in clang 19.