#include <thread>
#include <chrono>
#include "TestClassInterface.hpp"
+#include "CallBackInterfaceWithCallBack.hpp"
using namespace std;
double getDouble(double in);
bool getBoolean(bool in);
char getChar(char in);
+
+ vector<char> getByteArray(vector<char> in);
+ vector<short> getShortArray(vector<short> in);
+ vector<int64_t> getLongArray(vector<int64_t> in);
+ vector<float> getFloatArray(vector<float> in);
+ vector<double> getDoubleArray(vector<double> in);
+ vector<bool> getBooleanArray(vector<bool> in);
+ vector<char> getCharArray(vector<char> in);
+
+ vector<char> getByteList(vector<char> in);
+ vector<short> getShortList(vector<short> in);
+ vector<int64_t> getLongList(vector<int64_t> in);
+ vector<float> getFloatList(vector<float> in);
+ vector<double> getDoubleList(vector<double> in);
+ vector<bool> getBooleanList(vector<bool> in);
+ vector<char> getCharList(vector<char> in);
+
+ // Callbacks
+ void registerCallback(CallBackInterfaceWithCallBack* _cb);
+ //void registerCallback(vector<CallBackInterfaceWithCallBack*> _cb);
+ int callBack();
+
int getA();
void setA(int _int);
void setB(float _float);
int setACAndGetA(string newC, int newA);
private:
- int intA;
- float floatB;
- string stringC;
+ int intA;
+ float floatB;
+ string stringC;
+ vector<CallBackInterfaceWithCallBack*> cbvec;
};
}
+void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
+
+ cbvec.push_back(_cb);
+ cout << "Registering callback object!" << endl;
+}
+
+
+/*void TestClass::registerCallback(vector<CallBackInterfaceWithCallBack*> _cb) {
+
+ for (CallBackInterface* cb : _cb) {
+ cbvec.push_back(cb);
+ cout << "Registering callback object!" << endl;
+ }
+}*/
+
+
+int TestClass::callBack() {
+
+ int sum = 0;
+ for (CallBackInterfaceWithCallBack* cb : cbvec) {
+ sum = sum + cb->printInt();
+ }
+
+ return sum;
+}
+
+
+// Single variables
char TestClass::getByte(char in) {
return in;
}
+// Arrays
+vector<char> TestClass::getByteArray(vector<char> in) {
+
+ return in;
+}
+
+
+vector<short> TestClass::getShortArray(vector<short> in) {
+
+ return in;
+}
+
+
+vector<int64_t> TestClass::getLongArray(vector<int64_t> in) {
+
+ return in;
+}
+
+
+vector<float> TestClass::getFloatArray(vector<float> in) {
+
+ return in;
+}
+
+
+vector<double> TestClass::getDoubleArray(vector<double> in) {
+
+ return in;
+}
+
+
+vector<bool> TestClass::getBooleanArray(vector<bool> in) {
+
+ return in;
+}
+
+
+vector<char> TestClass::getCharArray(vector<char> in) {
+
+ return in;
+}
+
+// List
+vector<char> TestClass::getByteList(vector<char> in) {
+
+ return in;
+}
+
+
+vector<short> TestClass::getShortList(vector<short> in) {
+
+ return in;
+}
+
+
+vector<int64_t> TestClass::getLongList(vector<int64_t> in) {
+
+ return in;
+}
+
+
+vector<float> TestClass::getFloatList(vector<float> in) {
+
+ return in;
+}
+
+
+vector<double> TestClass::getDoubleList(vector<double> in) {
+
+ return in;
+}
+
+
+vector<bool> TestClass::getBooleanList(vector<bool> in) {
+
+ return in;
+}
+
+
+vector<char> TestClass::getCharList(vector<char> in) {
+
+ return in;
+}
+
+
int TestClass::getA() {
return intA;