X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=blobdiff_plain;f=version2%2Fsrc%2FC%2FPair.h;h=4da3bf7f1a06f605817a043922ab4545b8b3546f;hp=192e93cd248fe27c1b7eb34c8333a52e47c539ba;hb=1982d44395bc486667d8b25d6d7763c2ffbf61bc;hpb=6ab6933678c5fe60b9705789584c1d102752fa5b diff --git a/version2/src/C/Pair.h b/version2/src/C/Pair.h index 192e93c..4da3bf7 100644 --- a/version2/src/C/Pair.h +++ b/version2/src/C/Pair.h @@ -22,4 +22,21 @@ public: } }; +template +inline unsigned int pairHashFunction(Pair p) { + return (p.getFirst() << 1) ^ p.getSecond(); +} + +template +inline bool pairEquals(Pair a, Pair b) { + return ( a.getFirst() == b.getFirst() ) && (a.getSecond() == b.getSecond()); +} + +inline unsigned int pairHashFunction(Pair p) { + return (p.getFirst() << 1) ^ p.getSecond(); +} + +inline bool pairEquals(Pair a, Pair b) { + return ( a.getFirst() == b.getFirst() ) && (a.getSecond() == b.getSecond()); +} #endif