Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
nsGenericInterfaceInfoSet Class Reference

#include <iixprivate.h>

Inheritance diagram for nsGenericInterfaceInfoSet:
Inheritance graph
[legend]
Collaboration diagram for nsGenericInterfaceInfoSet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIINTERFACEINFOMANAGER
NS_DECL_NSIGENERICINTERFACEINFOSET 
nsGenericInterfaceInfoSet ()
virtual ~nsGenericInterfaceInfoSet ()
XPTArenaGetArena ()
const XPTTypeDescriptorGetAdditionalTypeAt (PRUint16 aIndex)
nsIInterfaceInfoInfoAtNoAddRef (PRUint16 aIndex)
XPTParamDescriptorPtr allocateParamArray (in PRUint16 aCount)
 Methods include pointers to param arrays allocated here.
XPTTypeDescriptorPtr allocateAdditionalType (out PRUint16 aIndex)
 Used for type that is in an array.
PRUint16 createAndAppendInterface (in string aName, in nsIIDRef aIID, in PRUint16 aParent, in PRUint8 aFlags, out nsIGenericInterfaceInfo aInfo)
PRUint16 appendExternalInterface (in nsIInterfaceInfo aInfo)
PRUint16 indexOf (in nsIIDRef aIID)
PRUint16 indexOfByName (in string aName)
nsIInterfaceInfo interfaceInfoAt (in PRUint16 aIndex)
nsIInterfaceInfo getInfoForIID (in nsIIDPtr iid)
nsIInterfaceInfo getInfoForName (in string name)
nsIIDPtr getIIDForName (in string name)
string getNameForIID (in nsIIDPtr iid)
nsIEnumerator enumerateInterfaces ()
void autoRegisterInterfaces ()
nsIEnumerator enumerateInterfacesWhoseNamesStartWith (in string prefix)

Private Member Functions

nsresult IndexOfIID (const nsIID &aIID, PRUint16 *_retval)
nsresult IndexOfName (const char *aName, PRUint16 *_retval)
voidSetOwnedFlag (void *p)
voidClearOwnedFlag (void *p)
PRBool CheckOwnedFlag (void *p)

Private Attributes

nsVoidArray mInterfaces
nsVoidArray mAdditionalTypes
XPTArenamArena

Detailed Description

Definition at line 66 of file iixprivate.h.


Constructor & Destructor Documentation

NS_DECL_ISUPPORTS NS_DECL_NSIINTERFACEINFOMANAGER NS_DECL_NSIGENERICINTERFACEINFOSET nsGenericInterfaceInfoSet::nsGenericInterfaceInfoSet ( )

Definition at line 59 of file nsGenericInterfaceInfoSet.cpp.

{
    PRInt32 count = mInterfaces.Count();

    for(PRInt32 i = 0; i < count; i++)
    {
        nsIInterfaceInfo* info = (nsIInterfaceInfo*) mInterfaces.ElementAt(i);
        if(CheckOwnedFlag(info))
            delete (nsGenericInterfaceInfo*) ClearOwnedFlag(info);
        else
            NS_RELEASE(info);
    }

    if(mArena)
        XPT_DestroyArena(mArena);
}

Here is the call graph for this function:


Member Function Documentation

Used for type that is in an array.

Methods include pointers to param arrays allocated here.

Definition at line 108 of file iixprivate.h.

    {
        return (PRBool) ((long)p & (long)1);
    }

Here is the caller graph for this function:

Definition at line 104 of file iixprivate.h.

    {
        return (void*) ((long)p & ~(long)1);
    }

Here is the caller graph for this function:

PRUint16 nsIGenericInterfaceInfoSet::createAndAppendInterface ( in string  aName,
in nsIIDRef  aIID,
in PRUint16  aParent,
in PRUint8  aFlags,
out nsIGenericInterfaceInfo  aInfo 
) [inherited]

Definition at line 82 of file iixprivate.h.

    {
        NS_ASSERTION(aIndex < (PRUint16) mAdditionalTypes.Count(), "bad index");
        return (const XPTTypeDescriptor*) mAdditionalTypes.ElementAt(aIndex);
    }

Here is the caller graph for this function:

Definition at line 77 of file iixprivate.h.

    {
        return mArena;
    }

Here is the caller graph for this function:

nsIIDPtr nsIInterfaceInfoManager::getIIDForName ( in string  name) [inherited]
string nsIInterfaceInfoManager::getNameForIID ( in nsIIDPtr  iid) [inherited]
PRUint16 nsIGenericInterfaceInfoSet::indexOf ( in nsIIDRef  aIID) [inherited]
nsresult nsGenericInterfaceInfoSet::IndexOfIID ( const nsIID aIID,
PRUint16 _retval 
) [private]

Definition at line 77 of file nsGenericInterfaceInfoSet.cpp.

{
    PRInt32 count = mInterfaces.Count();

    for(PRInt32 i = 0; i < count; i++)
    {
        nsIInterfaceInfo* info = (nsIInterfaceInfo*)
            ClearOwnedFlag(mInterfaces.ElementAt(i));
        const nsID* iid;
        nsresult rv = info->GetIIDShared(&iid);
        if(NS_FAILED(rv))
            return rv;
        if(iid->Equals(aIID))
        {
            *_retval = (PRUint16) i;
            return NS_OK;
        }
    }
    return NS_ERROR_NO_INTERFACE;
}

Here is the call graph for this function:

nsresult nsGenericInterfaceInfoSet::IndexOfName ( const char *  aName,
PRUint16 _retval 
) [private]

Definition at line 99 of file nsGenericInterfaceInfoSet.cpp.

{
    PRInt32 count = mInterfaces.Count();

    for(PRInt32 i = 0; i < count; i++)
    {
        nsIInterfaceInfo* info = (nsIInterfaceInfo*)
            ClearOwnedFlag(mInterfaces.ElementAt(i));
        const char* name;
        nsresult rv = info->GetNameShared(&name);
        if(NS_FAILED(rv))
            return rv;
        if(!strcmp(name, aName))
        {
            *_retval = (PRUint16) i;
            return NS_OK;
        }
    }
    return NS_ERROR_NO_INTERFACE;
}

Here is the call graph for this function:

Definition at line 88 of file iixprivate.h.

    {
        NS_ASSERTION(aIndex < (PRUint16) mInterfaces.Count(), "bad index");
        return (nsIInterfaceInfo*) ClearOwnedFlag(mInterfaces.ElementAt(aIndex));
    }

Here is the call graph for this function:

void* nsGenericInterfaceInfoSet::SetOwnedFlag ( void p) [inline, private]

Definition at line 98 of file iixprivate.h.

    {
        NS_ASSERTION(sizeof(void *) == sizeof(long),
                     "The size of a pointer != size of long!");
        return (void*) ((long)p | 1);
    }

Member Data Documentation

Definition at line 115 of file iixprivate.h.

Definition at line 116 of file iixprivate.h.

Definition at line 114 of file iixprivate.h.


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