Main Page   Compound List   File List   Compound Members   File Members  

TclXPCOMInterfaceRef.cpp File Reference

#include "TclXPCOMPrivate.h"

Go to the source code of this file.

Functions

InterfaceRefNewInterfaceRef (void)
Tcl_HashEntry * AddISupportsToInterfaceRef (InterfaceRef *iref, nsISupports *isupports, nsIInterfaceInfo *interfaceinfo)
void MergeInterfaceRefs (InterfaceRef *irefa, InterfaceRef *irefb)
void FreeInterfaceRef (InterfaceRef *iref)
int AddRefInterface (nsISupports *isupports, nsIInterfaceInfo *interfaceinfo, Tcl_HashEntry **entryout)
int ReleaseInterface (nsISupports *isupports)
InterfaceRefGetInterfaceRef (nsISupports *isupports)
int QueryInterfaceIRef (Tcl_Interp *interp, InterfaceRef *iref, nsIInterfaceInfo *queryinfo, nsISupports **result)
ClassInfoGetClassInfoFromIRef (InterfaceRef *iref)
int GetMethodFromIRef (Tcl_Interp *interp, nsISupports *isupports, nsIInterfaceInfo *interfaceinfo, Tcl_Obj *identifier, int type, nsIInterfaceInfo **infoout, PRUint16 *methodindex)
void TclXPCOM_InitInterfaceRef (void)

Variables

Tcl_HashTable irefhash


Detailed Description

Contains functions for handling InterfaceRef objects.

Definition in file TclXPCOMInterfaceRef.cpp.


Function Documentation

InterfaceRef* NewInterfaceRef void   
 

Creates a new InterfaceRef object.

Returns:
a new InterfaceRef object

Definition at line 53 of file TclXPCOMInterfaceRef.cpp.

References InterfaceRef::cinfo, InterfaceRef::cinforef, InterfaceRef::cisupported, InterfaceRef::refcount, and InterfaceRef::refhash.

Referenced by AddRefInterface.

Tcl_HashEntry* AddISupportsToInterfaceRef InterfaceRef   iref,
nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo
 

Adds an interface pointer to an InterfaceRef object.

Returns:
a pointer to the Tcl hashentry that contains the interface reference as its value and interface info as its key
Parameters:
iref  (in) InterfaceRef object to add to
isupports  (in) interface pointer to add
interfaceinfo  (in) interface info of the pointer

Definition at line 78 of file TclXPCOMInterfaceRef.cpp.

References irefhash, and InterfaceRef::refhash.

Referenced by AddRefInterface, and QueryInterfaceIRef.

void MergeInterfaceRefs InterfaceRef   irefa,
InterfaceRef   irefb
 

Merges two InterfaceRef objects that represent the same underlying XPCOM component. All interface pointers will be moved from 'irefb' to 'irefa', and 'irefb' will be freed.

Parameters:
irefa  (in) first InterfaceRef object
irefb  (in) second InterfaceRef object

Definition at line 125 of file TclXPCOMInterfaceRef.cpp.

References InterfaceRef::cinfo, InterfaceRef::cinforef, InterfaceRef::cisupported, irefhash, InterfaceRef::refcount, and InterfaceRef::refhash.

Referenced by QueryInterfaceIRef.

void FreeInterfaceRef InterfaceRef   iref
 

Frees an InterfaceRef object.

Parameters:
iref  (in) InterfaceRef object to free

Definition at line 182 of file TclXPCOMInterfaceRef.cpp.

References InterfaceRef::cinforef, irefhash, and InterfaceRef::refhash.

Referenced by ReleaseInterface.

int AddRefInterface nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
Tcl_HashEntry **    entryout
 

Stores an owning pointer to the given XPCOM component in the InterfaceRef subsystem. 'entryout', if non-NULL, will be set to point to the hashentry that contains the interface reference as its value and interface info as its key.

Returns:
the resulting reference count of the component
Parameters:
isupports  (in) interface pointer to own
interfaceinfo  (in) interface info of pointer
entryout  (out) address to store found hash entry

Definition at line 238 of file TclXPCOMInterfaceRef.cpp.

References AddISupportsToInterfaceRef, GetInterfaceRef, NewInterfaceRef, and InterfaceRef::refcount.

int ReleaseInterface nsISupports *    isupports
 

Releases an owning pointer of the given XPCOM component from the InterfaceRef subsystem.

Returns:
the resulting reference count of the component
Parameters:
isupports  (in) interface pointer to release

Definition at line 277 of file TclXPCOMInterfaceRef.cpp.

References FreeInterfaceRef, GetInterfaceRef, and InterfaceRef::refcount.

InterfaceRef* GetInterfaceRef nsISupports *    isupports
 

Retrieves the InterfaceRef object that owns the given interface pointer, or NULL if no InterfaceRef object currently owns the given pointer.

Returns:
an InterfaceRef object
Parameters:
isupports  (in) interface pointer

Definition at line 307 of file TclXPCOMInterfaceRef.cpp.

References irefhash.

int QueryInterfaceIRef Tcl_Interp *    interp,
InterfaceRef   iref,
nsIInterfaceInfo *    queryinfo,
nsISupports **    result
 

Retrieves a non-owning interface pointer from the given InterfaceRef object that matches the given interface. If an error occurs and 'interp' is not NULL, then an error message will be left in it's result.

Return values:
TCL_OK  - if successful
TCL_ERROR  - if an error occurred
Parameters:
interp  (in) interpreter to store any error messages
iref  (in) InterfaceRef object to query
queryinfo  (in) requested interface
result  (out) address to store interface pointer

Definition at line 337 of file TclXPCOMInterfaceRef.cpp.

References AddISupportsToInterfaceRef, InterfaceRef::cinforef, GetInterfaceRef, MergeInterfaceRefs, InterfaceRef::refhash, and TclXPCOM_SetError.

ClassInfo* GetClassInfoFromIRef InterfaceRef   iref
 

Retrieves the ClassInfo object that corresponds with the given InterfaceRef object, if it's underlying component implements nsIClassInfo.

Returns:
a ClassInfo object
Parameters:
iref  (in) InterfaceRef object to query

Definition at line 418 of file TclXPCOMInterfaceRef.cpp.

References InterfaceRef::cinfo, InterfaceRef::cisupported, QueryInterfaceIRef, and TclXPCOM_GetClassInfo.

Referenced by GetMethodFromIRef.

int GetMethodFromIRef Tcl_Interp *    interp,
nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
Tcl_Obj *    identifier,
int    type,
nsIInterfaceInfo **    infoout,
PRUint16 *    methodindex
 

Retrieves the interface method that corresponds with the given identifier and type.

Return values:
TCL_OK  - if successful
TCL_ERROR  - if an error occurred
Parameters:
interp  (in) interpreter to store any error messages
isupports  (in) interface pointer
interfaceinfo  (in) interface info of pointer
identifier  (in) identifier
type  (in) type of indentifier requested
infoout  (out) address to store interface info of method
methodindex  (out) address to store method index

Definition at line 477 of file TclXPCOMInterfaceRef.cpp.

References GetClassInfoFromIRef, GetInterfaceRef, INTERFACEINFO_GETTER, INTERFACEINFO_METHOD, INTERFACEINFO_SETTER, TclXPCOM_GetIdentifierFromObj, TclXPCOM_GetIdentifierInfoFromClass, TclXPCOM_GetIdentifierInfoFromInterface, and TclXPCOM_GetMethodIndex.

void TclXPCOM_InitInterfaceRef void   
 

Initializes the InterfaceRef subsystem.

Definition at line 547 of file TclXPCOMInterfaceRef.cpp.

References irefhash.

Referenced by Tclxpcom_Init.


Variable Documentation

Tcl_HashTable irefhash
 

Definition at line 44 of file TclXPCOMInterfaceRef.cpp.

Referenced by AddISupportsToInterfaceRef, FreeInterfaceRef, GetInterfaceRef, MergeInterfaceRefs, and TclXPCOM_InitInterfaceRef.


Generated on Fri Jun 14 23:25:51 2002 for TclXPCOM by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002