Back to index

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

#include <Converters.h>

Inheritance diagram for TestConverterFactory:
Inheritance graph
Collaboration diagram for TestConverterFactory:
Collaboration graph

List of all members.

Public Member Functions

 TestConverterFactory (const nsCID &aClass, const char *className, const char *contractID)
NS_DECL_ISUPPORTS NS_IMETHOD CreateInstance (nsISupports *aOuter, const nsIID &aIID, void **aResult)
NS_IMETHOD LockFactory (PRBool aLock)
void createInstance (in nsISupports aOuter, in nsIIDRef iid,[retval, iid_is(iid)] out nsQIResult result)
 Creates an instance of a component.
void lockFactory (in PRBool lock)
 LockFactory provides the client a way to keep the component in memory until it is finished with it.

Protected Member Functions

virtual ~TestConverterFactory ()

Protected Attributes

nsCID mClassID
const char * mClassName
const char * mContractID

Detailed Description

Definition at line 47 of file Converters.h.

Constructor & Destructor Documentation

TestConverterFactory::TestConverterFactory ( const nsCID aClass,
const char *  className,
const char *  contractID 

Definition at line 106 of file Converters.cpp.

Definition at line 113 of file Converters.cpp.


Member Function Documentation

NS_IMETHODIMP TestConverterFactory::CreateInstance ( nsISupports *  aOuter,
const nsIID aIID,
void **  aResult 

Definition at line 120 of file Converters.cpp.

    if (! aResult)
        return NS_ERROR_NULL_POINTER;

    if (aOuter)

    *aResult = nsnull;

    nsresult rv = NS_OK;

    nsISupports *inst = nsnull;
    if (mClassID.Equals(kTestConverterCID)) {
        TestConverter *conv = new TestConverter();
        if (!conv) return NS_ERROR_OUT_OF_MEMORY;
        conv->QueryInterface(NS_GET_IID(nsISupports), (void**)&inst);
    else {
        return NS_ERROR_NO_INTERFACE;

    if (!inst)
        return NS_ERROR_OUT_OF_MEMORY;
    *aResult = inst;
    return rv;

Here is the call graph for this function:

void nsIFactory::createInstance ( in nsISupports  aOuter,
in nsIIDRef  iid,
[retval, iid_is(iid)] out nsQIResult  result 
) [inherited]

Creates an instance of a component.

aOuterPointer to a component that wishes to be aggregated in the resulting instance. This will be nsnull if no aggregation is requested.
iidThe IID of the interface being requested in the component which is being currently created.
result[out] Pointer to the newly created instance, if successful.
NS_OK - Component successfully created and the interface being requested was successfully returned in result. NS_NOINTERFACE - Interface not accessible. NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the component is not aggregatable. NS_ERROR* - Method failure.

Definition at line 152 of file Converters.cpp.

    // Not implemented in simplest case.
    return NS_OK;
void nsIFactory::lockFactory ( in PRBool  lock) [inherited]

LockFactory provides the client a way to keep the component in memory until it is finished with it.

The client can call LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE) to release the factory.

lock- Must be PR_TRUE or PR_FALSE
NS_OK - If the lock operation was successful. NS_ERROR* - Method failure.

Member Data Documentation

Definition at line 66 of file Converters.h.

Definition at line 67 of file Converters.h.

Definition at line 68 of file Converters.h.

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