X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=blobdiff_plain;f=version2%2Fsrc%2FC%2FLocalComm.cc;h=18ba37fa6efe64bd34cbb480c38bc910127e38c0;hp=9a18ee0968040061ea6135a723dfa07e1567b660;hb=0a73089b732948a43f9d29fef2eee4754ecad54c;hpb=bd73414f3ef76dbb9d060e67b6d31f32278b2ffb;ds=sidebyside diff --git a/version2/src/C/LocalComm.cc b/version2/src/C/LocalComm.cc index 9a18ee0..18ba37f 100644 --- a/version2/src/C/LocalComm.cc +++ b/version2/src/C/LocalComm.cc @@ -1,24 +1,14 @@ - -class LocalComm { - Table t1; - Table t2; - - LocalComm(Table _t1, Table _t2) { - t1 = _t1; - t2 = _t2; +#include "LocalComm.h" +Array *LocalComm::sendDataToLocalDevice(int64_t deviceId, Array *data) throws InterruptedException { + printf("Passing Locally\n"); + + if (deviceId == t1->getMachineId()) { + // return t1.localCommInput(data); + } else if (deviceId == t2->getMachineId()) { + // return t2.localCommInput(data); + } else { + throw new Error("Cannot send to " + deviceId + " using this local comm"); } - Array *sendDataToLocalDevice(Long deviceId, Array *data) throws InterruptedException { - System.out.println("Passing Locally"); - - if (deviceId == t1.getMachineId()) { - // return t1.localCommInput(data); - } else if (deviceId == t2.getMachineId()) { - // return t2.localCommInput(data); - } else { - throw new Error("Cannot send to " + deviceId + " using this local comm"); - } - - return new char[0]; - } + return new char[0]; }