/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// nsMaybeWeakPtrArray is an array of MaybeWeakPtr objects, that knows how to // grab a weak reference to a given object if requested. It only allows a // given object to appear in the array once.
template <class T> class nsMaybeWeakPtrArray : public CopyableTArray<nsMaybeWeakPtr<T>> { typedef nsTArray<nsMaybeWeakPtr<T>> MaybeWeakArray;
nsresult RemoveWeakElement(T* aElement) { if (MaybeWeakArray::RemoveElement(aElement)) { return NS_OK;
}
// Don't use do_GetWeakReference; it should only be called if we know // the object supports weak references.
nsCOMPtr<nsISupportsWeakReference> supWeakRef = do_QueryInterface(aElement); if (!supWeakRef) { return NS_ERROR_INVALID_ARG;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.