//
//   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_TDictionary
 *
 * DESCRIPTION: This class represents a collection of paired objects
 *              (associations).  Because dictionaries are sometimes used
 *              to represent a bijective mapping, functions for retrieving a
 *              key given a value are provided along with the usual access
 *              functions (however, this will probably be slow).
 *
 */
// This file was generated by the SOM Compiler.
// FileName: TDict.id2.
// Generated using:
//     SOM Precompiler spc: 6.13
//     SOM Emitter emitidl.dll: 6.18
#ifndef TDict_idl
#define TDict_idl
#include "tcollect.idl"
interface somf_THashTable;
interface somf_TDictionary : somf_TCollection
{
  somf_TDictionary somfTDictionaryInitFLL(in somf_MCollectible::somf_MCollectibleCompareFn testfn,
				       in long sizeHint,
				       in long growthRate);
  // Initializes the new dictionary.
  somf_TDictionary somfTDictionaryInitFL(in somf_MCollectible::somf_MCollectibleCompareFn testfn,
				      in long sizeHint);
  // Initializes the new dictionary.
  somf_TDictionary somfTDictionaryInitF(in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  // Initializes the new dictionary.
  somf_TDictionary somfTDictionaryInitLLF(in long sizeHint,
				       in long growthRate,
				       in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  // Initializes the new dictionary.
  somf_TDictionary somfTDictionaryInitLL(in long sizeHint,
				      in long growthRate);
  // Initializes the new dictionary.
  somf_TDictionary somfTDictionaryInitL(in long sizeHint);
  // Initializes the new dictionary.
  somf_TDictionary somfTDictionaryInitD(in somf_TDictionary dictionary);
  // Initializes the new dictionary.
  void somfAssign(in somf_TDictionary source);
  // Assign the instance of this equal to the instance of source.
  void somfDeleteAllKeys();
  // Remove all of the entries in the dictionary.  Reset the count to be zero.
  // Call the destructor on every key in the dictionary.
  void somfDeleteAllValues();
  // Remove all of the entries in the dictionary.  Reset the count to be zero.
  // Call the destructor on every value in the hash table.  If you have a value
  // which appears more than once, you will be sorry you used this method because
  // the utility classes will delete the same object more than once.  This
  // is not good.
  somf_MCollectible somfValueAt(in somf_MCollectible key);
  // Return the value associated with the key.  Return SOMF_NIL if the key could not
  // be found.
  somf_MCollectible somfKeyAtMF(in somf_MCollectible val,
			     in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  // Return the first key found which has val as its value.  This involves a slow
  // search.
  somf_MCollectible somfKeyAtM(in somf_MCollectible val);
  // Return the first key found which has val as its value.  This involves a slow
  // search. This method uses the same compare function as specified in
  // the constructor.
  somf_MCollectible somfDeleteKey(in somf_MCollectible key);
  // Delete the key from the key,value pair associated with key and remove the
  // key,value pair from the dictionary.  Return the value that was removed
  // as a result of this call.
  somf_MCollectible somfAddKeyValuePairMMB(in somf_MCollectible key,
					in somf_MCollectible val,
					in boolean replace);
  // If replace = FALSE, then only add key,value pair to the table if there is not
  // an existing key,value pair.  Otherwise, if replace=TRUE, add the key,value
  // pair to the hash table.  Either way, return the key that existed (if any) in
  // the hash table before this call.  Proper memory management may involve
  // checking to see if the key returned is "the same" as the key passes in when
  // replacing key,value pairs.
  somf_MCollectible somfAddKeyValuePairMM(in somf_MCollectible key,
				       in somf_MCollectible val);
  // Add the key,value pair to the hash table, and return the key that existed
  // (if any) in the hash table before this call.  Proper memory management may
  // involve checking to see if the key returned is "the same" as the key passes
  // in when replacing key,value pairs.
  void somfSetHashFunction(in somf_MCollectible::somf_MCollectibleHashFn fn);
  // Set the hash function to fn.  By default this is set to MCollectible's Hash
  // (which is usually overridden in the objects you are adding to the hash
  // table).  You can use any hash function that you like as long as it has the
  // type signature of somf_MCollectibleHashFn.  Most of the time, you won't need to
  // do this.
  somf_MCollectible::somf_MCollectibleHashFn somfGetHashFunction();
  // Return the hash function.
  somf_THashTable somfCreateNewImplementationFLLL(in somf_MCollectible::somf_MCollectibleCompareFn testfn,
					       in long tablesize,
					       in long rate,
					       in long threshold);
  // Create a new hash table for the dictionary.  Normally you won't have to do
  // this.
  somf_THashTable somfCreateNewImplementationF(in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  // Create a new hash table for the dictionary.  Normally you won't have to do
  // this.
  somf_THashTable somfCreateNewImplementationFL(in somf_MCollectible::somf_MCollectibleCompareFn testfn,
					     in long tablesize);
  // Create a new hash table for the dictionary.  Normally you won't have to do
  // this.
  somf_THashTable somfCreateNewImplementationFLL(in somf_MCollectible::somf_MCollectibleCompareFn testfn,
					      in long tablesize,
					      in long rate);
  // Create a new hash table for the dictionary.  Normally you won't have to do
  // this.
  somf_THashTable somfCopyImplementation();
  // Return a hash table that is a copy of the hash table in this.  Normally you
  // won't have to do this.
#ifdef __SOMIDL__
  implementation {
    releaseorder: somfDeleteAllKeys,somfDeleteAllValues,somfValueAt,somfKeyAtMF,
		  somfKeyAtM,somfDeleteKey,somfAddKeyValuePairMMB,
		  somfAddKeyValuePairMM,somfSetHashFunction,somfGetHashFunction,
		  somfCreateNewImplementationFLLL,somfCreateNewImplementationF,
		  somfCreateNewImplementationFL,somfCreateNewImplementationFLL,
		  somfCopyImplementation,somfAssign,somfTDictionaryInitFLL,
		  somfTDictionaryInitFL,somfTDictionaryInitF,
		  somfTDictionaryInitLLF,somfTDictionaryInitLL,
		  somfTDictionaryInitL,somfTDictionaryInitD;
    majorversion = 2;
    minorversion = 1;
    filestem = tdict;
    dllname = "somuc.dll";
    passthru C_xh_after =  ""
""
"#include <mcollect.xh>"
"#include <thash.xh>"
"";
    passthru C_h_after =  ""
""
"#include <mcollect.h>"
"#include <thash.h>"
"";
    somf_THashTable fImplementation;
    somInit: override;
    somUninit: override;
    somfCreateIterator: override;
    somfRemove: override;
    somfRemoveAll: override;
    somfDeleteAll: override;
    somfCount: override;
    somfMember: override;
    somfValueAt: nomodify;
    somfKeyAtMF: nomodify;
    somfKeyAtM: nomodify;
    somfAdd: override;
    somfGetHashFunction: nomodify;
    somfCopyImplementation: nomodify;
    somfTDictionaryInitFLL: nooverride;
    somfTDictionaryInitFL: nooverride;
    somfTDictionaryInitF: nooverride;
    somfTDictionaryInitLLF: nooverride;
    somfTDictionaryInitLL: nooverride;
    somfTDictionaryInitL: nooverride;
    somfTDictionaryInitD: nooverride;
  };
#endif /* __SOMIDL__ */
};
#endif  /* TDict_idl */
