Back to index

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

#include <SupportsMixin.h>

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

List of all members.

Public Member Functions

nsresult queryInterface (const nsIID &aIID, void **aInstancePtr)
 The lowercase implementations of queryInterface, addRef, and release all act locally on the current object, regardless of aggregation.
nsrefcnt addRef (void)
nsrefcnt release (void)
nsresult queryInterface (const nsIID &aIID, void **aInstancePtr)
nsrefcnt addRef (void)
nsrefcnt release (void)

Protected Member Functions

 SupportsMixin (void *instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports *outer=NULL)
virtual ~SupportsMixin ()
 SupportsMixin (void *instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports *outer=NULL)
virtual ~SupportsMixin ()

Private Attributes

voidmInstance
nsrefcnt mRefCount
const InterfaceInfomInterfaces
UInt32 mInterfaceCount

Detailed Description

Definition at line 62 of file SupportsMixin.h.


Constructor & Destructor Documentation

SupportsMixin::SupportsMixin ( void instance,
const InterfaceInfo  interfaces[],
UInt32  interfaceCount,
nsISupports *  outer = NULL 
) [protected]

Definition at line 110 of file SupportsMixin.cpp.

       : mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount)
{
}
SupportsMixin::~SupportsMixin ( ) [protected, virtual]

Definition at line 115 of file SupportsMixin.cpp.

{
       if (mRefCount > 0) {
              ::DebugStr("\pmRefCount > 0!");
       }
}
SupportsMixin::SupportsMixin ( void instance,
const InterfaceInfo  interfaces[],
UInt32  interfaceCount,
nsISupports *  outer = NULL 
) [protected]
virtual SupportsMixin::~SupportsMixin ( ) [protected, virtual]

Member Function Documentation

Here is the caller graph for this function:

NS_IMETHODIMP SupportsMixin::queryInterface ( const nsIID aIID,
void **  aInstancePtr 
)

The lowercase implementations of queryInterface, addRef, and release all act locally on the current object, regardless of aggregation.

They are meant to be called by aggregating outer objects.

Definition at line 129 of file SupportsMixin.cpp.

{
       if (aInstancePtr == NULL) {
              return NS_ERROR_NULL_POINTER;
       }
       // first check to see if it's one of our known interfaces.
       // need to solve the non-left inheritance graph case.
       const InterfaceInfo* interfaces = mInterfaces;
       UInt32 count = mInterfaceCount;
       for (UInt32 i = 0; i < count; i++) {
              if (aIID.Equals(interfaces[i].mIID)) {
                     *aInstancePtr = (void*) (UInt32(mInstance) + interfaces[i].mOffset);
                     addRef();
                     return NS_OK;
              }
       }
       // finally, does the interface match nsISupports?
       static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
       if (aIID.Equals(kISupportsIID)) {
              *aInstancePtr = (void*) mInstance;
              addRef();
              return NS_OK;
       }
       return NS_NOINTERFACE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult SupportsMixin::queryInterface ( const nsIID aIID,
void **  aInstancePtr 
)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 80 of file SupportsMixin.h.

Definition at line 83 of file SupportsMixin.h.

Definition at line 82 of file SupportsMixin.h.

Definition at line 81 of file SupportsMixin.h.


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