PageRenderTime 183ms CodeModel.GetById 121ms app.highlight 2ms RepoModel.GetById 58ms app.codeStats 0ms

/gecko_api/include/nsIHashable.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 116 lines | 56 code | 28 blank | 32 comment | 0 complexity | 313c7a1146e7ff1dbe30ea24aa4be0ee MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/ds/nsIHashable.idl
  3 */
  4
  5#ifndef __gen_nsIHashable_h__
  6#define __gen_nsIHashable_h__
  7
  8
  9#ifndef __gen_nsISupports_h__
 10#include "nsISupports.h"
 11#endif
 12
 13/* For IDL files that don't want to include root IDL files. */
 14#ifndef NS_NO_VTABLE
 15#define NS_NO_VTABLE
 16#endif
 17
 18/* starting interface:    nsIHashable */
 19#define NS_IHASHABLE_IID_STR "17e595fa-b57a-4933-bd0f-b1812e8ab188"
 20
 21#define NS_IHASHABLE_IID \
 22  {0x17e595fa, 0xb57a, 0x4933, \
 23    { 0xbd, 0x0f, 0xb1, 0x81, 0x2e, 0x8a, 0xb1, 0x88 }}
 24
 25/**
 26 * Represents an object that can be stored in a hashtable.
 27 *
 28 * @status FROZEN - This interface will not change in the Mozilla 1.x lifetime
 29 */
 30class NS_NO_VTABLE NS_SCRIPTABLE nsIHashable : public nsISupports {
 31 public: 
 32
 33  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHASHABLE_IID)
 34
 35  /**
 36   * Is this object the equivalent of the other object?
 37   */
 38  /* boolean equals (in nsIHashable aOther); */
 39  NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval) = 0;
 40
 41  /**
 42   * A generated hashcode for this object. Objects that are equivalent
 43   * must have the same hash code. Getting this property should never
 44   * throw an exception!
 45   */
 46  /* readonly attribute unsigned long hashCode; */
 47  NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode) = 0;
 48
 49};
 50
 51  NS_DEFINE_STATIC_IID_ACCESSOR(nsIHashable, NS_IHASHABLE_IID)
 52
 53/* Use this macro when declaring classes that implement this interface. */
 54#define NS_DECL_NSIHASHABLE \
 55  NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval); \
 56  NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode); 
 57
 58/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 59#define NS_FORWARD_NSIHASHABLE(_to) \
 60  NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval) { return _to Equals(aOther, _retval); } \
 61  NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode) { return _to GetHashCode(aHashCode); } 
 62
 63/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 64#define NS_FORWARD_SAFE_NSIHASHABLE(_to) \
 65  NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(aOther, _retval); } \
 66  NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHashCode(aHashCode); } 
 67
 68#if 0
 69/* Use the code below as a template for the implementation class for this interface. */
 70
 71/* Header file */
 72class nsHashable : public nsIHashable
 73{
 74public:
 75  NS_DECL_ISUPPORTS
 76  NS_DECL_NSIHASHABLE
 77
 78  nsHashable();
 79
 80private:
 81  ~nsHashable();
 82
 83protected:
 84  /* additional members */
 85};
 86
 87/* Implementation file */
 88NS_IMPL_ISUPPORTS1(nsHashable, nsIHashable)
 89
 90nsHashable::nsHashable()
 91{
 92  /* member initializers and constructor code */
 93}
 94
 95nsHashable::~nsHashable()
 96{
 97  /* destructor code */
 98}
 99
100/* boolean equals (in nsIHashable aOther); */
101NS_IMETHODIMP nsHashable::Equals(nsIHashable *aOther, PRBool *_retval)
102{
103    return NS_ERROR_NOT_IMPLEMENTED;
104}
105
106/* readonly attribute unsigned long hashCode; */
107NS_IMETHODIMP nsHashable::GetHashCode(PRUint32 *aHashCode)
108{
109    return NS_ERROR_NOT_IMPLEMENTED;
110}
111
112/* End of implementation class template. */
113#endif
114
115
116#endif /* __gen_nsIHashable_h__ */