Testing more complex struct and enum declarations; fixing subtle bugs
[iot2.git] / iotjava / iotrmi / C++ / basics / TestClass.hpp
index f2951ba653a1baf5dc442a2f1d5341e7108436bc..9c466445c85e5bee65f81e71129a70b5c3235c25 100644 (file)
@@ -48,11 +48,15 @@ class TestClass : public TestClassInterface {
                Enum                            handleEnum(Enum en);
                vector<Enum>            handleEnumArray(vector<Enum> vecEn);
                vector<Enum>            handleEnumList(vector<Enum> vecEn);
+               Enum                            handleEnumComplex(Enum en, int i, char c);
+               vector<Enum>            handleEnumComplex2(vector<Enum> en, int i, char c);
 
                // Struct
                Struct                          handleStruct(Struct str);
                vector<Struct>          handleStructArray(vector<Struct> vecStr);
                vector<Struct>          handleStructList(vector<Struct> vecStr);
+               Struct                          handleStructComplex(int in, char c, Struct str);
+               vector<Struct>          handleStructComplex2(int in, char c, vector<Struct> vecStr);
 
                int                                     getA();
                void                            setA(int _int);
@@ -305,6 +309,29 @@ vector<Enum> TestClass::handleEnumList(vector<Enum> vecEn) {
 }
 
 
+Enum TestClass::handleEnumComplex(Enum en, int i, char c) {
+
+       cout << "Enum: " << en << endl;
+       cout << "Integer: " << i << endl;
+       cout << "Char: " << c << endl;
+       
+       return en;
+}
+
+
+vector<Enum> TestClass::handleEnumComplex2(vector<Enum> vecEn, int in, char c) {
+
+       for (Enum en : vecEn) {
+               cout << "Enum: " << en << endl;
+       }
+       cout << "Integer: " << in << endl;
+       cout << "Char: " << c << endl;
+       
+       return vecEn;
+}
+
+
+
 // Struct
 Struct TestClass::handleStruct(Struct str) {
 
@@ -358,6 +385,40 @@ vector<Struct> TestClass::handleStructList(vector<Struct> vecStr) {
 }
 
 
+Struct TestClass::handleStructComplex(int in, char c, Struct str) {
+
+       cout << "Name: " << str.name << endl;
+       cout << "Value: " << str.value << endl;
+       cout << "Year: " << str.year << endl;
+
+       cout << "Integer: " << in << endl;
+       cout << "Char: " << c << endl;
+
+       Struct test;
+       test.name = "Anonymous";
+       test.value = 1.33;
+       test.year = 2016;
+       str = test;
+
+       return str;
+}
+
+
+vector<Struct> TestClass::handleStructComplex2(int in, char c, vector<Struct> vecStr) {
+
+       for (Struct str : vecStr) {
+               cout << "Name: " << str.name << endl;
+               cout << "Value: " << str.value << endl;
+               cout << "Year: " << str.year << endl;
+       }
+
+       cout << "Integer: " << in << endl;
+       cout << "Char: " << c << endl;
+
+       return vecStr;
+}
+
+
 string TestClass::sumArray(vector<string> newA) {
 
        string sum = "";