2 #include "TestClassInterface.hpp"
6 class TestClass : public TestClassInterface {
9 TestClass(int _int, float _float, string _string);
13 void setB(float _float);
14 void setC(string _string);
15 string sumArray(vector<string> newA);
16 //int64_t sumArray(vector<int> newA);
17 int setAndGetA(int newA);
18 int setACAndGetA(string newC, int newA);
19 void registerCallback(CallBackInterface* _cb);
20 void registerCallback(vector<CallBackInterface*> _cb);
27 CallBackInterface *cb;
28 vector<CallBackInterface*> cbvec;
33 TestClass::TestClass() {
39 // cbvec doesn't need to be initialized again
43 TestClass::TestClass(int _int, float _float, string _string) {
49 // cbvec doesn't need to be initialized again
53 void TestClass::setA(int _int) {
59 void TestClass::setB(float _float) {
65 void TestClass::setC(string _string) {
71 string TestClass::sumArray(vector<string> newA) {
74 int len = newA.size();
75 for(int c = 0; c < len; c++) {
82 /*int64_t TestClass::sumArray(vector<int> newA) {
85 int len = newA.size();
86 for(int c = 0; c < len; c++) {
93 int TestClass::setAndGetA(int newA) {
100 int TestClass::setACAndGetA(string newC, int newA) {
108 void TestClass::registerCallback(CallBackInterface* _cb) {
114 void TestClass::registerCallback(vector<CallBackInterface*> _cb) {
116 for (CallBackInterface* cb : _cb) {
118 cout << "Registering callback object!" << endl;
123 //int TestClass::callBack() {
124 // return cb.printInt();
128 int TestClass::callBack() {
131 for (CallBackInterface* cb : cbvec) {
132 sum = sum + cb->printInt();