Back to index

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

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

 nsXTFInterfaceAggregator (const nsIID &iid, nsISupports *inner, nsISupports *outer)
 ~nsXTFInterfaceAggregator ()

Private Attributes

nsISupports * mInner
nsISupports * mOuter
nsIID mIID

Friends

nsresult NS_NewXTFInterfaceAggregator (const nsIID &iid, nsISupports *inner, nsISupports *outer, void **result)

Detailed Description

Definition at line 50 of file nsXTFInterfaceAggregator.cpp.


Constructor & Destructor Documentation

nsXTFInterfaceAggregator::nsXTFInterfaceAggregator ( const nsIID iid,
nsISupports *  inner,
nsISupports *  outer 
) [protected]

Definition at line 84 of file nsXTFInterfaceAggregator.cpp.

    : mInner(inner), mOuter(outer), mIID(iid)
{
#ifdef DEBUG
//  printf("nsXTFInterfaceAggregator CTOR\n");
#endif
  mInner->AddRef();
  mOuter->AddRef();
}

Definition at line 96 of file nsXTFInterfaceAggregator.cpp.

{
#ifdef DEBUG
//  printf("nsXTFInterfaceAggregator DTOR\n");
#endif
  mInner->Release();
  mOuter->Release();
}

Member Function Documentation

Definition at line 152 of file nsXTFInterfaceAggregator.cpp.

{
  if (methodIndex < 3) {
    NS_ERROR("huh? indirect nsISupports method call unexpected on nsXTFInterfaceAggregator.");
    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);
    PRUint8 flags = paramInfo.IsOut() ? nsXPTCVariant::PTR_IS_DATA : 0;
    fullPars[i].Init(params[i], paramInfo.GetType(), flags);
  }
  
  // make the call:
  nsresult rv = XPTC_InvokeByIndex(mInner,
                                   methodIndex,
                                   paramCount,
                                   fullPars);
  if (fullPars)
    delete []fullPars;
  return rv;
}

Here is the call graph for this function:

Definition at line 144 of file nsXTFInterfaceAggregator.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_NewXTFInterfaceAggregator ( const nsIID iid,
nsISupports *  inner,
nsISupports *  outer,
void **  result 
) [friend]

Definition at line 106 of file nsXTFInterfaceAggregator.cpp.

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

  nsXTFInterfaceAggregator* result = new nsXTFInterfaceAggregator(iid,inner,outer);
  if (!result)
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(result);
  *aResult = result;
  return NS_OK;
}

Member Data Documentation

Definition at line 78 of file nsXTFInterfaceAggregator.cpp.

nsISupports* nsXTFInterfaceAggregator::mInner [private]

Definition at line 76 of file nsXTFInterfaceAggregator.cpp.

nsISupports* nsXTFInterfaceAggregator::mOuter [private]

Definition at line 77 of file nsXTFInterfaceAggregator.cpp.


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