summaryrefslogtreecommitdiff
path: root/src/util/bitvector.h
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-08-07 18:38:49 +0000
committerMorgan Deters <mdeters@gmail.com>2012-08-07 18:38:49 +0000
commitb0deae79d8bae5051a85dc15e43e7b83bc8cf9ab (patch)
treed73fa7f9fb37077853f824dcecd2a1b8e4d22837 /src/util/bitvector.h
parentea5acaba821790dd240db779f2340fbe5fce0b8e (diff)
Some items from the CVC4 public interface review:
* rename DeclarationScope to SymbolTable * rename all HashStrategy -> HashFunction (which we often have anyways) * remove CDCircList (no one is currently using it)
Diffstat (limited to 'src/util/bitvector.h')
-rw-r--r--src/util/bitvector.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/util/bitvector.h b/src/util/bitvector.h
index 5d0c301d4..185bb55d9 100644
--- a/src/util/bitvector.h
+++ b/src/util/bitvector.h
@@ -375,11 +375,11 @@ inline BitVector::BitVector(const std::string& num, unsigned base) {
/**
* Hash function for the BitVector constants.
*/
-struct CVC4_PUBLIC BitVectorHashStrategy {
- static inline size_t hash(const BitVector& bv) {
+struct CVC4_PUBLIC BitVectorHashFunction {
+ inline size_t operator()(const BitVector& bv) const {
return bv.hash();
}
-};/* struct BitVectorHashStrategy */
+};/* struct BitVectorHashFunction */
/**
* The structure representing the extraction operation for bit-vectors. The
@@ -403,14 +403,13 @@ struct CVC4_PUBLIC BitVectorExtract {
/**
* Hash function for the BitVectorExtract objects.
*/
-class CVC4_PUBLIC BitVectorExtractHashStrategy {
-public:
- static size_t hash(const BitVectorExtract& extract) {
+struct CVC4_PUBLIC BitVectorExtractHashFunction {
+ size_t operator()(const BitVectorExtract& extract) const {
size_t hash = extract.low;
hash ^= extract.high + 0x9e3779b9 + (hash << 6) + (hash >> 2);
return hash;
}
-};/* class BitVectorExtractHashStrategy */
+};/* struct BitVectorExtractHashFunction */
/**
@@ -430,12 +429,11 @@ struct CVC4_PUBLIC BitVectorBitOf {
/**
* Hash function for the BitVectorBitOf objects.
*/
-class CVC4_PUBLIC BitVectorBitOfHashStrategy {
-public:
- static size_t hash(const BitVectorBitOf& b) {
+struct CVC4_PUBLIC BitVectorBitOfHashFunction {
+ size_t operator()(const BitVectorBitOf& b) const {
return b.bitIndex;
}
-};/* class BitVectorBitOfHashStrategy */
+};/* struct BitVectorBitOfHashFunction */
@@ -482,11 +480,11 @@ struct CVC4_PUBLIC BitVectorRotateRight {
};/* struct BitVectorRotateRight */
template <typename T>
-struct CVC4_PUBLIC UnsignedHashStrategy {
- static inline size_t hash(const T& x) {
+struct CVC4_PUBLIC UnsignedHashFunction {
+ inline size_t operator()(const T& x) const {
return (size_t)x;
}
-};/* struct UnsignedHashStrategy */
+};/* struct UnsignedHashFunction */
inline std::ostream& operator <<(std::ostream& os, const BitVector& bv) CVC4_PUBLIC;
inline std::ostream& operator <<(std::ostream& os, const BitVector& bv) {
@@ -503,8 +501,6 @@ inline std::ostream& operator <<(std::ostream& os, const BitVectorBitOf& bv) {
return os << "[" << bv.bitIndex << "]";
}
-
-
}/* CVC4 namespace */
#endif /* __CVC4__BITVECTOR_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback