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