void CallbackReceiver::_helpAccountCallbacks(CallbackType t, bool add, const RootSelection *slx) { static const char* mname ("CallbackReceiver::_helpAccountCallbacks"); // TODO: for account deleted, we probably want to // put a callback on the individ accounts, and not use this threshold if(slx) { cwIterator iter; const cwSlist& sel1 = slx->accountList(); const int thresh = callbackReceiverMgr.threshold(); if(sel1.size() > thresh) { std::cout << mname << " " << (add ? "ADD" : "DEL") << " sel1.size (" << sel1.size() << ")" << " exceeds thresh " << thresh << std::endl; if(add) { _addCxxCallback(CallbackReceiverMgr::ALL_OBJECTS, t, &CallbackReceiver::_objectDeletedCbHandler); } else { _delCxxCallback(CallbackReceiverMgr::ALL_OBJECTS, t); } } else { int iterCnt (0); for(iter=sel1.first(); iter; iter=sel1.next(iter), ++iterCnt) { Account *account = sel1.elem(iter); std::cout << mname << " [#" << iterCnt << "]" << " " << (add ? "ADD" : "DEL") << " " << std::hex << (long) account << std::dec << std::endl; // Put the SIMOBJ_ACCOUNT_DELETED callback on the // containing simobj. But don't do any duplicates. SimObj *container = account->getSimObj(); if(add) { rwAssert(container); _addCxxCallback(container, t, &CallbackReceiver::_objectDeletedCbHandler); } else { if (container) _delCxxCallback(container, t); } } } } }