Improve propagation and add preprocessor pass
[satune.git] / src / Collections / structs.h
index 3e08e976a65b4b55367c0362298d5aebc916f096..e9c645f3a1dc85c1b8ed166cd820aa6910c9ff1f 100644 (file)
@@ -1,28 +1,39 @@
 #ifndef STRUCTS_H
 #define STRUCTS_H
-#include "vector.h"
+#include "cppvector.h"
 #include "hashtable.h"
 #include "hashset.h"
 #include "classlist.h"
+#include "array.h"
+#include "corestructs.h"
 
-VectorDef(Int, uint64_t, 4);
-VectorDef(Void, void *, 4);
-VectorDef(Boolean, Boolean *, 4);
-VectorDef(Constraint, Constraint *, 4);
-VectorDef(Set, Set *, 4);
-VectorDef(Element, Element *, 4);
-VectorDef(TableEntry, TableEntry *, 4);
-VectorDef(Predicate, Predicate *, 4);
-VectorDef(Table, Table *, 4);
+unsigned int table_entry_hash_function(TableEntry *This);
+bool table_entry_equals(TableEntry *key1, TableEntry *key2);
+unsigned int order_node_hash_function(OrderNode *This);
+bool order_node_equals(OrderNode *key1, OrderNode *key2);
+unsigned int order_edge_hash_function(OrderEdge *This);
+bool order_edge_equals(OrderEdge *key1, OrderEdge *key2);
+unsigned int order_element_hash_function(OrderElement *This);
+bool order_element_equals(OrderElement *key1, OrderElement *key2);
+unsigned int order_pair_hash_function(OrderPair *This);
+bool order_pair_equals(OrderPair *key1, OrderPair *key2);
 
-inline unsigned int Ptr_hash_function(void * hash) {
-       return (unsigned int)((uint64_t)hash >> 4);
-}
 
-inline bool Ptr_equals(void * key1, void * key2) {
-       return key1 == key2;
-}
+typedef Hashset<TableEntry *, uintptr_t, 4, table_entry_hash_function, table_entry_equals> HashsetTableEntry;
+typedef Hashset<OrderNode *, uintptr_t, 4, order_node_hash_function, order_node_equals> HashsetOrderNode;
+typedef Hashset<OrderEdge *, uintptr_t, 4, order_edge_hash_function, order_edge_equals> HashsetOrderEdge;
+typedef Hashset<OrderElement *, uintptr_t, 4, order_element_hash_function, order_element_equals> HashsetOrderElement;
+typedef Hashset<Boolean *, uintptr_t, 4> HashsetBoolean;
+typedef SetIterator<Boolean *, uintptr_t, 4> SetIteratorBoolean;
+
+typedef Hashtable<OrderNode *, HashsetOrderNode *, uintptr_t, 4> HashtableNodeToNodeSet;
+typedef Hashtable<OrderPair *, OrderPair *, uintptr_t, 4, order_pair_hash_function, order_pair_equals> HashtableOrderPair;
+typedef Hashtable<void *, void *, uintptr_t, 4> CloneMap;
+typedef Hashtable<Order *, IntegerEncodingRecord *, uintptr_t, 4> HashTableOrderIntEncoding;
+
+typedef SetIterator<TableEntry *, uintptr_t, 4, table_entry_hash_function, table_entry_equals> SetIteratorTableEntry;
+typedef SetIterator<OrderEdge *, uintptr_t, 4, order_edge_hash_function, order_edge_equals> SetIteratorOrderEdge;
+typedef SetIterator<OrderNode *, uintptr_t, 4, order_node_hash_function, order_node_equals> SetIteratorOrderNode;
+typedef SetIterator<OrderElement *, uintptr_t, 4, order_element_hash_function, order_element_equals> SetIteratorOrderElement;
 
-HashTableDef(Void, void *, void *, Ptr_hash_function, Ptr_equals);
-HashSetDef(Void, void *, Ptr_hash_function, Ptr_equals);
 #endif