class IoTRMIObject {
public:
- IoTRMIObject(int _port, bool* _bResult, const string _methodSign[], const int _size);
+ IoTRMIObject(int _port, bool* _bResult);
~IoTRMIObject();
// Public methods
void sendReturnObj(void* retObj, string type);
void setMethodBytes(char* _methodBytes);
int getObjectId();
static int getObjectId(char* methodBytes);
- string getSignature();
+ int getMethodId();
void** getMethodParams(string paramCls[], int numParam, void* paramObj[]);
private:
- map<int,string> mapMethodId2Sign;
+ //map<int,string> mapMethodId2Sign;
IoTRMIUtil *rmiUtil;
IoTSocketServer *rmiServer;
char* methodBytes;
// Constructor
-IoTRMIObject::IoTRMIObject(int _port, bool* _bResult, const string _methodSign[], const int _size) {
+IoTRMIObject::IoTRMIObject(int _port, bool* _bResult) {
rmiUtil = new IoTRMIUtil();
if (rmiUtil == NULL) {
methodBytes = NULL;
methodLen = 0;
- getMethodIds(_methodSign, _size);
+ //getMethodIds(_methodSign, _size);
rmiServer = new IoTSocketServer(_port, _bResult);
if (rmiServer == NULL) {
// Set method bytes
-void IoTRMIObject::setMethodBytes(char* _methodBytes) {
+/*void IoTRMIObject::setMethodBytes(char* _methodBytes) {
// Set method bytes
methodBytes = _methodBytes;
-}
+}*/
-// Get signature from the method-Id-to-method-signature map
-string IoTRMIObject::getSignature() {
+// Get methodId
+int IoTRMIObject::getMethodId() {
// Get method Id
char methodIdBytes[IoTRMIUtil::METHOD_ID_LEN];
int methodId = 0;
IoTRMIUtil::byteArrayToInt(&methodId, methodIdBytes);
- return mapMethodId2Sign.find(methodId)->second;
+ return methodId;
}
}
-// *************
-// Helpers
-// *************
-void IoTRMIObject::getMethodIds(const string methodSign[], const int size) {
-
- for(int i = 0; i < size; i++) {
- mapMethodId2Sign[i] = methodSign[i];
- }
-}
-
-
#endif