Doing the same set of transformations for C++
[iot2.git] / iotjava / iotrmi / C++ / sample / CallBack_CBSkeleton.hpp
index 510ed646e02ec063de5ed64ea3ed8cdbe3d6e434..ffd6c42e75d522711e81396f12835aa9a08a4dda 100644 (file)
@@ -41,7 +41,6 @@ CallBack_CBSkeleton::CallBack_CBSkeleton(CallBackInterface* _cb, int _objectId)
 
        cb = _cb;
        objectId = _objectId;
-       cout << "Creating CallBack_Skeleton and waiting!" << endl;
 }
 
 
@@ -87,15 +86,14 @@ void CallBack_CBSkeleton::___setInt(IoTRMIObject* rmiObj) {
 
 void CallBack_CBSkeleton::invokeMethod(IoTRMIObject* rmiObj) {
 
-       string methodSign = rmiObj->getSignature();
+       int methodId = rmiObj->getMethodId();
        
-       if (methodSign.compare("intprintInt()") == 0) {
-               ___printInt(rmiObj);
-       } else if (methodSign.compare("voidsetInt(int)") == 0) {
-               ___setInt(rmiObj);
-       } else {
-               string error = "Signature not recognized: " + string(methodSign);
-               throw error;
+       switch (methodId) {
+               case 0 : ___printInt(rmiObj); break;
+               case 1 : ___setInt(rmiObj); break;
+               default:
+                       string error = "Method Id not recognized!";
+                       throw error;
        }
 }