7 //How much should we shift pointers when computing hash functions
8 //5 appears to be the minimum value for Ubuntu 64-bit
14 BooleanEdge() : b(NULL) {}
15 BooleanEdge(Boolean * _b) : b(_b) {}
16 BooleanEdge negate() {return BooleanEdge((Boolean *)(((uintptr_t) b) ^ 1));}
17 bool operator==(BooleanEdge e) { return b==e.b;}
18 bool operator!=(BooleanEdge e) { return b!=e.b;}
19 bool isNegated() { return ((uintptr_t) b) & 1; }
20 Boolean * getBoolean() {return (Boolean *)(((uintptr_t)b) & ~((uintptr_t) 1));}
21 Boolean * getRaw() {return b;}
22 Boolean * operator->() {return getBoolean();}
23 operator bool() const {return b != NULL;}
28 inline bool boolEdgeEquals(BooleanEdge b1, BooleanEdge b2) {
32 inline unsigned int boolEdgeHash(BooleanEdge b) {
33 return (unsigned int) (((uintptr_t)b.getRaw())>>PTRSHIFT);
36 typedef Hashset<BooleanEdge, uintptr_t, PTRSHIFT, & boolEdgeHash, & boolEdgeEquals> HashsetBooleanEdge;
37 typedef Hashset<Order *, uintptr_t, PTRSHIFT> HashsetOrder;
38 typedef SetIterator<BooleanEdge, uintptr_t, PTRSHIFT, & boolEdgeHash, & boolEdgeEquals> SetIteratorBooleanEdge;
39 typedef SetIterator<Order *, uintptr_t, PTRSHIFT> SetIteratorOrder;