X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=blobdiff_plain;f=version2%2Fsrc%2FC%2FLocalComm.h;h=8780dc040bec8f401f091e053041f741d2e54f6b;hp=10c90b054fc6bd09212019676bf14a76007d2e47;hb=0a73089b732948a43f9d29fef2eee4754ecad54c;hpb=0b9aca2b62c74f68652b170a92271a98d5b96666 diff --git a/version2/src/C/LocalComm.h b/version2/src/C/LocalComm.h index 10c90b0..8780dc0 100644 --- a/version2/src/C/LocalComm.h +++ b/version2/src/C/LocalComm.h @@ -1,24 +1,18 @@ +#ifndef LOCALCOMM_H +#define LOCALCOMM_H +#include "common.h" class LocalComm { - private Table t1; - private Table t2; +private: + Table *t1; + Table *t2; - public LocalComm(Table _t1, Table _t2) { - t1 = _t1; - t2 = _t2; +public: + LocalComm(Table *_t1, Table *_t2) : + t1(_t1), + t2(_t2) { } - public char[] sendDataToLocalDevice(Long deviceId, char[] 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]; - } -} + public Array *sendDataToLocalDevice(int64_t deviceId, Array *data); +}; +#endif