152 virtual PINDEX Append(
168 virtual PINDEX Insert(
180 virtual PINDEX InsertAt(
260 virtual PINDEX GetObjectsIndex(
272 virtual PINDEX GetValuesIndex(
348 class iterator_base :
public std::iterator<std::bidirectional_iterator_tag, T> {
372 T & operator* ()
const {
return *iterator_base::Ptr(); }
375 iterator
begin() {
return info->head; }
376 iterator
end() {
return iterator(); }
378 iterator
rend() {
return iterator(); }
390 const T *
operator->()
const {
return iterator_base::Ptr(); }
391 const T & operator* ()
const {
return *iterator_base::Ptr(); }
394 const_iterator
begin()
const {
return info->head; }
395 const_iterator
end()
const {
return const_iterator(); }
396 const_iterator
rbegin()
const {
return info->tail; }
397 const_iterator
rend()
const {
return iterator(); }
401 void erase(
const iterator & it) { Remove(&*it); }
402 void erase(
const const_iterator & it) { Remove(&*it); }
422 )
const {
return (T &)GetReferenceAt(index); }
442 #define PLIST(cls, T) typedef PList<T> cls 455 #define PDECLARE_LIST(cls, T) \ 456 PLIST(cls##_PTemplate, T); \ 457 PDECLARE_CLASS(cls, PList<T>) \ 459 cls(int dummy, const cls * c) \ 460 : PList<T>(dummy, c) { } \ 464 virtual PObject * Clone() const \ 465 { return PNEW cls(0, this); } \ 542 #define PQUEUE(cls, T) typedef PQueue<T> cls 557 #define PDECLARE_QUEUE(cls, T) \ 558 PQUEUE(cls##_PTemplate, T); \ 559 PDECLARE_CLASS(cls, cls##_PTemplate) \ 561 cls(int dummy, const cls * c) \ 562 : cls##_PTemplate(dummy, c) { } \ 565 : cls##_PTemplate() { } \ 566 virtual PObject * Clone() const \ 567 { return PNEW cls(0, this); } \ 655 #define PSTACK(cls, T) typedef PStack<T> cls 670 #define PDECLARE_STACK(cls, T) \ 671 PSTACK(cls##_PTemplate, T); \ 672 PDECLARE_CLASS(cls, cls##_PTemplate) \ 674 cls(int dummy, const cls * c) \ 675 : cls##_PTemplate(dummy, c) { } \ 678 : cls##_PTemplate() { } \ 679 virtual PObject * Clone() const \ 680 { return PNEW cls(0, this); } \ 693 enum {
Red, Black } colour;
810 virtual PINDEX Append(
823 virtual PINDEX Insert(
837 virtual PINDEX InsertAt(
875 virtual void RemoveAll();
909 virtual PINDEX GetObjectsIndex(
912 virtual PINDEX GetObjectsIndex(
925 virtual PINDEX GetValuesIndex(
937 void LeftRotate(Element * node);
938 void RightRotate(Element * node);
939 void DeleteSubTrees(Element * node,
PBoolean deleteObject);
940 PINDEX ValueSelect(
const Element * node,
const PObject & obj,
const Element ** lastElement)
const;
993 )
const {
return *(T *)GetAt(index); }
1013 #define PSORTED_LIST(cls, T) typedef PSortedList<T> cls 1028 #define PDECLARE_SORTED_LIST(cls, T) \ 1029 PSORTED_LIST(cls##_PTemplate, T); \ 1030 PDECLARE_CLASS(cls, PSortedList<T>) \ 1032 cls(int dummy, const cls * c) \ 1033 : PSortedList<T>(dummy, c) { } \ 1036 : PSortedList<T>() { } \ 1037 virtual PObject * Clone() const \ 1038 { return PNEW cls(0, this); } \ 1041 #endif // PTLIB_LISTS_H PListInfo * info
Definition: lists.h:311
virtual PObject * Clone() const
Make a complete duplicate of the list.
Definition: lists.h:975
virtual T & Top()
Get the element that is currently on top of the stack without removing it.
Definition: lists.h:632
iterator end()
Definition: lists.h:376
virtual PObject * Clone() const
Make a complete duplicate of the list.
Definition: lists.h:502
const T * operator->() const
Definition: lists.h:390
PSortedListElement * left
Definition: lists.h:689
PSortedListElement Element
Definition: lists.h:711
T * operator->() const
Definition: lists.h:371
bool operator==(const iterator_base &it) const
Definition: lists.h:358
PQueue(int dummy, const PQueue *c)
Definition: lists.h:524
PSortedListElement * root
Definition: lists.h:702
iterator rbegin()
Definition: lists.h:377
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
const_iterator operator--()
Definition: lists.h:386
T * Ptr() const
Definition: lists.h:355
iterator(PListElement *e=NULL)
Definition: lists.h:364
iterator rend()
Definition: lists.h:378
T value_type
Definition: lists.h:404
#define PINLINE
Definition: object.h:127
iterator operator++()
Definition: lists.h:366
const_iterator operator++(int)
Definition: lists.h:387
PSortedList()
Create a new, empty, sorted list.
Definition: lists.h:966
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
PSortedList(int dummy, const PSortedList *c)
Definition: lists.h:997
A Pop() was made of a stack with no elements.
Definition: object.h:157
PSortedListInfo * info
Definition: lists.h:943
iterator_base(PListElement *e)
Definition: lists.h:350
const_iterator(PListElement *e=NULL)
Definition: lists.h:383
virtual PObject * Clone() const
Make a complete duplicate of the stack.
Definition: lists.h:604
void Next()
Definition: lists.h:353
void erase(const iterator &it)
Definition: lists.h:401
PListElement Element
Definition: lists.h:310
virtual PINDEX Append(PObject *obj)
Append a new object to the collection.
virtual PINDEX InsertAt(PINDEX index, PObject *obj)
Insert a new object at the specified ordinal index.
PQueue()
Create a new, empty, queue.
Definition: lists.h:493
PList()
Create a new, empty, list.
Definition: lists.h:333
This template class maps the PAbstractList to a specific object type.
Definition: lists.h:321
const_iterator begin() const
Definition: lists.h:394
PListInfo()
Definition: lists.h:57
BOOL PBoolean
Definition: object.h:102
PDECLARE_POOL_ALLOCATOR()
virtual T * Dequeue()
Remove an object that was added to the queue.
Definition: lists.h:519
iterator operator--()
Definition: lists.h:367
virtual void Enqueue(T *obj)
Add a new object to the queue.
Definition: lists.h:511
const_iterator operator--(int)
Definition: lists.h:388
PList(int dummy, const PList *c)
Definition: lists.h:426
virtual T * Pop()
Remove the last object pushed onto the stack.
Definition: lists.h:623
PSortedListElement nil
Definition: lists.h:705
virtual PObject * RemoveAt(PINDEX index)
Remove the object at the specified ordinal index from the collection.
bool operator!=(const iterator_base &it) const
Definition: lists.h:359
#define PAssertNULL(ptr)
This macro is used to assert that a pointer must be non-null.
Definition: object.h:220
virtual void Push(T *obj)
Add an object to the stack.
Definition: lists.h:614
This class is a collection of objects which are descendents of the PObject class. ...
Definition: lists.h:84
void erase(const const_iterator &it)
Definition: lists.h:402
PSortedListElement * parent
Definition: lists.h:688
PObject * data
Definition: lists.h:50
iterator begin()
Definition: lists.h:375
PObject * data
Definition: lists.h:691
PStack(int dummy, const PStack *c)
Definition: lists.h:637
This template class maps the PAbstractList to a specific object type, and adds functionality that all...
Definition: lists.h:480
PListElement * prev
Definition: lists.h:48
bool deleteObjects
Definition: contain.h:72
T & operator[](PINDEX index) const
Retrieve a reference to the object in the list.
Definition: lists.h:420
iterator operator--(int)
Definition: lists.h:369
#define PCONTAINERINFO(cls, par)
Macro to declare funtions required in a container.
Definition: contain.h:343
T & front() const
Definition: lists.h:399
const_iterator rend() const
Definition: lists.h:397
PStack()
Create a new, empty, stack.
Definition: lists.h:595
iterator operator++(int)
Definition: lists.h:368
virtual PObject * Clone() const
Make a complete duplicate of the list.
Definition: lists.h:342
PListElement(PObject *theData)
This template class maps the PAbstractSortedList to a specific object type.
Definition: lists.h:954
PSortedListElement * right
Definition: lists.h:690
This template class maps the PAbstractList to a specific object type, and adds functionality that all...
Definition: lists.h:582
PListElement * tail
Definition: lists.h:59
PListElement * head
Definition: lists.h:58
#define PAssert(b, msg)
This macro is used to assert that a condition must be true.
Definition: object.h:192
T & back() const
Definition: lists.h:400
PSortedListElement Element
Definition: lists.h:931
T & operator[](PINDEX index) const
Retrieve a reference to the object in the list.
Definition: lists.h:991
PINDEX subTreeSize
Definition: lists.h:692
const_iterator operator++()
Definition: lists.h:385
This class is a collection of objects which are descendents of the PObject class. ...
Definition: lists.h:742
PContainerReference * reference
Definition: contain.h:291
PListElement * next
Definition: lists.h:49
PObject * RemoveElement(const PObject &key)
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
A collection is a container that collects together descendents of the PObject class.
Definition: contain.h:395
PListElement * element
Definition: lists.h:351
const_iterator rbegin() const
Definition: lists.h:396
void Prev()
Definition: lists.h:354
const_iterator end() const
Definition: lists.h:395
#define PNEW
Macro for overriding system default new operator.
Definition: object.h:890