changes
[IRC.git] / Robust / src / Runtime / oooJava / hashStructure.h
index 65dd9a42c3fe0dbd780ca47e995400201daaa180..479a6276622eca7d3ab2e35a09616b29222153ed 100644 (file)
@@ -1,95 +1,91 @@
-#ifndef HASHSTRUCTURE_H_\r
-#define HASHSTRUCTURE_H_\r
-\r
-#include "mlp_runtime.h"\r
-//#include "WaitingQueue.h"\r
-\r
-#define ITEM_NOT_AT_FRONT_OF_WAITINGQ 3\r
-#define TRAVERSER_FINISHED 2\r
-#define bitvt unsigned long long\r
-\r
-//Note READEFFECT = READBIN and WRITEEFFECT=WRITEBIN. They mean the same thing\r
-//but are named differently for clarity in code.\r
-#define READEFFECT 0\r
-#define WRITEEFFECT 1\r
-#define WAITINGQUEUENOTE 2\r
-\r
-#define READBIN 0\r
-#define WRITEBIN 1\r
-#define BINMASK 1\r
-#define PARENTBIN 1\r
-\r
-#define SPEC 2\r
-#define READY 1          //Item is ready and we haven't seen this bin before\r
-#define NOTREADY 0       //Item is not ready and we haven't seen this bin before\r
-#define SPECREADY (SPEC|READY)      //Item is ready and we've seen this bin before\r
-#define SPECNOTREADY (SPEC|NOTREADY)   //Item is not ready and we've seen this bin before\r
-#define READYMASK 1\r
-
-\r
-#define TRUE 1\r
-#define FALSE 0\r
-\r
-#define RNUMBINS 64\r
-#define RNUMREAD 64\r
-#define RNUMRENTRY 256\r
-#define RH_MASK (RNUMBINS)-1\r
-\r
-//Note: put resolved things at the end and unresolved at the front.\r
-typedef struct BinItem_rcr {\r
-  int total;\r
-  int status;\r
-  int type;\r
-  //TODO keep track of record ptr here\r
-  struct BinItem_rcr * next;\r
-} BinItem_rcr;\r
-\r
-typedef struct BinElement_rcr {\r
-  BinItem_rcr * head;\r
-  BinItem_rcr * tail;\r
-} BinElement_rcr;\r
-\r
-typedef struct Hashtable_rcr {\r
-  BinElement_rcr array[RNUMBINS];\r
-  //  WaitingQueueBin * waitingQueue;\r
-} HashStructure;\r
-\r
-//Todo this is a clone of REntry, remove data fields as necessary\r
-typedef struct Entry_rcr {\r
-  SESEcommon * task;\r
-  bitvt bitindex;\r
-} TraverserData;\r
-\r
-typedef struct WriteBinItem_rcr {\r
-  BinItem_rcr item;\r
-  SESEcommon * task;\r
-  bitvt bitindexwr;\r
-  bitvt bitindexrd;\r
-} WriteBinItem_rcr;\r
-\r
-typedef struct ReadBinItem_rcr {\r
-  BinItem_rcr item;\r
-  TraverserData array[RNUMREAD];\r
-  //We don't need a head index since if the item before it was freed, then all these would be considered ready as well.\r
-  int index;\r
-} ReadBinItem_rcr;\r
-\r
-extern HashStructure ** allHashStructures;\r
-\r
-void rcr_createMasterHashTableArray(int maxSize); //temporary\r
-HashStructure* rcr_createHashtable(int sizeofWaitingQueue);\r
-WriteBinItem_rcr* rcr_createWriteBinItem();\r
-ReadBinItem_rcr* rcr_createReadBinItem();\r
-int rcr_isReadBinItem(BinItem_rcr* b);\r
-int rcr_isWriteBinItem(BinItem_rcr* b);\r
-inline int rcr_generateKey(void * ptr);\r
-\r
-//Method signatures are not in their final form since I have still not decided what is the optimum amount of data\r
-//to store in each entry.\r
-\r
-int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index);\r
-int rcr_READBINCASE(HashStructure *T, void *ptr, SESEcommon * task, int index);\r
-int rcr_TAILREADCASE(HashStructure *T, void * ptr, BinItem_rcr *val, BinItem_rcr *bintail, int key, SESEcommon * task, int index);\r
-void rcr_TAILWRITECASE(HashStructure *T, void *ptr, BinItem_rcr *val, BinItem_rcr *bintail, int key, SESEcommon * task, int index);\r
-\r
-#endif\r
+#ifndef HASHSTRUCTURE_H_
+#define HASHSTRUCTURE_H_
+
+#include "mlp_runtime.h"
+//#include "WaitingQueue.h"
+
+#define bitvt unsigned long long
+
+//Note READEFFECT = READBIN and WRITEEFFECT=WRITEBIN. They mean the same thing
+//but are named differently for clarity in code.
+#define READEFFECT 0
+#define WRITEEFFECT 1
+#define WAITINGQUEUENOTE 2
+
+#define READBIN 0
+#define WRITEBIN 1
+#define BINMASK 1
+#define PARENTBIN 1
+
+#define SPEC 2
+#define READY 1          //Item is ready and we haven't seen this bin before
+#define NOTREADY 0       //Item is not ready and we haven't seen this bin before
+#define SPECREADY (SPEC|READY)      //Item is ready and we've seen this bin before
+#define SPECNOTREADY (SPEC|NOTREADY)   //Item is not ready and we've seen this bin before
+#define READYMASK 1
+
+
+#define TRUE 1
+#define FALSE 0
+
+#define RNUMBINS 64
+#define RNUMREAD 64
+#define RNUMRENTRY 256
+#define RH_MASK (RNUMBINS)-1
+
+//Note: put resolved things at the end and unresolved at the front.
+typedef struct BinItem_rcr {
+  int total;
+  int status;
+  int type;
+  //TODO keep track of record ptr here
+  struct BinItem_rcr * next;
+} BinItem_rcr;
+
+typedef struct BinElement_rcr {
+  BinItem_rcr * head;
+  BinItem_rcr * tail;
+} BinElement_rcr;
+
+typedef struct Hashtable_rcr {
+  BinElement_rcr array[RNUMBINS];
+  //  WaitingQueueBin * waitingQueue;
+} HashStructure;
+
+//Todo this is a clone of REntry, remove data fields as necessary
+typedef struct Entry_rcr {
+  SESEcommon * task;
+  bitvt bitindex;
+} TraverserData;
+
+typedef struct WriteBinItem_rcr {
+  BinItem_rcr item;
+  SESEcommon * task;
+  bitvt bitindexwr;
+  bitvt bitindexrd;
+} WriteBinItem_rcr;
+
+typedef struct ReadBinItem_rcr {
+  BinItem_rcr item;
+  TraverserData array[RNUMREAD];
+  //We don't need a head index since if the item before it was freed, then all these would be considered ready as well.
+  int index;
+} ReadBinItem_rcr;
+
+extern HashStructure ** allHashStructures;
+
+void rcr_createMasterHashTableArray(int maxSize); //temporary
+HashStructure* rcr_createHashtable(int sizeofWaitingQueue);
+WriteBinItem_rcr* rcr_createWriteBinItem();
+ReadBinItem_rcr* rcr_createReadBinItem();
+inline int rcr_generateKey(void * ptr);
+
+//Method signatures are not in their final form since I have still not decided what is the optimum amount of data
+//to store in each entry.
+
+int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index);
+int rcr_READBINCASE(HashStructure *T, void *ptr, SESEcommon * task, int index);
+int rcr_TAILREADCASE(HashStructure *T, void * ptr, BinItem_rcr *val, BinItem_rcr *bintail, int key, SESEcommon * task, int index);
+void rcr_TAILWRITECASE(HashStructure *T, void *ptr, BinItem_rcr *val, BinItem_rcr *bintail, int key, SESEcommon * task, int index);
+
+#endif