XrdOucEnum.hh

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Copyright (c) 2013 by European Organization for Nuclear Research (CERN)
00003 // Author: Lukasz Janyst <ljanyst@cern.ch>
00004 //------------------------------------------------------------------------------
00005 // XRootD is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU Lesser General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // XRootD is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with XRootD.  If not, see <http://www.gnu.org/licenses/>.
00017 //------------------------------------------------------------------------------
00018 
00019 #ifndef __XRD_OUC_ENUM_HH__
00020 #define __XRD_OUC_ENUM_HH__
00021 
00022 #define XRDOUC_ENUM_OPERATORS( T ) \
00023   inline T  operator |  (const T  a, const T b) { return T(int(a) | int(b)); }  \
00024   inline T &operator |= (      T &a, const T b) { return a = a | b; }           \
00025   inline T  operator &  (const T  a, const T b) { return T(int(a) & int(b)); }  \
00026   inline T &operator &= (      T &a, const T b) { return a = a & b; }           \
00027   inline T  operator ^  (const T  a, const T b) { return T(int(a) ^ int(b)); }  \
00028   inline T &operator ^= (      T &a, const T b) { return a = a ^ b; }           \
00029   inline T  operator ~  (const T a)             { return T(~int(a)); }
00030 
00031 
00032 #endif // __XRD_OUC_ENUM_HH__

Generated on 12 Dec 2014 for xrootd by  doxygen 1.4.7