From: Dejan L. <dlo...@us...> - 2004-06-14 11:00:36
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25005 Modified Files: Queue.h Log Message: Added GetMaxSize and SetMaxSize Index: Queue.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/Queue.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Queue.h 13 Jun 2004 13:20:49 -0000 1.1 --- Queue.h 14 Jun 2004 11:00:26 -0000 1.2 *************** *** 69,73 **** * @param sort is order ascendencig or descendencing */ ! Queue(): _count(0), _head(0), _tail(0), _free_func(0), _mutex(0) { } // --------- DESTRUCTORS ----------------------------------- --- 69,73 ---- * @param sort is order ascendencig or descendencing */ ! Queue(): _count(0), _max_size(0), _head(0), _tail(0), _free_func(0), _mutex(0) { } // --------- DESTRUCTORS ----------------------------------- *************** *** 82,86 **** * Returns number of items in the list. */ ! int GetCount() const { return this->_count; } /** --- 82,86 ---- * Returns number of items in the list. */ ! int GetCount() const { return _count; } /** *************** *** 88,92 **** * @return QueueNode pointer to first node in Queue. */ ! QueueNode* GetFirst() const { return this->_head; } /** --- 88,92 ---- * @return QueueNode pointer to first node in Queue. */ ! QueueNode* GetFirst() const { return _head; } /** *************** *** 100,103 **** --- 100,109 ---- Mutex* GetMutex() { return _mutex; } + + /** + * GetMaxSize, Maximum size of Queue, if return value is 0 + * then Queue have no maximum size. + */ + int GetMaxSize() {return _max_size; } // --------- SET METHODS ----------------------------------- *************** *** 113,116 **** --- 119,127 ---- void SetMutex(Mutex* mutex) { _mutex = mutex; } + /** + * Set maximum size for Queue if max_size is 0 then Queue have + * no max size + */ + void SetMaxSize(int max_size) { _max_size = max_size; } // --------- OTHER METHODS --------------------------------- *************** *** 142,162 **** int Contains(void *data) const; - /** - * Returns TRUE if given node is _head node in Queue. - * @param element QueueNode* Node that should be checked. - * @return TRUE if given node is _head node in Queue, FALSE otherwize. - */ - bool IsFirst(const QueueNode* element) const { return ((element == this->_head) ? true : false); } - - /** - * Returns TRUE if given node is _tail node in Queue. - * @param element QueueNode* Node that should be checked. - * @return TRUE if given node oElement is _tail node in Queue, FALSE otherwize. - */ - bool IsLast(const QueueNode* element) const { return ((element->next == 0) ? true : false); } - protected: // Members int _count; /// Size of the list object (how many elements are stored inside) bool _sort; /// How priority queue is sorted QueueNode* _head; /// Pointer to _head element of the List. --- 153,160 ---- int Contains(void *data) const; protected: // Members int _count; /// Size of the list object (how many elements are stored inside) + int _max_size; /// Max size of Queue bool _sort; /// How priority queue is sorted QueueNode* _head; /// Pointer to _head element of the List. |