3 #include "TestClass_Stub.hpp"
4 #include "CallBack.hpp"
8 static exception_ptr teptr = nullptr;
10 int main(int argc, char *argv[])
14 const char* address = "localhost";
18 ports.push_back(12345);
19 //ports.push_back(13234);
21 TestClassInterface *tcStub = new TestClass_Stub(port, address, rev, &bResult, ports);
22 cout << "Return value: " << tcStub->setAndGetA(123) << endl;
23 cout << "Return value: " << tcStub->setACAndGetA("string", 123) << endl;
25 input.push_back("123");
26 input.push_back("456");
27 input.push_back("987");
31 input.push_back(987);*/
33 cout << "Return value: " << tcStub->sumArray(input) << endl;
35 CallBackInterface *cb1 = new CallBack(23);
36 CallBackInterface *cb2 = new CallBack(33);
37 CallBackInterface *cb3 = new CallBack(43);
38 vector<CallBackInterface*> cb;
42 tcStub->registerCallback(cb);
43 CallBackInterface *cb4 = new CallBack(53);
44 CallBackInterface *cb5 = new CallBack(63);
45 CallBackInterface *cb6 = new CallBack(73);
46 vector<CallBackInterface*> cbsec;
50 tcStub->registerCallback(cbsec);
51 cout << "Return value from callback: " << tcStub->callBack() << endl;
56 testdata.name = "Rahmadi";
57 testdata.value = 0.123;
61 testdata2.name = "Trimananda";
62 testdata2.value = 0.223;
63 testdata2.year = 2017;
65 dataset.push_back(testdata);
66 dataset.push_back(testdata2);
68 vector<data> result = tcStub->handleStruct(dataset);
69 for (data dt : result) {
70 cout << dt.name << " ";
71 cout << dt.value << " ";
72 cout << dt.year << endl;
75 /* vector<EnumC> vecEn;
76 vecEn.push_back(APPLE);
77 vecEn.push_back(ORANGE);
78 vecEn.push_back(APPLE);
79 vecEn.push_back(GRAPE);
80 vector<EnumC> vecRes = tcStub->handleEnum(vecEn);
81 for (EnumC en : vecRes) {
82 cout << "EnumC: " << en << endl;