Added |CallQueryInterface|, a type-safe interface to |QueryInterface|
git-svn-id: svn://10.0.0.236/trunk@30100 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
c2578a9d5f
commit
8a9c9eb0d5
@ -554,4 +554,18 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// A type-safe interface for calling |QueryInterface()|. A similar implementation
|
||||
// exists in "nsCOMPtr.h" for use with |nsCOMPtr|s.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsresult
|
||||
CallQueryInterface( nsISupports* aSource, T** aDestination )
|
||||
// a type-safe shortcut for calling the |QueryInterface()| member function
|
||||
{
|
||||
NS_PRECONDITION(aSource, "null parameter");
|
||||
|
||||
return aSource->QueryInterface(T::GetIID(), aDestination);
|
||||
}
|
||||
|
||||
#endif /* __nsISupportsUtils_h */
|
||||
|
||||
@ -554,4 +554,18 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// A type-safe interface for calling |QueryInterface()|. A similar implementation
|
||||
// exists in "nsCOMPtr.h" for use with |nsCOMPtr|s.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsresult
|
||||
CallQueryInterface( nsISupports* aSource, T** aDestination )
|
||||
// a type-safe shortcut for calling the |QueryInterface()| member function
|
||||
{
|
||||
NS_PRECONDITION(aSource, "null parameter");
|
||||
|
||||
return aSource->QueryInterface(T::GetIID(), aDestination);
|
||||
}
|
||||
|
||||
#endif /* __nsISupportsUtils_h */
|
||||
|
||||
@ -554,4 +554,18 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// A type-safe interface for calling |QueryInterface()|. A similar implementation
|
||||
// exists in "nsCOMPtr.h" for use with |nsCOMPtr|s.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsresult
|
||||
CallQueryInterface( nsISupports* aSource, T** aDestination )
|
||||
// a type-safe shortcut for calling the |QueryInterface()| member function
|
||||
{
|
||||
NS_PRECONDITION(aSource, "null parameter");
|
||||
|
||||
return aSource->QueryInterface(T::GetIID(), aDestination);
|
||||
}
|
||||
|
||||
#endif /* __nsISupportsUtils_h */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user