1 #ifndef _TESTCLASS_HPP__
2 #define _TESTCLASS_HPP__
7 #include "TestClassInterface.hpp"
11 class TestClass : public TestClassInterface {
14 TestClass(int _int, float _float, string _string);
16 char getByte(char in);
17 short getShort(short in);
18 int64_t getLong(int64_t in);
19 float getFloat(float in);
20 double getDouble(double in);
21 bool getBoolean(bool in);
22 char getChar(char in);
24 vector<char> getByteArray(vector<char> in);
25 vector<short> getShortArray(vector<short> in);
26 vector<int64_t> getLongArray(vector<int64_t> in);
27 vector<float> getFloatArray(vector<float> in);
28 vector<double> getDoubleArray(vector<double> in);
29 vector<bool> getBooleanArray(vector<bool> in);
30 vector<char> getCharArray(vector<char> in);
32 vector<char> getByteList(vector<char> in);
33 vector<short> getShortList(vector<short> in);
34 vector<int64_t> getLongList(vector<int64_t> in);
35 vector<float> getFloatList(vector<float> in);
36 vector<double> getDoubleList(vector<double> in);
37 vector<bool> getBooleanList(vector<bool> in);
38 vector<char> getCharList(vector<char> in);
41 void registerCallback(CallBackInterface* _cb);
42 //void registerCallback(vector<CallBackInterface*> _cb);
47 void setB(float _float);
48 void setC(string _string);
49 string sumArray(vector<string> newA);
50 int setAndGetA(int newA);
51 int setACAndGetA(string newC, int newA);
57 vector<CallBackInterface*> cbvec;
61 TestClass::TestClass() {
66 // cbvec doesn't need to be initialized again
70 TestClass::TestClass(int _int, float _float, string _string) {
75 // cbvec doesn't need to be initialized again
79 void TestClass::registerCallback(CallBackInterface* _cb) {
82 cout << "Registering callback object!" << endl;
86 /*void TestClass::registerCallback(vector<CallBackInterface*> _cb) {
88 for (CallBackInterface* cb : _cb) {
90 cout << "Registering callback object!" << endl;
95 int TestClass::callBack() {
98 for (CallBackInterface* cb : cbvec) {
99 sum = sum + cb->printInt();
107 char TestClass::getByte(char in) {
113 short TestClass::getShort(short in) {
119 int64_t TestClass::getLong(int64_t in) {
125 float TestClass::getFloat(float in) {
131 double TestClass::getDouble(double in) {
137 bool TestClass::getBoolean(bool in) {
143 char TestClass::getChar(char in) {
150 vector<char> TestClass::getByteArray(vector<char> in) {
156 vector<short> TestClass::getShortArray(vector<short> in) {
162 vector<int64_t> TestClass::getLongArray(vector<int64_t> in) {
168 vector<float> TestClass::getFloatArray(vector<float> in) {
174 vector<double> TestClass::getDoubleArray(vector<double> in) {
180 vector<bool> TestClass::getBooleanArray(vector<bool> in) {
186 vector<char> TestClass::getCharArray(vector<char> in) {
192 vector<char> TestClass::getByteList(vector<char> in) {
198 vector<short> TestClass::getShortList(vector<short> in) {
204 vector<int64_t> TestClass::getLongList(vector<int64_t> in) {
210 vector<float> TestClass::getFloatList(vector<float> in) {
216 vector<double> TestClass::getDoubleList(vector<double> in) {
222 vector<bool> TestClass::getBooleanList(vector<bool> in) {
228 vector<char> TestClass::getCharList(vector<char> in) {
234 int TestClass::getA() {
240 void TestClass::setA(int _int) {
246 void TestClass::setB(float _float) {
252 void TestClass::setC(string _string) {
258 string TestClass::sumArray(vector<string> newA) {
261 int len = newA.size();
262 for(int c = 0; c < len; c++) {
269 int TestClass::setAndGetA(int newA) {
276 int TestClass::setACAndGetA(string newC, int newA) {