![]() ![]() |
![]() |
1 karl 1.2 //%2003//////////////////////////////////////////////////////////////////////// | ||
2 tony 1.1 // | ||
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 a.arora 1.4 // Modified By: Amit K Arora, IBM (amita@in.ibm.com) for Bug#1811 | ||
29 tony 1.1 // 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 david.dillard 1.3 /** 47 * Destroys the object. This is needed so that an object of a 48 * subclass can be correctly destroyed thru an Iterator pointer. 49 */ | ||
50 a.arora 1.4 virtual ~Iterator() {}; | ||
51 david.dillard 1.3 | ||
52 tony 1.1 /** 53 * Returns <tt>true</tt> if the iteration has more elements. (In other 54 * words, returns <tt>true</tt> if <tt>next</tt> would return an element 55 * rather than throwing an exception.) 56 * 57 * @return <tt>true</tt> if the iterator has more elements. 58 */ 59 virtual Boolean hasNext() = 0; 60 61 /** 62 * Returns the next element in the interation. 63 * 64 * @returns the next element in the interation. 65 * @exception NoSuchElementException iteration has no more elements. 66 */ 67 virtual void* next() = 0; 68 69 /** 70 * 71 * Removes from the underlying collection the last element returned by the 72 * iterator (optional operation). This method can be called only once per 73 tony 1.1 * call to <tt>next</tt>. The behavior of an iterator is unspecified if 74 * the underlying collection is modified while the iteration is in 75 * progress in any way other than by calling this method. 76 * 77 * @exception UnsupportedOperationException if the <tt>remove</tt> 78 * operation is not supported by this Iterator. 79 */ 80 virtual void remove() = 0; 81 }; 82 83 /** 84 * PtrList 85 */ 86 class PtrList 87 { 88 public: 89 /** 90 * Constructs a PtrList object. 91 * 92 * @param portNumber the specified socket port the listener will listen to 93 * @param sslContext the specifed SSL context 94 tony 1.1 */ 95 PtrList(); 96 /** 97 * Destructor of a PtrList object. 98 */ 99 ~PtrList(); 100 101 /** 102 * Adds an element into the list 103 * 104 * @param the element to add. 105 */ 106 void add(void* element); 107 108 /** 109 * Removes an element from the list 110 * 111 * @param the element to remove. 112 */ 113 void remove(void* element); 114 115 tony 1.1 /** 116 * Returns an iterator over the elements in this list in proper sequence. 117 * 118 * @return an iterator over the elements in this list in proper sequence. 119 */ 120 Iterator* iterator(); 121 122 private: 123 void* _rep; 124 }; 125 126 PEGASUS_NAMESPACE_END 127 128 #endif /* Pegasus_List_h */ 129 |
No CVS admin address has been configured |
Powered by ViewCVS 0.9.2 |