24 #ifndef PPL_Interval_Info_defs_hh
25 #define PPL_Interval_Info_defs_hh 1
32 namespace Interval_NS {
62 bits &= ~(
static_cast<T
>(1) << bit);
69 bits |=
static_cast<T
>(1) << bit;
78 get_bit(
const T& bits,
unsigned int bit) {
79 return (bits & (static_cast<T>(1) << bit)) != 0;
85 bits &= ~(((
static_cast<T
>(1) << len) - 1) << start);
86 bits |= value << start;
91 get_bits(T& bits,
unsigned int start,
unsigned int len) {
92 return (bits >> start) & ((
static_cast<T
>(1) << len) - 1);
97 using namespace Interval_NS;
98 using namespace Boundary_NS;
101 template <
typename Policy>
118 template <
typename Property>
121 template <
typename Property>
125 template <
typename Property>
128 template <
typename Property>
140 template <
typename Policy>
165 template <
typename T,
typename Policy>
176 const_int_nodef(lower_open_bit, lower_special_bit + (store_special ? 1 : 0));
177 const_int_nodef(upper_special_bit, lower_open_bit + (store_open ? 1 : 0));
178 const_int_nodef(upper_open_bit, upper_special_bit + (store_special ? 1 : 0));
179 const_int_nodef(cardinality_is_bit, upper_open_bit + (store_open ? 1 : 0));
181 + ((cache_empty || cache_singleton) ? 1 : 0));
182 const_int_nodef(cardinality_1_bit, cardinality_0_bit + (cache_empty ? 1 : 0));
183 const_int_nodef(next_bit, cardinality_1_bit + (cache_singleton ? 1 : 0));
195 set_boundary_property(t,
SPECIAL,
false);
196 set_boundary_property(t,
OPEN,
false);
229 if (!store_special) {
233 return get_bit(bitset, lower_special_bit);
236 return get_bit(bitset, upper_special_bit);
242 else if (t ==
LOWER) {
243 return get_bit(bitset, lower_open_bit);
246 return get_bit(bitset, upper_open_bit);
260 if (cache_singleton) {
265 if (cache_empty || cache_singleton) {
276 return cache_empty &&
get_bit(bitset, cardinality_0_bit);
278 return cache_singleton &&
get_bit(bitset, cardinality_1_bit);
280 return (cache_empty || cache_singleton)
281 &&
get_bit(bitset, cardinality_is_bit);
301 #endif // !defined(PPL_Interval_Info_defs_hh)
void clear_boundary_properties(Boundary_Type)
void reset_bit(T &bits, unsigned int bit)
Interval_Info_Null_Open(bool o)
bool get_boundary_property(Boundary_Type t, const Boundary_NS::Property &p) const
Enable_If< Is_Native_Or_Checked< T >::value, void >::type ascii_dump(std::ostream &s, const T &t)
#define const_bool_nodef(name, value)
Declares a per-class constant of type bool, called name and with value value.
Property::Value get_boundary_property(Boundary_Type, const Property &) const
static const Property OPEN(Property::OPEN_)
void set_bit(T &bits, unsigned int bit, bool value)
static const Property SPECIAL(Property::SPECIAL_)
static const Value default_value
void set_interval_property(const Property &, typename Property::Value=Property::default_value)
void set_interval_property(const Interval_NS::Property &p, bool value=true)
static const Value unsupported_value
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type ascii_load(std::istream &s, T &t)
void set_boundary_property(Boundary_Type t, const Boundary_NS::Property &p, bool value=true)
bool get_boundary_property(Boundary_Type, const Boundary_NS::Property &p) const
void set_boundary_property(Boundary_Type, const Property &, typename Property::Value=Property::default_value)
const Property CARDINALITY_IS(Property::CARDINALITY_IS_)
Property::Value get_interval_property(const Property &) const
bool get_bit(const T &bits, unsigned int bit)
void set_bits(T &bits, unsigned int start, unsigned int len, T value)
The entire library is confined to this namespace.
#define const_int_nodef(name, value)
Declares a per-class constant of type int, called name and with value value.
const Property CARDINALITY_1(Property::CARDINALITY_1_)
void clear_boundary_properties(Boundary_Type t)
static const Value unsupported_value
T get_bits(T &bits, unsigned int start, unsigned int len)
const Property CARDINALITY_0(Property::CARDINALITY_0_)
bool get_interval_property(Interval_NS::Property p) const