PPL  1.2
Grid_Status_inlines.hh
Go to the documentation of this file.
1 /* Grid::Status class implementation: inline functions.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Grid_Status_inlines_hh
25 #define PPL_Grid_Status_inlines_hh 1
26 
27 namespace Parma_Polyhedra_Library {
28 
29 inline
31  : flags(mask) {
32 }
33 
34 inline
36  : flags(ZERO_DIM_UNIV) {
37 }
38 
39 inline bool
41  return (flags & mask) == mask;
42 }
43 
44 inline bool
46  return (flags & mask) != 0;
47 }
48 
49 inline void
51  flags |= mask;
52 }
53 
54 inline void
56  flags &= ~mask;
57 }
58 
59 inline bool
61  return flags == ZERO_DIM_UNIV;
62 }
63 
64 inline void
66  // This is a no-op if the current status is not zero-dim.
67  if (flags == ZERO_DIM_UNIV) {
68  // In the zero-dim space, if it is not the universe it is empty.
69  flags = EMPTY;
70  }
71 }
72 
73 inline void
75  // Zero-dim universe is incompatible with anything else.
76  flags = ZERO_DIM_UNIV;
77 }
78 
79 inline bool
81  return test_any(EMPTY);
82 }
83 
84 inline void
86  reset(EMPTY);
87 }
88 
89 inline void
91  flags = EMPTY;
92 }
93 
94 inline bool
96  return test_any(C_UP_TO_DATE);
97 }
98 
99 inline void
101  reset(C_UP_TO_DATE);
102 }
103 
104 inline void
106  set(C_UP_TO_DATE);
107 }
108 
109 inline bool
111  return test_any(G_UP_TO_DATE);
112 }
113 
114 inline void
116  reset(G_UP_TO_DATE);
117 }
118 
119 inline void
121  set(G_UP_TO_DATE);
122 }
123 
124 inline bool
126  return test_any(C_MINIMIZED);
127 }
128 
129 inline void
131  reset(C_MINIMIZED);
132 }
133 
134 inline void
136  set(C_MINIMIZED);
137 }
138 
139 inline bool
141  return test_any(G_MINIMIZED);
142 }
143 
144 inline void
146  reset(G_MINIMIZED);
147 }
148 
149 inline void
151  set(G_MINIMIZED);
152 }
153 
154 
155 inline bool
157  return test_any(CS_PENDING);
158 }
159 
160 inline void
162  reset(CS_PENDING);
163 }
164 
165 inline void
167  set(CS_PENDING);
168 }
169 
170 inline bool
172  return test_any(GS_PENDING);
173 }
174 
175 inline void
177  reset(GS_PENDING);
178 }
179 
180 inline void
182  set(GS_PENDING);
183 }
184 
185 
186 inline bool
188  return test_any(SAT_C_UP_TO_DATE);
189 }
190 
191 inline void
193  reset(SAT_C_UP_TO_DATE);
194 }
195 
196 inline void
198  set(SAT_C_UP_TO_DATE);
199 }
200 
201 inline bool
203  return test_any(SAT_G_UP_TO_DATE);
204 }
205 
206 inline void
208  reset(SAT_G_UP_TO_DATE);
209 }
210 
211 inline void
213  set(SAT_G_UP_TO_DATE);
214 }
215 
216 } // namespace Parma_Polyhedra_Library
217 
218 #endif // !defined(PPL_Status_inlines_hh)
The empty element, i.e., the empty set.
void reset(flags_t mask)
Reset the bits in mask.
void set(flags_t mask)
Set the bits in mask.
bool test_all(flags_t mask) const
Check whether all bits in mask are set.
Status()
By default Status is the zero-dim universe assertion.
unsigned int flags_t
Status is implemented by means of a finite bitset.
Definition: Grid_defs.hh:134
The entire library is confined to this namespace.
Definition: version.hh:61
bool test_any(flags_t mask) const
Check whether at least one bit in mask is set.