open62541pp 0.15.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
Bitmask abstraction

Detailed Description

Classes

struct  opcua::IsBitmaskEnum< T >
 
class  opcua::Bitmask< T >
 

Functions

template<typename T >
constexpr std::false_type opcua::isBitmaskEnum (T)
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator& (T lhs, T rhs) noexcept
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator| (T lhs, T rhs) noexcept
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator^ (T lhs, T rhs) noexcept
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator~ (T rhs) noexcept
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator|= (T &lhs, T rhs) noexcept
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator&= (T &lhs, T rhs) noexcept
 
template<typename T >
constexpr std::enable_if_t< IsBitmaskEnum< T >::value, T > operator^= (T &lhs, T rhs) noexcept
 
template<typename T , typename U >
constexpr bool operator== (Bitmask< T > lhs, U rhs) noexcept
 
template<typename T , typename U >
constexpr bool operator!= (Bitmask< T > lhs, U rhs) noexcept
 
template<typename T , typename U >
constexpr bool operator== (U lhs, Bitmask< T > rhs) noexcept
 
template<typename T , typename U >
constexpr bool operator!= (U lhs, Bitmask< T > rhs) noexcept
 

Function Documentation

◆ isBitmaskEnum()

template<typename T >
std::false_type opcua::isBitmaskEnum ( T )
constexpr

Function template to define an enum (class) as a bitmask and allow bitwise operations.

The function must be overloaded for a specific enum type to return std::true_type.

This is an additional opt-in mechanism to specializations of the IsBitmaskEnum trait and can also be used in other namespaces.

◆ operator&()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator& ( T lhs,
T rhs )
related

Definition at line 52 of file bitmask.hpp.

◆ operator|()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator| ( T lhs,
T rhs )
related

Definition at line 59 of file bitmask.hpp.

◆ operator^()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator^ ( T lhs,
T rhs )
related

Definition at line 66 of file bitmask.hpp.

◆ operator~()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator~ ( T rhs)
related

Definition at line 73 of file bitmask.hpp.

◆ operator|=()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator|= ( T & lhs,
T rhs )
related

Definition at line 82 of file bitmask.hpp.

◆ operator&=()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator&= ( T & lhs,
T rhs )
related

Definition at line 90 of file bitmask.hpp.

◆ operator^=()

template<typename T >
std::enable_if_t< IsBitmaskEnum< T >::value, T > operator^= ( T & lhs,
T rhs )
related

Definition at line 98 of file bitmask.hpp.

◆ operator==() [1/2]

template<typename T , typename U >
bool operator== ( Bitmask< T > lhs,
U rhs )
related

Definition at line 229 of file bitmask.hpp.

◆ operator!=() [1/2]

template<typename T , typename U >
bool operator!= ( Bitmask< T > lhs,
U rhs )
related

Definition at line 235 of file bitmask.hpp.

◆ operator==() [2/2]

template<typename T , typename U >
bool operator== ( U lhs,
Bitmask< T > rhs )
related

Definition at line 241 of file bitmask.hpp.

◆ operator!=() [2/2]

template<typename T , typename U >
bool operator!= ( U lhs,
Bitmask< T > rhs )
related

Definition at line 247 of file bitmask.hpp.