#include <PageInfo.h>
Public Member Functions | |
TodoList () | |
~TodoList () | |
void | clear () |
void | pushItem (TodoItem *item, GBool bHead=gFalse, GBool bRemoveDup=gTrue) |
TodoItem * | popItem () |
Private Member Functions | |
void | initialize () |
void | removeDup (TodoItem *item) |
Private Attributes | |
pthread_mutex_t | mutex |
GooList * | list |
Definition at line 120 of file PageInfo.h.
TodoList::TodoList | ( | ) |
Definition at line 296 of file PageInfo.cpp.
00297 { 00298 initialize(); 00299 }
TodoList::~TodoList | ( | ) |
void TodoList::initialize | ( | ) | [private] |
void TodoList::removeDup | ( | TodoItem * | item | ) | [private] |
Definition at line 326 of file PageInfo.cpp.
00327 { 00328 int i = 0, length = list->getLength(); 00329 TodoItem * p = NULL; 00330 while (i < length) 00331 { 00332 p = (TodoItem *)list->get(i); 00333 if ( p && item && p->pageNumber == item->pageNumber && item->timeStamp > p->timeStamp) 00334 { 00335 // PV_LOGPRINTF("Remove duplicated item %d", item->pageNumber); 00336 list->del(i); --length; 00337 } 00338 else 00339 { 00340 ++i; 00341 } 00342 } 00343 }
void TodoList::clear | ( | ) |
void TodoList::pushItem | ( | TodoItem * | item, | |
GBool | bHead = gFalse , |
|||
GBool | bRemoveDup = gTrue | |||
) |
Definition at line 345 of file PageInfo.cpp.
00346 { 00347 if (NULL == item) return; 00348 pthread_mutex_lock(&mutex); 00349 00350 if (bRemoveDup) 00351 { 00352 removeDup(item); 00353 } 00354 if (bHead) 00355 { 00356 list->insert(0, item); 00357 } 00358 else 00359 { 00360 list->append(item); 00361 } 00362 pthread_mutex_unlock(&mutex); 00363 }
TodoItem * TodoList::popItem | ( | ) |
pthread_mutex_t TodoList::mutex [private] |
Definition at line 123 of file PageInfo.h.
GooList* TodoList::list [private] |
Definition at line 124 of file PageInfo.h.