X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=blobdiff_plain;f=iotjava%2Fiotrmi%2FC%2B%2B%2Fbasics%2FTestClass.hpp;h=9c466445c85e5bee65f81e71129a70b5c3235c25;hp=f2951ba653a1baf5dc442a2f1d5341e7108436bc;hb=03f1eb47b4b938ab05001122a0010bf8c07de338;hpb=38523cbbcc710ff7413e8b5d85df402aa109bd13 diff --git a/iotjava/iotrmi/C++/basics/TestClass.hpp b/iotjava/iotrmi/C++/basics/TestClass.hpp index f2951ba..9c46644 100644 --- a/iotjava/iotrmi/C++/basics/TestClass.hpp +++ b/iotjava/iotrmi/C++/basics/TestClass.hpp @@ -48,11 +48,15 @@ class TestClass : public TestClassInterface { Enum handleEnum(Enum en); vector handleEnumArray(vector vecEn); vector handleEnumList(vector vecEn); + Enum handleEnumComplex(Enum en, int i, char c); + vector handleEnumComplex2(vector en, int i, char c); // Struct Struct handleStruct(Struct str); vector handleStructArray(vector vecStr); vector handleStructList(vector vecStr); + Struct handleStructComplex(int in, char c, Struct str); + vector handleStructComplex2(int in, char c, vector vecStr); int getA(); void setA(int _int); @@ -305,6 +309,29 @@ vector TestClass::handleEnumList(vector 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 TestClass::handleEnumComplex2(vector 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 TestClass::handleStructList(vector 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 TestClass::handleStructComplex2(int in, char c, vector 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 newA) { string sum = "";