int GroupTagSubscription::getHistoryRequest (const char * pszGroupName, PtrLList<HistoryRequest> &historyRequest) { UInt32Hashtable<TagInfo>::Iterator i = _ui16Tags.getAllElements(); TagInfo *pTI; History *pHistory; while (!i.end()) { pTI = i.getValue(); pHistory = pTI->pHistory; if (pHistory) { if (pHistory->isExpired()) { delete pHistory; pHistory = NULL; } else { HistoryRequestGroupTag * pReq = new HistoryRequestGroupTag; pReq->_pHistory = pTI->pHistory; pReq->_pszGroupName = pszGroupName; pReq->_ui16Tag = (uint16) i.getKey(); historyRequest.prepend(pReq); } } i.nextElement(); } return 0; }
bool GroupTagSubscription::hasHistory() { UInt32Hashtable<TagInfo>::Iterator i = _ui16Tags.getAllElements(); TagInfo *pTI; History *pHistory; while (!i.end()) { pTI = i.getValue(); pHistory = pTI->pHistory; if (pHistory) { if (pHistory->isExpired()) { delete pHistory; pHistory = NULL; } else { return true; } } i.nextElement(); } return false; }