}
-void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
-
- cbvec.push_back(_cb);
- cout << "Registering callback object!" << endl;
-}
-
-
void TestClass::registerCallbackArray(vector<CallBackInterfaceWithCallBack*> _cb) {
for (CallBackInterfaceWithCallBack* cb : _cb) {
}
+void TestClass::registerCallback(CallBackInterfaceWithCallBack* _cb) {
+
+ cbvec.push_back(_cb);
+ cout << "Registering callback object!" << endl;
+}
+
+
int TestClass::callBack() {
int sum = 0;
for (CallBackInterfaceWithCallBack* cb : cbvec) {
- //cb->needCallback(this);
+ //cout << "Sum: " << sum << endl;
sum = sum + cb->printInt();
+ cb->needCallback(this);
+ //cb->needCallback(this);
+ TestClass* tc = new TestClass();
+ cb->needCallback(tc);
+ //cout << "Sum after: " << sum << endl;
}
+ cout << "About to return sum: " << sum << endl;
return sum;
}