//
//   COMPONENT_NAME: somuc
//
//   ORIGINS: 82, 81, 27
//
//
//   10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//
//   Copyright © 1988, 1989 Apple Computer, Inc. All rights reserved.
/*
 * CLASS_NAME: somf_TPriorityQueue
 *
 * DESCRIPTION: A TPriorityQueue is a subclass of TCollection which keeps
 *              the elements of the collection partially ordered based on
 *              some ordering function.  Priority Queues are often used
 *              when you must collect a set of records, then process the
 *              largest, then collect more, the process the largest, etc.
 *
 */
#ifndef TPQ_idl
#define TPQ_idl
#include "tcollect.idl"
#include "morder.idl"
/* interface somf_MOrderableCollectible; */
interface somf_TPriorityQueue : somf_TCollection
{
  const   long    kInitialPriorityQueueSize = 20;
  somf_TPriorityQueue somfTPriorityQueueInitF(in somf_MOrderableCollectible::somf_MOrderableCompareFn testfn);
  // Initialize a new TPriorityQueue
  somf_TPriorityQueue somfTPriorityQueueInitP(in somf_TPriorityQueue q);
  // Initialize a new TPriorityQueue
  void somfAssign(in somf_TPriorityQueue source);
  // Assign the instance of this equal to the instance of source.
  void somfInsert(in somf_MOrderableCollectible obj);
  // Insert obj in this
  somf_MOrderableCollectible somfPop();
  // Remove the object with the "highest" priority from the priority queue,
  // and return it.
  somf_MOrderableCollectible somfPeek();
  // Determine the object with the "highest" priority from the TPriorityQueue,
  // but don't remove it.
  somf_MOrderableCollectible somfReplace(in somf_MOrderableCollectible obj);
  // This method removes the object with the highest priority from the
  // TPriorityQueue, then inserts obj into the TPriorityQueue.
  void somfChange(in somf_MOrderableCollectible obj);
  // DO NOT USE THIS METHOD, it does nothing.
  void somfSetEqualityComparisonFunction(in somf_MCollectible::somf_MCollectibleCompareFn fn);
  // Set the equality comparison function being used by the priority queue.
  somf_MCollectible::somf_MCollectibleCompareFn  somfGetEqualityComparisonFunction();
  // Return the equality comparison function being used by the priority queue.
#ifdef __SOMIDL__
  implementation {
    releaseorder: somfInsert, somfPop, somfPeek, somfReplace,
		  somfChange, somfSetEqualityComparisonFunction,
		  somfGetEqualityComparisonFunction,
		  somfDownHeap, somfUpHeap, somfGrowHeap, somfMakeNewTable,
		  somfCopyIn, somfAssign, somfTPriorityQueueInitF,
		  somfTPriorityQueueInitP;
    majorversion = 2;
    minorversion = 1;
    filestem = tpq;
    dllname = "somuc.dll";
    passthru C_xh_after =  ""
"#include <morder.xh>";
    passthru C_h_after =  ""
"#include <morder.h>";
    somf_MOrderableCollectible* fTable;
    long                      fCount;
    long                      fCurrentSize;
    somf_MOrderableCollectible::somf_MOrderableCompareFn    fSequencingFn;
    somf_MCollectible::somf_MCollectibleCompareFn  fEqualityComparisonFn;
    unsigned long             fSeed;
    somInit: override;
    somUninit: override;
    somfPeek: nomodify;
    somfRemove: override;
    somfAdd: override;
    somfRemoveAll: override;
    somfDeleteAll: override;
    somfCount: override;
    somfMember: override;
    somfCreateIterator: override;
    somfGetEqualityComparisonFunction: nomodify;
    somfTPriorityQueueInitF: nooverride;
    somfTPriorityQueueInitP: nooverride;
  };
#endif /* __SOMIDL__ */
};
#endif  /* TPQ_idl */
