OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EnumBitmaskOps.h File Reference
#include <type_traits>
+ Include dependency graph for EnumBitmaskOps.h:
+ This graph shows which files directly or indirectly include this file:

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 > constexpr 
operator& (T lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > constexpr 
operator| (T lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > constexpr 
operator~ (T t)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > constexpr 
operator|= (T &lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, T > constexpr 
operator&= (T &lhs, T rhs)
 
template<typename T >
std::enable_if_t
< EnableBitmaskOps< T >
::enable, bool > constexpr 
any_bits_set (T t)
 

Macro Definition Documentation

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

Definition at line 82 of file EnumBitmaskOps.h.

Function Documentation

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

Definition at line 76 of file EnumBitmaskOps.h.

References run_benchmark_import::type.

Referenced by heavyai::InSituFlagsOwnerInterface::couldRunInSitu(), and heavyai::InSituFlagsOwnerInterface::isNonInSitu().

76  {
77  using type = typename std::underlying_type_t<T>;
78  constexpr type zero{};
79  return static_cast<type>(t) != zero;
80 }

+ Here is the caller graph for this function:

template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> constexpr operator& ( lhs,
rhs 
)

Definition at line 47 of file EnumBitmaskOps.h.

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

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

Definition at line 69 of file EnumBitmaskOps.h.

70  {
71  lhs = lhs & rhs;
72  return lhs;
73 }
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> constexpr operator| ( lhs,
rhs 
)

Definition at line 53 of file EnumBitmaskOps.h.

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

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

Definition at line 63 of file EnumBitmaskOps.h.

64  {
65  lhs = lhs | rhs;
66  return lhs;
67 }
template<typename T >
std::enable_if_t<EnableBitmaskOps<T>::enable, T> constexpr operator~ ( t)

Definition at line 59 of file EnumBitmaskOps.h.

References heavydb.dtypes::T.

59  {
60  return static_cast<T>(~static_cast<std::underlying_type_t<T>>(t));
61 }