PageRenderTime 21ms CodeModel.GetById 16ms RepoModel.GetById 0ms 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. #ifndef __gen_nsIHashable_h__
  5. #define __gen_nsIHashable_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. /* starting interface: nsIHashable */
  14. #define NS_IHASHABLE_IID_STR "17e595fa-b57a-4933-bd0f-b1812e8ab188"
  15. #define NS_IHASHABLE_IID \
  16. {0x17e595fa, 0xb57a, 0x4933, \
  17. { 0xbd, 0x0f, 0xb1, 0x81, 0x2e, 0x8a, 0xb1, 0x88 }}
  18. /**
  19. * Represents an object that can be stored in a hashtable.
  20. *
  21. * @status FROZEN - This interface will not change in the Mozilla 1.x lifetime
  22. */
  23. class NS_NO_VTABLE NS_SCRIPTABLE nsIHashable : public nsISupports {
  24. public:
  25. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHASHABLE_IID)
  26. /**
  27. * Is this object the equivalent of the other object?
  28. */
  29. /* boolean equals (in nsIHashable aOther); */
  30. NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval) = 0;
  31. /**
  32. * A generated hashcode for this object. Objects that are equivalent
  33. * must have the same hash code. Getting this property should never
  34. * throw an exception!
  35. */
  36. /* readonly attribute unsigned long hashCode; */
  37. NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode) = 0;
  38. };
  39. NS_DEFINE_STATIC_IID_ACCESSOR(nsIHashable, NS_IHASHABLE_IID)
  40. /* Use this macro when declaring classes that implement this interface. */
  41. #define NS_DECL_NSIHASHABLE \
  42. NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval); \
  43. NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode);
  44. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  45. #define NS_FORWARD_NSIHASHABLE(_to) \
  46. NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval) { return _to Equals(aOther, _retval); } \
  47. NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode) { return _to GetHashCode(aHashCode); }
  48. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  49. #define NS_FORWARD_SAFE_NSIHASHABLE(_to) \
  50. NS_SCRIPTABLE NS_IMETHOD Equals(nsIHashable *aOther, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(aOther, _retval); } \
  51. NS_SCRIPTABLE NS_IMETHOD GetHashCode(PRUint32 *aHashCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHashCode(aHashCode); }
  52. #if 0
  53. /* Use the code below as a template for the implementation class for this interface. */
  54. /* Header file */
  55. class nsHashable : public nsIHashable
  56. {
  57. public:
  58. NS_DECL_ISUPPORTS
  59. NS_DECL_NSIHASHABLE
  60. nsHashable();
  61. private:
  62. ~nsHashable();
  63. protected:
  64. /* additional members */
  65. };
  66. /* Implementation file */
  67. NS_IMPL_ISUPPORTS1(nsHashable, nsIHashable)
  68. nsHashable::nsHashable()
  69. {
  70. /* member initializers and constructor code */
  71. }
  72. nsHashable::~nsHashable()
  73. {
  74. /* destructor code */
  75. }
  76. /* boolean equals (in nsIHashable aOther); */
  77. NS_IMETHODIMP nsHashable::Equals(nsIHashable *aOther, PRBool *_retval)
  78. {
  79. return NS_ERROR_NOT_IMPLEMENTED;
  80. }
  81. /* readonly attribute unsigned long hashCode; */
  82. NS_IMETHODIMP nsHashable::GetHashCode(PRUint32 *aHashCode)
  83. {
  84. return NS_ERROR_NOT_IMPLEMENTED;
  85. }
  86. /* End of implementation class template. */
  87. #endif
  88. #endif /* __gen_nsIHashable_h__ */