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 * Constructs a PtrList object.
93 *
94 * @param portNumber the specified socket port the listener will listen to
95 * @param sslContext the specifed SSL context
96 */
97 PtrList();
98 /**
99 * Destructor of a PtrList object.
100 */
|
101 tony 1.1 ~PtrList();
102
|
103 karl 1.8 /**
104 * Adds an element into the list
105 *
106 * @param the element to add.
107 */
108 void add(void* element);
109
110 /**
111 * Removes an element from the list
112 *
113 * @param the element to remove.
114 */
115 void remove(void* element);
|
116 tony 1.1
|
117 karl 1.8 /**
|
118 tony 1.1 * Returns an iterator over the elements in this list in proper sequence.
119 *
120 * @return an iterator over the elements in this list in proper sequence.
121 */
|
122 karl 1.8 Iterator* iterator();
|
123 tony 1.1
124 private:
|
125 karl 1.8 void* _rep;
|
126 tony 1.1 };
127
128 PEGASUS_NAMESPACE_END
129
130 #endif /* Pegasus_List_h */
131
|