348 class iterator_base :
public std::iterator<std::bidirectional_iterator_tag, T> {
376 iterator
end() {
return iterator(); }
378 iterator
rend() {
return iterator(); }
395 const_iterator
end()
const {
return const_iterator(); }
397 const_iterator
rend()
const {
return iterator(); }
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); } \
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
PDECLARE_POOL_ALLOCATOR()
enum PSortedListElement::@6 colour
PSortedListElement * root
Definition: lists.h:702
iterator rbegin()
Definition: lists.h:377
const_iterator operator--()
Definition: lists.h:386
PBoolean SetCurrent(PINDEX index, PListElement *&lastElement) const
Move the internal "cursor" to the index position specified.
PINLINE PObject & GetReferenceAt(PINDEX index) const
Get the object at the specified ordinal position.
T * Ptr() const
Definition: lists.h:355
const T & operator*() const
Definition: lists.h:391
iterator(PListElement *e=NULL)
Definition: lists.h:364
iterator rend()
Definition: lists.h:378
virtual PBoolean SetSize(PINDEX newSize)
This function is meaningless for lists.
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
PINDEX ValueSelect(const Element *node, const PObject &obj, const Element **lastElement) const
PSortedList()
Create a new, empty, sorted list.
Definition: lists.h:966
virtual PINDEX Insert(const PObject &before, PObject *obj)
Add a new object to the collection.
virtual PBoolean ReplaceAt(PINDEX index, PObject *val)
Set the object at the specified ordinal position to the new value.
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
virtual void RemoveAll()
Remove all of the elements in the collection.
virtual PINDEX GetValuesIndex(const PObject &obj) const
Search the collection for the specified value of the object.
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
virtual PBoolean SetAt(PINDEX index, PObject *val)
This method simply returns false as the list order is mantained by the class.
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
virtual PINDEX GetObjectsIndex(const PObject *obj) const
Search the collection for the specific instance of the object.
void Next()
Definition: lists.h:353
void erase(const iterator &it)
Definition: lists.h:401
virtual PObject * GetAt(PINDEX index) const
Get the object at the specified ordinal position.
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.
virtual PBoolean SetAt(PINDEX index, PObject *val)
Set the object at the specified ordinal position to the new value.
PQueue()
Create a new, empty, queue.
Definition: lists.h:493
virtual PBoolean Remove(const PObject *obj)
Remove the object from the collection.
PList()
Create a new, empty, list.
Definition: lists.h:333
PSortedListElement * OrderSelect(PSortedListElement *node, PINDEX index) const
This template class maps the PAbstractList to a specific object type.
Definition: lists.h:321
const_iterator begin() const
Definition: lists.h:394
void RightRotate(Element *node)
PListInfo()
Definition: lists.h:57
BOOL PBoolean
Definition: object.h:102
PINLINE PAbstractList()
Create a new, empty, list.
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
virtual Comparison Compare(const PObject &obj) const
Get the relative rank of the two lists.
const_iterator operator--(int)
Definition: lists.h:388
PList(int dummy, const PList *c)
Definition: lists.h:426
virtual PINDEX Append(PObject *obj)
Add a new object to the collection.
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.
virtual PObject * GetAt(PINDEX index) const
Get the object at the specified ordinal position.
virtual PBoolean Remove(const PObject *obj)
Remove the object 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 PINDEX GetSize() const
Get the current size of the container.
virtual PINDEX GetObjectsIndex(const PObject *obj) const
Search the collection for the specific instance of the object.
void LeftRotate(Element *node)
virtual void Push(T *obj)
Add an object to the stack.
Definition: lists.h:614
PObject * RemoveElement(PListElement *element)
virtual Comparison Compare(const PObject &obj) const
Get the relative rank of the two lists.
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
virtual PObject * RemoveAt(PINDEX index)
Remove the object at the specified ordinal index from the collection.
virtual PINDEX GetValuesIndex(const PObject &obj) const
Search the collection for the specified value of the object.
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
void RemoveElement(Element *node)
PListElement * prev
Definition: lists.h:48
bool deleteObjects
Definition: contain.h:72
virtual PINDEX Insert(const PObject &before, PObject *obj)
Insert a new object immediately before the specified object.
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
PAbstractSortedList()
Create a new, empty, sorted list.
virtual PINDEX InsertAt(PINDEX index, PObject *obj)
Add a new object to the collection.
T & front() const
Definition: lists.h:399
const_iterator rend() const
Definition: lists.h:397
T & operator*() const
Definition: lists.h:372
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
PDECLARE_POOL_ALLOCATOR()
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
void DeleteSubTrees(Element *node, PBoolean deleteObject)
virtual PBoolean SetSize(PINDEX newSize)
This function is meaningless for lists.
PContainerReference * reference
Definition: contain.h:291
PSortedListElement * Successor(const PSortedListElement *node) const
PListElement * next
Definition: lists.h:49
PDECLARE_POOL_ALLOCATOR()
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PSortedListElement * Predecessor(const PSortedListElement *node) const
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 DisallowDeleteObjects()
Disallow the deletion of the objects contained in the collection.
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