Tested C++ RPS/RMI libraries for arbitrary objects and arbitrary remote calls
[iot2.git] / iotjava / iotrmi / C++ / basics / TestClass.hpp
index e4918b58209319c26703bd3aae0ebaf6dac56811..ca963490351ab0ad57adc281a7f45d58588ebda8 100644 (file)
@@ -105,13 +105,6 @@ TestClass::TestClass(int _int, float _float, string _string) {
 }
 
 
-void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
-
-       cbvec.push_back(_cb);
-       cout << "Registering callback object!" << endl;
-}
-
-
 void TestClass::registerCallbackArray(vector<CallBackInterfaceWithCallBack*> _cb) {
 
        for (CallBackInterfaceWithCallBack* cb : _cb) {
@@ -142,13 +135,26 @@ void TestClass::registerCallbackComplex(int in, vector<CallBackInterfaceWithCall
 }
 
 
+void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
+
+       cbvec.push_back(_cb);
+       cout << "Registering callback object!" << endl;
+}
+
+
 int TestClass::callBack() {
 
        int sum = 0;
        for (CallBackInterfaceWithCallBack* cb : cbvec) {
-               //cb->needCallback(this);
+               //cout << "Sum: " << sum << endl;
                sum = sum + cb->printInt();
+               cb->needCallback(this);
+               //cb->needCallback(this);
+               TestClass* tc = new TestClass();
+               cb->needCallback(tc);
+               //cout << "Sum after: " << sum << endl;
        }
+       cout << "About to return sum: " << sum << endl;
 
        return sum;
 }