1 karl 1.7 //%2006////////////////////////////////////////////////////////////////////////
|
2 tony 1.1 //
|
3 karl 1.5 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.5 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.6 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.7 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 tony 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.8 //
|
21 tony 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_List_h
35 #define Pegasus_List_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Listener/Linkage.h>
39
40 PEGASUS_NAMESPACE_BEGIN
41
42 tony 1.1 /**
43 * Iterator
44 */
45 class Iterator
46 {
47 public:
|
48 david.dillard 1.3 /**
49 * Destroys the object. This is needed so that an object of a
50 * subclass can be correctly destroyed thru an Iterator pointer.
51 */
|
52 a.arora 1.4 virtual ~Iterator() {};
|
53 david.dillard 1.3
|
54 karl 1.8 /**
|
55 tony 1.1 * Returns <tt>true</tt> if the iteration has more elements. (In other
56 * words, returns <tt>true</tt> if <tt>next</tt> would return an element
57 * rather than throwing an exception.)
58 *
59 * @return <tt>true</tt> if the iterator has more elements.
|
60 karl 1.8 */
61 virtual Boolean hasNext() = 0;
62
63 /**
64 * Returns the next element in the interation.
65 *
66 * @returns the next element in the interation.
67 * @exception NoSuchElementException iteration has no more elements.
68 */
69 virtual void* next() = 0;
70
71 /**
72 *
73 * Removes from the underlying collection the last element returned by the
74 * iterator (optional operation). This method can be called only once per
75 * call to <tt>next</tt>. The behavior of an iterator is unspecified if
76 * the underlying collection is modified while the iteration is in
77 * progress in any way other than by calling this method.
78 *
79 * @exception UnsupportedOperationException if the <tt>remove</tt>
80 * operation is not supported by this Iterator.
81 karl 1.8 */
82 virtual void remove() = 0;
|
83 tony 1.1 };
84
85 /**
86 * PtrList
87 */
88 class PtrList
89 {
90 public:
|
91 karl 1.8 /**
|
92 kumpf 1.9 Constructs a PtrList object.
|
93 karl 1.8 */
94 PtrList();
95 /**
|
96 kumpf 1.9 Destructor of a PtrList object.
|
97 karl 1.8 */
|
98 tony 1.1 ~PtrList();
99
|
100 karl 1.8 /**
|
101 kumpf 1.9 Adds an element into the list.
102 @param element The element pointer to add.
|
103 karl 1.8 */
104 void add(void* element);
105
106 /**
|
107 kumpf 1.9 Removes an element from the list
108 @param element The element pointer to remove.
|
109 karl 1.8 */
110 void remove(void* element);
|
111 tony 1.1
|
112 karl 1.8 /**
|
113 kumpf 1.9 Returns an iterator over the elements in this list in proper sequence.
114 @return an iterator over the elements in this list in proper sequence.
115 */
|
116 karl 1.8 Iterator* iterator();
|
117 tony 1.1
118 private:
|
119 karl 1.8 void* _rep;
|
120 tony 1.1 };
121
122 PEGASUS_NAMESPACE_END
123
124 #endif /* Pegasus_List_h */
125
|