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