Adding object ID and tons of minor adjustments for callback support
[iot2.git] / iotjava / iotrmi / C++ / sample / TestClass.cpp
1 #include <iostream>
2 #include <string>
3 #include "TestClass.hpp"
4
5 using namespace std;
6
7 int main(int argc, char *argv[])
8 {
9
10         TestClassInterface *tc = new TestClass();
11         cout << "Return value: " << tc->setAndGetA(123) << endl;
12         cout << "Return value: " << tc->setACAndGetA("string", 123) << endl;
13         vector<string> input;
14         input.push_back("123");
15         input.push_back("456");
16         input.push_back("987");
17         /*vector<int> input;
18         input.push_back(123);
19         input.push_back(456);
20         input.push_back(987);*/
21
22         cout << "Return value: " << tc->sumArray(input) << endl;
23         delete tc;
24
25         vector<CallBackInterface*> test;
26         CallBackInterface *cb1 = new CallBack(12);
27         CallBackInterface *cb2 = new CallBack(22);
28         CallBackInterface *cb3 = new CallBack(32);
29         test.push_back(cb1);
30         test.push_back(cb2);
31         test.push_back(cb3);
32         for (CallBackInterface *cb : test) {
33                 cout << "Test print: " << cb->printInt() << endl;
34         }
35
36         delete cb1;
37         delete cb2;
38         delete cb3;
39
40         return 0;
41 }