Removing printing statements from C++ RMI library - this will cause SO files to get...
[iot2.git] / iotjava / iotrmi / C++ / sample / TestClass.hpp
index fb9c05406561d329c9b16987d226c34b4c2897aa..fe13e6e11c305e6ce8242264ec77c82e19cc021a 100644 (file)
@@ -25,7 +25,7 @@ class TestClass : public TestClassInterface {
                void                            registerCallback(CallBackInterface* _cb);
                void                            registerCallback(vector<CallBackInterface*> _cb);
                int                                     callBack();
-               void                            handleStruct(vector<data> vecData);
+               vector<data>            handleStruct(vector<data> vecData);
                vector<EnumC>           handleEnum(vector<EnumC> vecEn);
 
                void                            thread1();
@@ -131,7 +131,7 @@ void TestClass::registerCallback(vector<CallBackInterface*> _cb) {
 }
 
 
-void TestClass::handleStruct(vector<data> vecData) {
+vector<data> TestClass::handleStruct(vector<data> vecData) {
 
        for (data dat : vecData) {
 
@@ -139,6 +139,13 @@ void TestClass::handleStruct(vector<data> vecData) {
                cout << "Value: " << dat.value << endl;
                cout << "Year: " << dat.year << endl;
        }
+       data newData;
+       newData.name = "Anonymous";
+       newData.value = 1.33;
+       newData.year = 2016;
+       vecData.push_back(newData);
+
+       return vecData;
 }
 
 
@@ -176,19 +183,19 @@ void TestClass::thread2() {
 
 int TestClass::callBack() {
 
-       /*int sum = 0;
+       int sum = 0;
        for (CallBackInterface* cb : cbvec) {
                sum = sum + cb->printInt();
        }
 
-       return sum;*/
-       thread th1 (&TestClass::thread1, this);
+       return sum;
+/*     thread th1 (&TestClass::thread1, this);
        thread th2 (&TestClass::thread2, this);
 
        th1.join();
        th2.join();
 
-       return 1;
+       return 1;*/
 }
 
 #endif