Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
NativeSetMap Class Reference

#include <xpcmaps.h>

Collaboration diagram for NativeSetMap:
Collaboration graph
[legend]

List of all members.

Classes

struct  Entry

Public Member Functions

XPCNativeSetFind (XPCNativeSetKey *key)
XPCNativeSetAdd (const XPCNativeSetKey *key, XPCNativeSet *set)
XPCNativeSetAdd (XPCNativeSet *set)
void Remove (XPCNativeSet *set)
uint32 Count ()
uint32 Enumerate (JSDHashEnumerator f, void *arg)
 ~NativeSetMap ()

Static Public Member Functions

static NativeSetMapnewMap (int size)

Private Member Functions

 NativeSetMap ()
 NativeSetMap (int size)

Private Attributes

JSDHashTablemTable

Detailed Description

Definition at line 446 of file xpcmaps.h.


Constructor & Destructor Documentation

Definition at line 438 of file xpcmaps.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NativeSetMap::NativeSetMap ( int  size) [private]

Definition at line 433 of file xpcmaps.cpp.

{
    mTable = JS_NewDHashTable(&Entry::sOps, nsnull, sizeof(Entry), size);
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 472 of file xpcmaps.h.

    {
        NS_PRECONDITION(key,"bad param");
        NS_PRECONDITION(set,"bad param");
        Entry* entry = (Entry*)
            JS_DHashTableOperate(mTable, key, JS_DHASH_ADD);
        if(!entry)
            return nsnull;
        if(entry->key_value)
            return entry->key_value;
        entry->key_value = set;
        return set;
    }

Here is the caller graph for this function:

Definition at line 486 of file xpcmaps.h.

    {
        XPCNativeSetKey key(set, nsnull, 0);
        return Add(&key, set);
    }

Here is the call graph for this function:

Definition at line 500 of file xpcmaps.h.

{return mTable->entryCount;}

Here is the caller graph for this function:

uint32 NativeSetMap::Enumerate ( JSDHashEnumerator  f,
void arg 
) [inline]

Definition at line 501 of file xpcmaps.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 463 of file xpcmaps.h.

    {
        Entry* entry = (Entry*)
            JS_DHashTableOperate(mTable, key, JS_DHASH_LOOKUP);
        if(JS_DHASH_ENTRY_IS_FREE(entry))
            return nsnull;
        return entry->key_value;
    }

Here is the caller graph for this function:

NativeSetMap * NativeSetMap::newMap ( int  size) [static]

Definition at line 424 of file xpcmaps.cpp.

{
    NativeSetMap* map = new NativeSetMap(size);
    if(map && map->mTable)
        return map;
    delete map;
    return nsnull;
}

Here is the call graph for this function:

void NativeSetMap::Remove ( XPCNativeSet set) [inline]

Definition at line 492 of file xpcmaps.h.

    {
        NS_PRECONDITION(set,"bad param");

        XPCNativeSetKey key(set, nsnull, 0);
        JS_DHashTableOperate(mTable, &key, JS_DHASH_REMOVE);
    }

Member Data Documentation

Definition at line 509 of file xpcmaps.h.


The documentation for this class was generated from the following files: