(file) Return to List.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Listener

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2