//===========================================================================//
// File:	srtskt.hh                                                           //
// Project: MUNGA           Brick: Connection Engine                         //
// Contents: Interface definition for sorted socket class                    //
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 11/02/94  ECH  Initial coding.                                            //
// 11/03/94  ECH  Made compatible with BC4.0                                 //
// 11/05/94  JMA  Made compatible with GNU C++                               //
// 12/12/94  ECH  Changed release handling											  //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc.                //
//                      PROPRIETARY AND CONFIDENTIAL                         //
//===========================================================================//

#if !defined(SRTSKT_HPP)
#	define SRTSKT_HPP

#	if !defined(SFESKT_HPP)
#		include <sfeskt.hpp>
#	endif

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~ SortedSocket ~~~~~~~~~~~~~~~~~~~~~~~~~~~

	class SortedSocket:
		public SafeSocket
	{
	public:
		~SortedSocket();

		void
			AddValuePlug(
				Plug *plug,
				const void *value
			)
         	{AddValueImplementation(plug, value);}

		Plug*
			FindPlug(const void *value)
				{return FindImplementation(value);}

	protected:
		SortedSocket(
			Logical has_unique_entries = True
		);
		SortedSocket(
			Node *node,
			Logical has_unique_entries = True
		);

		Logical
			HasUniqueEntries()
				{return hasUniqueEntries;}

		virtual void
			AddValueImplementation(
				Plug *plug,
				const void *value
			);

		virtual Plug*
			FindImplementation(const void *value);

	private:
		Logical
      	hasUniqueEntries;
	};

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~ SortedIterator ~~~~~~~~~~~~~~~~~~~~~~~~~~~

	class SortedIterator:
		public SafeIterator
	{
	public:
		~SortedIterator();

		virtual Plug*
			FindImplementation(const void *value);

		virtual void*
			GetValueImplementation();

	protected:
		SortedIterator(SortedSocket *sortedSocket);
	};

#endif
