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);
47 Enum handleEnum(Enum en);
51 void setB(float _float);
52 void setC(string _string);
53 string sumArray(vector<string> newA);
54 int setAndGetA(int newA);
55 int setACAndGetA(string newC, int newA);
61 vector<CallBackInterfaceWithCallBack*> cbvec;
65 TestClass::TestClass() {
70 // cbvec doesn't need to be initialized again
74 TestClass::TestClass(int _int, float _float, string _string) {
79 // cbvec doesn't need to be initialized again
83 void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
86 cout << "Registering callback object!" << endl;
90 /*void TestClass::registerCallback(vector<CallBackInterfaceWithCallBack*> _cb) {
92 for (CallBackInterface* cb : _cb) {
94 cout << "Registering callback object!" << endl;
99 int TestClass::callBack() {
102 for (CallBackInterfaceWithCallBack* cb : cbvec) {
103 sum = sum + cb->printInt();
111 char TestClass::getByte(char in) {
117 short TestClass::getShort(short in) {
123 int64_t TestClass::getLong(int64_t in) {
129 float TestClass::getFloat(float in) {
135 double TestClass::getDouble(double in) {
141 bool TestClass::getBoolean(bool in) {
147 char TestClass::getChar(char in) {
154 vector<char> TestClass::getByteArray(vector<char> in) {
160 vector<short> TestClass::getShortArray(vector<short> in) {
166 vector<int64_t> TestClass::getLongArray(vector<int64_t> in) {
172 vector<float> TestClass::getFloatArray(vector<float> in) {
178 vector<double> TestClass::getDoubleArray(vector<double> in) {
184 vector<bool> TestClass::getBooleanArray(vector<bool> in) {
190 vector<char> TestClass::getCharArray(vector<char> in) {
196 vector<char> TestClass::getByteList(vector<char> in) {
202 vector<short> TestClass::getShortList(vector<short> in) {
208 vector<int64_t> TestClass::getLongList(vector<int64_t> in) {
214 vector<float> TestClass::getFloatList(vector<float> in) {
220 vector<double> TestClass::getDoubleList(vector<double> in) {
226 vector<bool> TestClass::getBooleanList(vector<bool> in) {
232 vector<char> TestClass::getCharList(vector<char> in) {
238 int TestClass::getA() {
244 void TestClass::setA(int _int) {
250 void TestClass::setB(float _float) {
256 void TestClass::setC(string _string) {
263 Enum TestClass::handleEnum(Enum en) {
265 cout << "Enum: " << en << endl;
271 /*vector<EnumC> TestClass::handleEnum(vector<EnumC> vecEn) {
273 for (EnumC en : vecEn) {
274 cout << "Enum: " << en << endl;
281 string TestClass::sumArray(vector<string> newA) {
284 int len = newA.size();
285 for(int c = 0; c < len; c++) {
292 int TestClass::setAndGetA(int newA) {
299 int TestClass::setACAndGetA(string newC, int newA) {