1 #ifndef _TESTCLASS_HPP__
2 #define _TESTCLASS_HPP__
7 #include "TestClassInterface.hpp"
8 #include "CallBackInterfaceWithCallBack.hpp"
12 class TestClass : public TestClassInterface {
15 TestClass(int _int, float _float, string _string);
17 char getByte(char in);
18 short getShort(short in);
19 int64_t getLong(int64_t in);
20 float getFloat(float in);
21 double getDouble(double in);
22 bool getBoolean(bool in);
23 char getChar(char in);
25 vector<char> getByteArray(vector<char> in);
26 vector<short> getShortArray(vector<short> in);
27 vector<int64_t> getLongArray(vector<int64_t> in);
28 vector<float> getFloatArray(vector<float> in);
29 vector<double> getDoubleArray(vector<double> in);
30 vector<bool> getBooleanArray(vector<bool> in);
31 vector<char> getCharArray(vector<char> in);
33 vector<char> getByteList(vector<char> in);
34 vector<short> getShortList(vector<short> in);
35 vector<int64_t> getLongList(vector<int64_t> in);
36 vector<float> getFloatList(vector<float> in);
37 vector<double> getDoubleList(vector<double> in);
38 vector<bool> getBooleanList(vector<bool> in);
39 vector<char> getCharList(vector<char> in);
42 void registerCallback(CallBackInterfaceWithCallBack* _cb);
43 //void registerCallback(vector<CallBackInterfaceWithCallBack*> _cb);
48 void setB(float _float);
49 void setC(string _string);
50 string sumArray(vector<string> newA);
51 int setAndGetA(int newA);
52 int setACAndGetA(string newC, int newA);
58 vector<CallBackInterfaceWithCallBack*> cbvec;
62 TestClass::TestClass() {
67 // cbvec doesn't need to be initialized again
71 TestClass::TestClass(int _int, float _float, string _string) {
76 // cbvec doesn't need to be initialized again
80 void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
83 cout << "Registering callback object!" << endl;
87 /*void TestClass::registerCallback(vector<CallBackInterfaceWithCallBack*> _cb) {
89 for (CallBackInterface* cb : _cb) {
91 cout << "Registering callback object!" << endl;
96 int TestClass::callBack() {
99 for (CallBackInterfaceWithCallBack* cb : cbvec) {
100 sum = sum + cb->printInt();
108 char TestClass::getByte(char in) {
114 short TestClass::getShort(short in) {
120 int64_t TestClass::getLong(int64_t in) {
126 float TestClass::getFloat(float in) {
132 double TestClass::getDouble(double in) {
138 bool TestClass::getBoolean(bool in) {
144 char TestClass::getChar(char in) {
151 vector<char> TestClass::getByteArray(vector<char> in) {
157 vector<short> TestClass::getShortArray(vector<short> in) {
163 vector<int64_t> TestClass::getLongArray(vector<int64_t> in) {
169 vector<float> TestClass::getFloatArray(vector<float> in) {
175 vector<double> TestClass::getDoubleArray(vector<double> in) {
181 vector<bool> TestClass::getBooleanArray(vector<bool> in) {
187 vector<char> TestClass::getCharArray(vector<char> in) {
193 vector<char> TestClass::getByteList(vector<char> in) {
199 vector<short> TestClass::getShortList(vector<short> in) {
205 vector<int64_t> TestClass::getLongList(vector<int64_t> in) {
211 vector<float> TestClass::getFloatList(vector<float> in) {
217 vector<double> TestClass::getDoubleList(vector<double> in) {
223 vector<bool> TestClass::getBooleanList(vector<bool> in) {
229 vector<char> TestClass::getCharList(vector<char> in) {
235 int TestClass::getA() {
241 void TestClass::setA(int _int) {
247 void TestClass::setB(float _float) {
253 void TestClass::setC(string _string) {
259 string TestClass::sumArray(vector<string> newA) {
262 int len = newA.size();
263 for(int c = 0; c < len; c++) {
270 int TestClass::setAndGetA(int newA) {
277 int TestClass::setACAndGetA(string newC, int newA) {