sipxportlib  Version 3.3
UtlSortedList.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 #ifndef _UtlSortedList_h_
13 #define _UtlSortedList_h_
14 
15 // SYSTEM INCLUDES
16 // APPLICATION INCLUDES
17 #include "utl/UtlDefs.h"
18 #include "utl/UtlList.h"
19 
20 // DEFINES
21 // MACROS
22 // EXTERNAL FUNCTIONS
23 // EXTERNAL VARIABLES
24 // CONSTANTS
25 // STRUCTS
26 // TYPEDEFS
27 // FORWARD DECLARATIONS
28 class UtlContainable;
29 
44 class UtlSortedList : public UtlList
45 {
46 /* //////////////////////////// PUBLIC //////////////////////////////////// */
47 public:
48  static const UtlContainableType TYPE;
49 
50 /* ============================ CREATORS ================================== */
51 
55  UtlSortedList();
56 
57 /* ============================ MANIPULATORS ============================== */
58 
64  virtual UtlContainable* insert(UtlContainable* obj);
65 
69  virtual UtlContainable* remove(const UtlContainable*);
70 
71 
72 /* ============================ ACCESSORS ================================= */
73 
78  virtual UtlContainable* find(const UtlContainable*) const;
79 
80 /* ============================ INQUIRY =================================== */
81 
86  virtual size_t index(const UtlContainable* obj) const;
87 
91  virtual size_t occurrencesOf(const UtlContainable* obj) const;
92 
93 
98 
99 
100 /* //////////////////////////// PROTECTED ///////////////////////////////// */
101 protected:
102  friend class UtlSortedListIterator;
103 
104  typedef enum {POSITION, EXACTLY} MatchType;
105 
112  UtlLink* findNode(UtlLink* starting, MatchType match, const UtlContainable* obj) const;
113 
114 /* //////////////////////////// PRIVATE /////////////////////////////////// */
115 private:
116 
117  /* for now, don't provide a copy constructor */
119 };
120 
121 /* ============================ INLINE METHODS ============================ */
122 
123 #endif // _UtlSortedList_h_
124 
125 
virtual UtlContainable * insert(UtlContainable *obj)
Definition: UtlSortedList.cpp:42
virtual UtlContainable * find(const UtlContainable *) const
Definition: UtlSortedList.cpp:71
MatchType
Definition: UtlSortedList.h:104
Definition: UtlSortedListIterator.h:38
UtlLink * findNode(UtlLink *starting, MatchType match, const UtlContainable *obj) const
Definition: UtlSortedList.cpp:152
Definition: UtlSortedList.h:44
virtual size_t index(const UtlContainable *obj) const
Definition: UtlSortedList.cpp:91
Definition: UtlList.h:59
const char *const UtlContainableType
Definition: UtlDefs.h:70
virtual size_t occurrencesOf(const UtlContainable *obj) const
Definition: UtlSortedList.cpp:117
Definition: UtlContainable.h:37
Definition: UtlSortedList.h:104
Definition: UtlSortedList.h:104
static const UtlContainableType TYPE
Definition: UtlSortedList.h:48
UtlContainableType getContainableType() const
Definition: UtlSortedList.cpp:144
UtlSortedList()
Definition: UtlSortedList.cpp:31