Back to index

lightning-sunbird  0.9+nobinonly
xpcmaps.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1998
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   John Bandhauer <jband@netscape.com> (original author)
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 /* Private maps (hashtables). */
00042 
00043 #ifndef xpcmaps_h___
00044 #define xpcmaps_h___
00045 
00046 // Maps...
00047 
00048 // Note that most of the declarations for hash table entries begin with
00049 // a pointer to something or another. This makes them look enough like
00050 // the JSDHashEntryStub struct that the default OPs (JS_DHashGetStubOps())
00051 // just do the right thing for most of our needs.
00052 
00053 // no virtuals in the maps - all the common stuff inlined
00054 // templates could be used to good effect here.
00055 
00056 class JSContext2XPCContextMap
00057 {
00058 public:
00059     struct Entry : public JSDHashEntryHdr
00060     {
00061         JSContext*  key;
00062         XPCContext* value;
00063     };
00064 
00065     static JSContext2XPCContextMap* newMap(int size);
00066 
00067     inline XPCContext* Find(JSContext* cx)
00068     {
00069         NS_PRECONDITION(cx,"bad param");
00070         Entry* entry = (Entry*)
00071             JS_DHashTableOperate(mTable, cx, JS_DHASH_LOOKUP);
00072         if(JS_DHASH_ENTRY_IS_FREE(entry))
00073             return nsnull;
00074         return entry->value;
00075     }
00076 
00077     inline XPCContext* Add(XPCContext* xpcc)
00078     {
00079         NS_PRECONDITION(xpcc,"bad param");
00080         JSContext* cx = xpcc->GetJSContext();
00081         Entry* entry = (Entry*)
00082             JS_DHashTableOperate(mTable, cx, JS_DHASH_ADD);
00083         if(!entry)
00084             return nsnull;
00085         if(entry->key)
00086             return entry->value;
00087         entry->key = cx;
00088         entry->value = xpcc;
00089         return xpcc;
00090     }
00091 
00092     inline void Remove(XPCContext* xpcc)
00093     {
00094         NS_PRECONDITION(xpcc,"bad param");
00095         JS_DHashTableOperate(mTable, xpcc->GetJSContext(), JS_DHASH_REMOVE);
00096     }
00097 
00098     inline uint32 Count() {return mTable->entryCount;}
00099     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00100         {return JS_DHashTableEnumerate(mTable, f, arg);}
00101 
00102     ~JSContext2XPCContextMap();
00103 private:
00104     JSContext2XPCContextMap();    // no implementation
00105     JSContext2XPCContextMap(int size);
00106 private:
00107     JSDHashTable *mTable;
00108 };
00109 
00110 /*************************/
00111 
00112 class JSObject2WrappedJSMap
00113 {
00114 public:
00115     struct Entry : public JSDHashEntryHdr
00116     {
00117         JSObject*       key;
00118         nsXPCWrappedJS* value;
00119     };
00120 
00121     static JSObject2WrappedJSMap* newMap(int size);
00122 
00123     inline nsXPCWrappedJS* Find(JSObject* Obj)
00124     {
00125         NS_PRECONDITION(Obj,"bad param");
00126         Entry* entry = (Entry*)
00127             JS_DHashTableOperate(mTable, Obj, JS_DHASH_LOOKUP);
00128         if(JS_DHASH_ENTRY_IS_FREE(entry))
00129             return nsnull;
00130         return entry->value;
00131     }
00132 
00133     inline nsXPCWrappedJS* Add(nsXPCWrappedJS* wrapper)
00134     {
00135         NS_PRECONDITION(wrapper,"bad param");
00136         JSObject* obj = wrapper->GetJSObject();
00137         Entry* entry = (Entry*)
00138             JS_DHashTableOperate(mTable, obj, JS_DHASH_ADD);
00139         if(!entry)
00140             return nsnull;
00141         if(entry->key)
00142             return entry->value;
00143         entry->key = obj;
00144         entry->value = wrapper;
00145         return wrapper;
00146     }
00147 
00148     inline void Remove(nsXPCWrappedJS* wrapper)
00149     {
00150         NS_PRECONDITION(wrapper,"bad param");
00151         JS_DHashTableOperate(mTable, wrapper->GetJSObject(), JS_DHASH_REMOVE);
00152     }
00153 
00154     inline uint32 Count() {return mTable->entryCount;}
00155     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00156         {return JS_DHashTableEnumerate(mTable, f, arg);}
00157 
00158     ~JSObject2WrappedJSMap();
00159 private:
00160     JSObject2WrappedJSMap();    // no implementation
00161     JSObject2WrappedJSMap(int size);
00162 private:
00163     JSDHashTable *mTable;
00164 };
00165 
00166 /*************************/
00167 
00168 class Native2WrappedNativeMap
00169 {
00170 public:
00171     struct Entry : public JSDHashEntryHdr
00172     {
00173         nsISupports*      key;
00174         XPCWrappedNative* value;
00175     };
00176 
00177     static Native2WrappedNativeMap* newMap(int size);
00178 
00179     inline XPCWrappedNative* Find(nsISupports* Obj)
00180     {
00181         NS_PRECONDITION(Obj,"bad param");
00182         Entry* entry = (Entry*)
00183             JS_DHashTableOperate(mTable, Obj, JS_DHASH_LOOKUP);
00184         if(JS_DHASH_ENTRY_IS_FREE(entry))
00185             return nsnull;
00186         return entry->value;
00187     }
00188 
00189     inline XPCWrappedNative* Add(XPCWrappedNative* wrapper)
00190     {
00191         NS_PRECONDITION(wrapper,"bad param");
00192         nsISupports* obj = wrapper->GetIdentityObject();
00193         Entry* entry = (Entry*)
00194             JS_DHashTableOperate(mTable, obj, JS_DHASH_ADD);
00195         if(!entry)
00196             return nsnull;
00197         if(entry->key)
00198             return entry->value;
00199         entry->key = obj;
00200         entry->value = wrapper;
00201         return wrapper;
00202     }
00203 
00204     inline void Remove(XPCWrappedNative* wrapper)
00205     {
00206         NS_PRECONDITION(wrapper,"bad param");
00207         JS_DHashTableOperate(mTable, wrapper->GetIdentityObject(), JS_DHASH_REMOVE);
00208     }
00209 
00210     inline uint32 Count() {return mTable->entryCount;}
00211     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00212         {return JS_DHashTableEnumerate(mTable, f, arg);}
00213 
00214     ~Native2WrappedNativeMap();
00215 private:
00216     Native2WrappedNativeMap();    // no implementation
00217     Native2WrappedNativeMap(int size);
00218 private:
00219     JSDHashTable *mTable;
00220 };
00221 
00222 /*************************/
00223 
00224 class IID2WrappedJSClassMap
00225 {
00226 public:
00227     struct Entry : public JSDHashEntryHdr
00228     {
00229         const nsIID*         key;
00230         nsXPCWrappedJSClass* value;
00231 
00232         static struct JSDHashTableOps sOps;
00233     };
00234 
00235     static IID2WrappedJSClassMap* newMap(int size);
00236 
00237     inline nsXPCWrappedJSClass* Find(REFNSIID iid)
00238     {
00239         Entry* entry = (Entry*)
00240             JS_DHashTableOperate(mTable, &iid, JS_DHASH_LOOKUP);
00241         if(JS_DHASH_ENTRY_IS_FREE(entry))
00242             return nsnull;
00243         return entry->value;
00244     }
00245 
00246     inline nsXPCWrappedJSClass* Add(nsXPCWrappedJSClass* clazz)
00247     {
00248         NS_PRECONDITION(clazz,"bad param");
00249         const nsIID* iid = &clazz->GetIID();
00250         Entry* entry = (Entry*)
00251             JS_DHashTableOperate(mTable, iid, JS_DHASH_ADD);
00252         if(!entry)
00253             return nsnull;
00254         if(entry->key)
00255             return entry->value;
00256         entry->key = iid;
00257         entry->value = clazz;
00258         return clazz;
00259     }
00260 
00261     inline void Remove(nsXPCWrappedJSClass* clazz)
00262     {
00263         NS_PRECONDITION(clazz,"bad param");
00264         JS_DHashTableOperate(mTable, &clazz->GetIID(), JS_DHASH_REMOVE);
00265     }
00266 
00267     inline uint32 Count() {return mTable->entryCount;}
00268     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00269         {return JS_DHashTableEnumerate(mTable, f, arg);}
00270 
00271     ~IID2WrappedJSClassMap();
00272 private:
00273     IID2WrappedJSClassMap();    // no implementation
00274     IID2WrappedJSClassMap(int size);
00275 private:
00276     JSDHashTable *mTable;
00277 };
00278 
00279 /*************************/
00280 
00281 class IID2NativeInterfaceMap
00282 {
00283 public:
00284     struct Entry : public JSDHashEntryHdr
00285     {
00286         const nsIID*        key;
00287         XPCNativeInterface* value;
00288 
00289         static struct JSDHashTableOps sOps;
00290     };
00291 
00292     static IID2NativeInterfaceMap* newMap(int size);
00293 
00294     inline XPCNativeInterface* Find(REFNSIID iid)
00295     {
00296         Entry* entry = (Entry*)
00297             JS_DHashTableOperate(mTable, &iid, JS_DHASH_LOOKUP);
00298         if(JS_DHASH_ENTRY_IS_FREE(entry))
00299             return nsnull;
00300         return entry->value;
00301     }
00302 
00303     inline XPCNativeInterface* Add(XPCNativeInterface* iface)
00304     {
00305         NS_PRECONDITION(iface,"bad param");
00306         const nsIID* iid = iface->GetIID();
00307         Entry* entry = (Entry*)
00308             JS_DHashTableOperate(mTable, iid, JS_DHASH_ADD);
00309         if(!entry)
00310             return nsnull;
00311         if(entry->key)
00312             return entry->value;
00313         entry->key = iid;
00314         entry->value = iface;
00315         return iface;
00316     }
00317 
00318     inline void Remove(XPCNativeInterface* iface)
00319     {
00320         NS_PRECONDITION(iface,"bad param");
00321         JS_DHashTableOperate(mTable, iface->GetIID(), JS_DHASH_REMOVE);
00322     }
00323 
00324     inline uint32 Count() {return mTable->entryCount;}
00325     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00326         {return JS_DHashTableEnumerate(mTable, f, arg);}
00327 
00328     ~IID2NativeInterfaceMap();
00329 private:
00330     IID2NativeInterfaceMap();    // no implementation
00331     IID2NativeInterfaceMap(int size);
00332 private:
00333     JSDHashTable *mTable;
00334 };
00335 
00336 /*************************/
00337 
00338 class ClassInfo2NativeSetMap
00339 {
00340 public:
00341     struct Entry : public JSDHashEntryHdr
00342     {
00343         nsIClassInfo* key;
00344         XPCNativeSet* value;
00345     };
00346 
00347     static ClassInfo2NativeSetMap* newMap(int size);
00348 
00349     inline XPCNativeSet* Find(nsIClassInfo* info)
00350     {
00351         Entry* entry = (Entry*)
00352             JS_DHashTableOperate(mTable, info, JS_DHASH_LOOKUP);
00353         if(JS_DHASH_ENTRY_IS_FREE(entry))
00354             return nsnull;
00355         return entry->value;
00356     }
00357 
00358     inline XPCNativeSet* Add(nsIClassInfo* info, XPCNativeSet* set)
00359     {
00360         NS_PRECONDITION(info,"bad param");
00361         Entry* entry = (Entry*)
00362             JS_DHashTableOperate(mTable, info, JS_DHASH_ADD);
00363         if(!entry)
00364             return nsnull;
00365         if(entry->key)
00366             return entry->value;
00367         entry->key = info;
00368         entry->value = set;
00369         return set;
00370     }
00371 
00372     inline void Remove(nsIClassInfo* info)
00373     {
00374         NS_PRECONDITION(info,"bad param");
00375         JS_DHashTableOperate(mTable, info, JS_DHASH_REMOVE);
00376     }
00377 
00378     inline uint32 Count() {return mTable->entryCount;}
00379     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00380         {return JS_DHashTableEnumerate(mTable, f, arg);}
00381 
00382     ~ClassInfo2NativeSetMap();
00383 private:
00384     ClassInfo2NativeSetMap();    // no implementation
00385     ClassInfo2NativeSetMap(int size);
00386 private:
00387     JSDHashTable *mTable;
00388 };
00389 
00390 /*************************/
00391 
00392 class ClassInfo2WrappedNativeProtoMap
00393 {
00394 public:
00395     struct Entry : public JSDHashEntryHdr
00396     {
00397         nsIClassInfo*          key;
00398         XPCWrappedNativeProto* value;
00399     };
00400 
00401     static ClassInfo2WrappedNativeProtoMap* newMap(int size);
00402 
00403     inline XPCWrappedNativeProto* Find(nsIClassInfo* info)
00404     {
00405         Entry* entry = (Entry*)
00406             JS_DHashTableOperate(mTable, info, JS_DHASH_LOOKUP);
00407         if(JS_DHASH_ENTRY_IS_FREE(entry))
00408             return nsnull;
00409         return entry->value;
00410     }
00411 
00412     inline XPCWrappedNativeProto* Add(nsIClassInfo* info, XPCWrappedNativeProto* proto)
00413     {
00414         NS_PRECONDITION(info,"bad param");
00415         Entry* entry = (Entry*)
00416             JS_DHashTableOperate(mTable, info, JS_DHASH_ADD);
00417         if(!entry)
00418             return nsnull;
00419         if(entry->key)
00420             return entry->value;
00421         entry->key = info;
00422         entry->value = proto;
00423         return proto;
00424     }
00425 
00426     inline void Remove(nsIClassInfo* info)
00427     {
00428         NS_PRECONDITION(info,"bad param");
00429         JS_DHashTableOperate(mTable, info, JS_DHASH_REMOVE);
00430     }
00431 
00432     inline uint32 Count() {return mTable->entryCount;}
00433     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00434         {return JS_DHashTableEnumerate(mTable, f, arg);}
00435 
00436     ~ClassInfo2WrappedNativeProtoMap();
00437 private:
00438     ClassInfo2WrappedNativeProtoMap();    // no implementation
00439     ClassInfo2WrappedNativeProtoMap(int size);
00440 private:
00441     JSDHashTable *mTable;
00442 };
00443 
00444 /*************************/
00445 
00446 class NativeSetMap
00447 {
00448 public:
00449     struct Entry : public JSDHashEntryHdr
00450     {
00451         XPCNativeSet* key_value;
00452 
00453         static JSBool JS_DLL_CALLBACK
00454         Match(JSDHashTable *table,
00455               const JSDHashEntryHdr *entry,
00456               const void *key);
00457 
00458         static struct JSDHashTableOps sOps;
00459     };
00460 
00461     static NativeSetMap* newMap(int size);
00462 
00463     inline XPCNativeSet* Find(XPCNativeSetKey* key)
00464     {
00465         Entry* entry = (Entry*)
00466             JS_DHashTableOperate(mTable, key, JS_DHASH_LOOKUP);
00467         if(JS_DHASH_ENTRY_IS_FREE(entry))
00468             return nsnull;
00469         return entry->key_value;
00470     }
00471 
00472     inline XPCNativeSet* Add(const XPCNativeSetKey* key, XPCNativeSet* set)
00473     {
00474         NS_PRECONDITION(key,"bad param");
00475         NS_PRECONDITION(set,"bad param");
00476         Entry* entry = (Entry*)
00477             JS_DHashTableOperate(mTable, key, JS_DHASH_ADD);
00478         if(!entry)
00479             return nsnull;
00480         if(entry->key_value)
00481             return entry->key_value;
00482         entry->key_value = set;
00483         return set;
00484     }
00485 
00486     inline XPCNativeSet* Add(XPCNativeSet* set)
00487     {
00488         XPCNativeSetKey key(set, nsnull, 0);
00489         return Add(&key, set);
00490     }
00491 
00492     inline void Remove(XPCNativeSet* set)
00493     {
00494         NS_PRECONDITION(set,"bad param");
00495 
00496         XPCNativeSetKey key(set, nsnull, 0);
00497         JS_DHashTableOperate(mTable, &key, JS_DHASH_REMOVE);
00498     }
00499 
00500     inline uint32 Count() {return mTable->entryCount;}
00501     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00502         {return JS_DHashTableEnumerate(mTable, f, arg);}
00503 
00504     ~NativeSetMap();
00505 private:
00506     NativeSetMap();    // no implementation
00507     NativeSetMap(int size);
00508 private:
00509     JSDHashTable *mTable;
00510 };
00511 
00512 /***************************************************************************/
00513 
00514 class IID2ThisTranslatorMap
00515 {
00516 public:
00517     struct Entry : public JSDHashEntryHdr
00518     {
00519         nsIID                         key;
00520         nsIXPCFunctionThisTranslator* value;
00521 
00522         static const void* JS_DLL_CALLBACK
00523         GetKey(JSDHashTable *table, JSDHashEntryHdr *entry);
00524 
00525         static JSBool JS_DLL_CALLBACK
00526         Match(JSDHashTable *table,
00527               const JSDHashEntryHdr *entry,
00528               const void *key);
00529 
00530         static void JS_DLL_CALLBACK
00531         Clear(JSDHashTable *table, JSDHashEntryHdr *entry);
00532 
00533         static struct JSDHashTableOps sOps;
00534     };
00535 
00536     static IID2ThisTranslatorMap* newMap(int size);
00537 
00538     inline nsIXPCFunctionThisTranslator* Find(REFNSIID iid)
00539     {
00540         Entry* entry = (Entry*)
00541             JS_DHashTableOperate(mTable, &iid, JS_DHASH_LOOKUP);
00542         if(JS_DHASH_ENTRY_IS_FREE(entry))
00543             return nsnull;
00544         return entry->value;
00545     }
00546 
00547     inline nsIXPCFunctionThisTranslator* Add(REFNSIID iid,
00548                                              nsIXPCFunctionThisTranslator* obj)
00549     {
00550 
00551         Entry* entry = (Entry*)
00552             JS_DHashTableOperate(mTable, &iid, JS_DHASH_ADD);
00553         if(!entry)
00554             return nsnull;
00555         NS_IF_ADDREF(obj);
00556         NS_IF_RELEASE(entry->value);
00557         entry->value = obj;
00558         entry->key = iid;
00559         return obj;
00560     }
00561 
00562     inline void Remove(REFNSIID iid)
00563     {
00564         JS_DHashTableOperate(mTable, &iid, JS_DHASH_REMOVE);
00565     }
00566 
00567     inline uint32 Count() {return mTable->entryCount;}
00568     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00569         {return JS_DHashTableEnumerate(mTable, f, arg);}
00570 
00571     ~IID2ThisTranslatorMap();
00572 private:
00573     IID2ThisTranslatorMap();    // no implementation
00574     IID2ThisTranslatorMap(int size);
00575 private:
00576     JSDHashTable *mTable;
00577 };
00578 
00579 /***************************************************************************/
00580 
00581 class XPCNativeScriptableSharedMap
00582 {
00583 public:
00584     struct Entry : public JSDHashEntryHdr
00585     {
00586         XPCNativeScriptableShared* key;
00587 
00588         static JSDHashNumber JS_DLL_CALLBACK
00589         Hash(JSDHashTable *table, const void *key);
00590 
00591         static JSBool JS_DLL_CALLBACK
00592         Match(JSDHashTable *table,
00593               const JSDHashEntryHdr *entry,
00594               const void *key);
00595 
00596         static struct JSDHashTableOps sOps;
00597     };
00598 
00599     static XPCNativeScriptableSharedMap* newMap(int size);
00600 
00601     JSBool GetNewOrUsed(JSUint32 flags, char* name, PRBool isGlobal,
00602                         XPCNativeScriptableInfo* si);
00603 
00604     inline uint32 Count() {return mTable->entryCount;}
00605     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00606         {return JS_DHashTableEnumerate(mTable, f, arg);}
00607 
00608     ~XPCNativeScriptableSharedMap();
00609 private:
00610     XPCNativeScriptableSharedMap();    // no implementation
00611     XPCNativeScriptableSharedMap(int size);
00612 private:
00613     JSDHashTable *mTable;
00614 };
00615 
00616 /***************************************************************************/
00617 
00618 class XPCWrappedNativeProtoMap
00619 {
00620 public:
00621     static XPCWrappedNativeProtoMap* newMap(int size);
00622 
00623     inline XPCWrappedNativeProto* Add(XPCWrappedNativeProto* proto)
00624     {
00625         NS_PRECONDITION(proto,"bad param");
00626         JSDHashEntryStub* entry = (JSDHashEntryStub*)
00627             JS_DHashTableOperate(mTable, proto, JS_DHASH_ADD);
00628         if(!entry)
00629             return nsnull;
00630         if(entry->key)
00631             return (XPCWrappedNativeProto*) entry->key;
00632         entry->key = proto;
00633         return proto;
00634     }
00635 
00636     inline void Remove(XPCWrappedNativeProto* proto)
00637     {
00638         NS_PRECONDITION(proto,"bad param");
00639         JS_DHashTableOperate(mTable, proto, JS_DHASH_REMOVE);
00640     }
00641 
00642     inline uint32 Count() {return mTable->entryCount;}
00643     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00644         {return JS_DHashTableEnumerate(mTable, f, arg);}
00645 
00646     ~XPCWrappedNativeProtoMap();
00647 private:
00648     XPCWrappedNativeProtoMap();    // no implementation
00649     XPCWrappedNativeProtoMap(int size);
00650 private:
00651     JSDHashTable *mTable;
00652 };
00653 
00654 class XPCNativeWrapperMap
00655 {
00656 public:
00657     static XPCNativeWrapperMap* newMap(int size);
00658 
00659     inline JSObject* Add(JSObject* nw)
00660     {
00661         NS_PRECONDITION(nw,"bad param");
00662         JSDHashEntryStub* entry = (JSDHashEntryStub*)
00663             JS_DHashTableOperate(mTable, nw, JS_DHASH_ADD);
00664         if(!entry)
00665             return nsnull;
00666         if(entry->key)
00667             return (JSObject*) entry->key;
00668         entry->key = nw;
00669         return nw;
00670     }
00671 
00672     inline void Remove(JSObject* nw)
00673     {
00674         NS_PRECONDITION(nw,"bad param");
00675         JS_DHashTableOperate(mTable, nw, JS_DHASH_REMOVE);
00676     }
00677 
00678     inline uint32 Count() {return mTable->entryCount;}
00679     inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
00680         {return JS_DHashTableEnumerate(mTable, f, arg);}
00681 
00682     ~XPCNativeWrapperMap();
00683 private:
00684     XPCNativeWrapperMap();    // no implementation
00685     XPCNativeWrapperMap(int size);
00686 private:
00687     JSDHashTable *mTable;
00688 };
00689 
00690 #endif /* xpcmaps_h___ */