/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
/** * Helper class that provides methods to wrap and unwrap the UserDataType.
*/ template <class T> class nsUniquePtrConverter { public: using UserDataType = T*; using DataType = mozilla::UniquePtr<T>;
/** * templated hashtable class maps keys to C++ object pointers. * See nsBaseHashtable for complete declaration. * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h * for a complete specification. * @param Class the class-type being wrapped * @see nsInterfaceHashtable, nsClassHashtable
*/ template <class KeyClass, class T> class nsClassHashtable : public nsBaseHashtable<KeyClass, mozilla::UniquePtr<T>,
T*, nsUniquePtrConverter<T>> { public: typedeftypename KeyClass::KeyType KeyType; typedef T* UserDataType; typedef nsBaseHashtable<KeyClass, mozilla::UniquePtr<T>, T*,
nsUniquePtrConverter<T>>
base_type;
using base_type::IsEmpty; using base_type::Remove;
/** * @copydoc nsBaseHashtable::Get * @param aData if the key doesn't exist, pData will be set to nullptr.
*/ bool Get(KeyType aKey, UserDataType* aData) const;
/** * @copydoc nsBaseHashtable::Get * @returns nullptr if the key is not present.
*/
[[nodiscard]] UserDataType Get(KeyType aKey) const;
};
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.