OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EnumBitmaskOps.h File Reference
#include <type_traits>
+ Include dependency graph for EnumBitmaskOps.h:

Go to the source code of this file.

Classes

struct  EnableBitmaskOps< T >
 

Macros

#define ENABLE_BITMASK_OPS(x)
 

Functions

template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > 
operator& (T lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > 
operator| (T lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > 
operator~ (T t)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > 
operator|= (T &lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > 
operator&= (T &lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, bool > 
any_bits_set (T t)
 

Macro Definition Documentation

#define ENABLE_BITMASK_OPS (   x)
Value:
template <> \
static const bool enable = true; \
};

Definition at line 78 of file EnumBitmaskOps.h.

Function Documentation

template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, bool> any_bits_set ( t)

Definition at line 72 of file EnumBitmaskOps.h.

References t, and run_benchmark_import::type.

72  {
73  using type = typename std::underlying_type_t<T>;
74  constexpr type zero{};
75  return static_cast<type>(t) != zero;
76 }
char * t
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> operator& ( lhs,
rhs 
)

Definition at line 47 of file EnumBitmaskOps.h.

References omnisci.dtypes::T, and run_benchmark_import::type.

47  {
48  using type = typename std::underlying_type_t<T>;
49  return static_cast<T>(static_cast<type>(lhs) & static_cast<type>(rhs));
50 }
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> operator&= ( T &  lhs,
rhs 
)

Definition at line 66 of file EnumBitmaskOps.h.

66  {
67  lhs = lhs & rhs;
68  return lhs;
69 }
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> operator| ( lhs,
rhs 
)

Definition at line 52 of file EnumBitmaskOps.h.

References omnisci.dtypes::T, and run_benchmark_import::type.

52  {
53  using type = typename std::underlying_type_t<T>;
54  return static_cast<T>(static_cast<type>(lhs) | static_cast<type>(rhs));
55 }
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> operator|= ( T &  lhs,
rhs 
)

Definition at line 61 of file EnumBitmaskOps.h.

61  {
62  lhs = lhs | rhs;
63  return lhs;
64 }
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> operator~ ( t)

Definition at line 57 of file EnumBitmaskOps.h.

References omnisci.dtypes::T, and t.

57  {
58  return static_cast<T>(~static_cast<std::underlying_type_t<T>>(t));
59 }
char * t