PPL  0.12.1
Row_Flags.inlines.hh
Go to the documentation of this file.
00001 /* Row_Flags class implementation: inline functions.
00002    Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
00003    Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com)
00004 
00005 This file is part of the Parma Polyhedra Library (PPL).
00006 
00007 The PPL is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 The PPL is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software Foundation,
00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
00020 
00021 For the most up-to-date information see the Parma Polyhedra Library
00022 site: http://bugseng.com/products/ppl/ . */
00023 
00024 #ifndef PPL_Row_Flags_inlines_hh
00025 #define PPL_Row_Flags_inlines_hh 1
00026 
00027 #include "math_utilities.defs.hh"
00028 
00029 namespace Parma_Polyhedra_Library {
00030 
00031 inline
00032 Row_Flags::Row_Flags()
00033   : bits(0) {
00034 }
00035 
00036 inline
00037 Row_Flags::Row_Flags(base_type n)
00038   : bits(n) {
00039 }
00040 
00041 inline Row_Flags::base_type
00042 Row_Flags::get_bits() const {
00043   return bits;
00044 }
00045 
00046 inline void
00047 Row_Flags::set_bits(const base_type mask) {
00048   bits |= mask;
00049 }
00050 
00051 inline void
00052 Row_Flags::reset_bits(const base_type mask) {
00053   bits &= ~mask;
00054 }
00055 
00056 inline bool
00057 Row_Flags::test_bits(const base_type mask) const {
00058   return (bits & mask) == mask;
00059 }
00060 
00061 inline bool
00062 Row_Flags::operator==(const Row_Flags& y) const {
00063   base_type mask = low_bits_mask<base_type>(first_free_bit);
00064   return (get_bits() & mask) == (y.get_bits() & mask);
00065 }
00066 
00067 inline bool
00068 Row_Flags::operator!=(const Row_Flags& y) const {
00069   return !operator==(y);
00070 }
00071 
00072 } // namespace Parma_Polyhedra_Library
00073 
00074 
00075 #endif // !defined(PPL_Row_Flags_inlines_hh)