From e55048422492b30b179c2118296669a677a72415 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Sun, 8 Dec 2024 15:26:31 +0100 Subject: [PATCH] Common: Delete enum bit operators --- .../include/CommonUtils/EnumBitOperators.h | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 Common/Utils/include/CommonUtils/EnumBitOperators.h diff --git a/Common/Utils/include/CommonUtils/EnumBitOperators.h b/Common/Utils/include/CommonUtils/EnumBitOperators.h deleted file mode 100644 index 3369a8eacf615..0000000000000 --- a/Common/Utils/include/CommonUtils/EnumBitOperators.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. -#ifndef O2_FRAMEWORK_ENUM_BIT_OPERATORS_H_ -#define O2_FRAMEWORK_ENUM_BIT_OPERATORS_H_ - -#include - -#define O2_DEFINE_ENUM_BIT_OPERATORS(enum_t) \ - constexpr auto operator|(enum_t lhs, enum_t rhs) \ - { \ - return static_cast( \ - static_cast>(lhs) | \ - static_cast>(rhs)); \ - } \ - \ - constexpr auto operator&(enum_t lhs, enum_t rhs) \ - { \ - return static_cast( \ - static_cast>(lhs) & \ - static_cast>(rhs)); \ - } \ - \ - constexpr auto operator^(enum_t lhs, enum_t rhs) \ - { \ - return static_cast( \ - static_cast>(lhs) ^ \ - static_cast>(rhs)); \ - } \ - \ - constexpr auto operator~(enum_t op) \ - { \ - return static_cast( \ - ~static_cast>(op)); \ - } \ - \ - constexpr auto& operator|=(enum_t& lhs, enum_t rhs) \ - { \ - lhs = lhs | rhs; \ - return lhs; \ - } \ - \ - constexpr auto& operator&=(enum_t& lhs, enum_t rhs) \ - { \ - lhs = lhs & rhs; \ - return lhs; \ - } \ - \ - constexpr enum_t& operator^=(enum_t& lhs, enum_t rhs) \ - { \ - lhs = lhs ^ rhs; \ - return lhs; \ - } - -#define O2_ENUM_TEST_BIT(mask, value) ((mask & value) == value) -#define O2_ENUM_SET_BIT(bit) ((1 << bit)) -#define O2_ENUM_ANY_BIT(enum) ((static_cast>(enum) != 0)) - -#endif