Integrating enum and struct in one method call; fixing minor bugs
[iot2.git] / iotjava / iotrmi / C++ / basics / TestClass.hpp
index fa9b877e3df4c6bc3995992a6c092a2053c6bd11..f33dbf28b97c95294af1ad4d9e8632d4ede57d85 100644 (file)
@@ -59,6 +59,9 @@ class TestClass : public TestClassInterface {
                Struct                          handleStructComplex(int in, char c, Struct str);
                vector<Struct>          handleStructComplex2(int in, char c, vector<Struct> vecStr);
 
+               vector<Enum>            handleEnumStruct(vector<Enum> en, vector<Struct> str, char c);
+               vector<Enum>            handleAll(vector<Enum> en, vector<Struct> str, char c, vector<CallBackInterfaceWithCallBack*> _cb);
+
                int                                     getA();
                void                            setA(int _int);
                void                            setB(float _float);
@@ -432,6 +435,39 @@ vector<Struct> TestClass::handleStructComplex2(int in, char c, vector<Struct> ve
 }
 
 
+vector<Enum> TestClass::handleEnumStruct(vector<Enum> en, vector<Struct> str, char c) {
+
+       for (Struct st : str) {
+               cout << "Name: " << st.name << endl;
+               cout << "Value: " << st.value << endl;
+               cout << "Year: " << st.year << endl;
+       }
+
+       cout << "Char: " << c << endl;
+
+       return en;
+}
+
+
+vector<Enum> TestClass::handleAll(vector<Enum> en, vector<Struct> str, char c, vector<CallBackInterfaceWithCallBack*> _cb) {
+
+       for (CallBackInterfaceWithCallBack* cb : _cb) {
+               cbvec.push_back(cb);
+               cout << "Registering callback object in array!" << endl;
+       }
+
+       for (Struct st : str) {
+               cout << "Name: " << st.name << endl;
+               cout << "Value: " << st.value << endl;
+               cout << "Year: " << st.year << endl;
+       }
+
+       cout << "Char: " << c << endl;
+
+       return en;
+}
+
+
 string TestClass::sumArray(vector<string> newA) {
 
        string sum = "";