Doing the same set of transformations for C++
[iot2.git] / iotjava / iotrmi / C++ / IoTRMIObject.hpp
index 830be11bdb2d8b087e9c6b008187363e1d2e18c5..6cffb4ee4d52665f7bb244733952bf8b69c014c4 100644 (file)
@@ -22,7 +22,7 @@ using namespace std;
 
 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);
@@ -31,11 +31,11 @@ class IoTRMIObject {
                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;
@@ -47,7 +47,7 @@ class IoTRMIObject {
 
 
 // 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) {
@@ -56,7 +56,7 @@ IoTRMIObject::IoTRMIObject(int _port, bool* _bResult, const string _methodSign[]
 
        methodBytes = NULL;
        methodLen = 0;
-       getMethodIds(_methodSign, _size);
+       //getMethodIds(_methodSign, _size);
 
        rmiServer = new IoTSocketServer(_port, _bResult);
        if (rmiServer == NULL) {
@@ -147,15 +147,15 @@ int IoTRMIObject::getObjectId(char* methodBytes) {
 
 
 // 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];
@@ -164,7 +164,7 @@ string IoTRMIObject::getSignature() {
        int methodId = 0;
        IoTRMIUtil::byteArrayToInt(&methodId, methodIdBytes);
        
-       return mapMethodId2Sign.find(methodId)->second;
+       return methodId;
 }
 
 
@@ -202,17 +202,6 @@ void** IoTRMIObject::getMethodParams(string paramCls[], int numParam, void* para
 }
 
 
-// *************
-//    Helpers
-// *************
-void IoTRMIObject::getMethodIds(const string methodSign[], const int size) {
-
-       for(int i = 0; i < size; i++) {
-               mapMethodId2Sign[i] = methodSign[i];
-       }
-}
-
-
 #endif