mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 18:31:08 +00:00
Added |CallQueryInterface|, a type-safe interface to |QueryInterface|
This commit is contained in:
parent
d686c1191e
commit
6bab6751e6
@ -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