Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Private Attributes | Friends
nsXTFWeakTearoff Class Reference
Collaboration diagram for nsXTFWeakTearoff:
Collaboration graph

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD GetInterfaceInfo (nsIInterfaceInfo **info)
NS_IMETHOD CallMethod (PRUint16 methodIndex, const nsXPTMethodInfo *info, nsXPTCMiniVariant *params)

Protected Member Functions

 nsXTFWeakTearoff (const nsIID &iid, nsISupports *obj)
 ~nsXTFWeakTearoff ()

Private Attributes

nsISupports * mObj


nsresult NS_NewXTFWeakTearoff (const nsIID &iid, nsISupports *obj, nsISupports **result)

Detailed Description

Definition at line 50 of file nsXTFWeakTearoff.cpp.

Constructor & Destructor Documentation

nsXTFWeakTearoff::nsXTFWeakTearoff ( const nsIID iid,
nsISupports *  obj 
) [protected]

Definition at line 81 of file nsXTFWeakTearoff.cpp.

    : mObj(obj), mIID(iid)
#ifdef DEBUG
//  printf("nsXTFWeakTearoff CTOR\n");

Definition at line 90 of file nsXTFWeakTearoff.cpp.

#ifdef DEBUG
//  printf("nsXTFWeakTearoff DTOR\n");

Member Function Documentation

Definition at line 146 of file nsXTFWeakTearoff.cpp.

  if (methodIndex < 3) {
    NS_ERROR("huh? indirect nsISupports method call unexpected on nsXTFWeakTearoff.");
    return NS_ERROR_FAILURE;

  // prepare args:
  int paramCount = info->GetParamCount();
  nsXPTCVariant* fullPars = paramCount ? new nsXPTCVariant[paramCount] : nsnull;

  for (int i=0; i<paramCount; ++i) {
    const nsXPTParamInfo& paramInfo = info->GetParam(i);
    uint8 flags = paramInfo.IsOut() ? nsXPTCVariant::PTR_IS_DATA : 0;
    fullPars[i].Init(params[i], paramInfo.GetType(), flags);
  // make the call:
  nsresult rv = XPTC_InvokeByIndex(mObj,
  if (fullPars)
    delete []fullPars;
  return rv;

Here is the call graph for this function:

Definition at line 138 of file nsXTFWeakTearoff.cpp.

  nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();
  NS_ASSERTION(iim, "could not get interface info manager");
  return iim->GetInfoForIID( &mIID, info);

Friends And Related Function Documentation

nsresult NS_NewXTFWeakTearoff ( const nsIID iid,
nsISupports *  obj,
nsISupports **  result 
) [friend]

Definition at line 98 of file nsXTFWeakTearoff.cpp.

  NS_PRECONDITION(aResult != nsnull, "null ptr");
  if (!aResult)

  nsXTFWeakTearoff* result = new nsXTFWeakTearoff(iid,obj);
  if (! result)

  *aResult = result;
  return NS_OK;

Member Data Documentation

Definition at line 75 of file nsXTFWeakTearoff.cpp.

nsISupports* nsXTFWeakTearoff::mObj [private]

Definition at line 74 of file nsXTFWeakTearoff.cpp.

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