Platform::Collections::UnorderedMapView — KlasaPlatform::Collections::UnorderedMapView Class
Reprezentuje widok tylko do odczytu w mapie, który jest kolekcją par klucz-wartość.Represents a read-only view into a map, which is a collection of key-value pairs.
SkładniaSyntax
template <
typename K,
typename V,
typename C = ::std::equal_to<K>>
ref class UnorderedMapView sealed;
ParametryParameters
KK
Typ klucza w parze klucz-wartość.The type of the key in the key-value pair.
VV
Typ wartości w parze klucz-wartość.The type of the value in the key-value pair.
SC
Typ, który dostarcza obiekt funkcji, który może porównać dwie wartości klucza dla równości.A type that provides a function object that can compare two key values for equality. Domyślnie std:: equal_to <K> By default, std::equal_to<K>
UwagiRemarks
UnorderedMapView jest konkretną implementacją języka C++ systemu Windows:: Foundation:: Collections: <K,V> : IMapView , który jest przesyłany przez interfejs binarny aplikacji (ABI).UnorderedMapView is a concrete C++ implementation of the Windows::Foundation::Collections::IMapView<K,V> interface that is passed across the application binary interface (ABI). Aby uzyskać więcej informacji, zobacz kolekcje (C++/CX).For more information, see Collections (C++/CX).
Elementy członkowskieMembers
Konstruktory publicznePublic Constructors
NazwaName | OpisDescription |
---|---|
UnorderedMapView:: UnorderedMapViewUnorderedMapView::UnorderedMapView | Inicjuje nowe wystąpienie klasy UnorderedMapView.Initializes a new instance of the UnorderedMapView class. |
Metody publicznePublic Methods
NazwaName | OpisDescription |
---|---|
UnorderedMapView:: FirstUnorderedMapView::First | Zwraca iterator, który jest zainicjowany do pierwszego elementu w widoku mapy.Returns an iterator that is initialized to the first element in the map view. |
UnorderedMapView:: Haskey —UnorderedMapView::HasKey | Określa, czy bieżący UnorderedMapView zawiera określony klucz.Determines whether the current UnorderedMapView contains the specified key. |
UnorderedMapView:: LookupUnorderedMapView::Lookup | Pobiera element z określonego klucza w bieżącym obiekcie UnorderedMapView.Retrieves the element at the specified key in the current UnorderedMapView object. |
UnorderedMapView:: sizeUnorderedMapView::Size | Zwraca liczbę elementów w bieżącym obiekcie UnorderedMapView.Returns the number of elements in the current UnorderedMapView object. |
UnorderedMapView:: SplitUnorderedMapView::Split | Dzieli oryginalny obiekt UnorderedMapView na dwa obiekty UnorderedMapView.Splits an original UnorderedMapView object into two UnorderedMapView objects. |
Hierarchia dziedziczeniaInheritance Hierarchy
UnorderedMapView
WymaganiaRequirements
Nagłówek: Collection. hHeader: collection.h
Przestrzeń nazw: Platform:: CollectionsNamespace: Platform::Collections
UnorderedMapView:: First — MetodaUnorderedMapView::First Method
Zwraca iterator, który określa pierwszy element Windows:: Foundation:: Collections:: <K,V> IKeyValuePair w nieuporządkowanej mapie.Returns an iterator that specifies the first Windows::Foundation::Collections::IKeyValuePair<K,V> element in the unordered map.
SkładniaSyntax
virtual Windows::Foundation::Collections::IIterator<
Windows::Foundation::Collections::IKeyValuePair<K, V>^>^
First();
Wartość zwracanaReturn Value
Iterator, który określa pierwszy element w widoku mapy.An iterator that specifies the first element in the map view.
UwagiRemarks
Wygodnym sposobem przechowywania iteratora zwracanego przez First () jest przypisanie wartości zwracanej do zmiennej, która jest zadeklarowana za pomocą auto
słowa kluczowego odejmowania.A convenient way to hold the iterator returned by First() is to assign the return value to a variable that is declared with the auto
type deduction keyword. Na przykład auto x = myMapView->First();
.For example, auto x = myMapView->First();
.
UnorderedMapView:: Haskey —, MetodaUnorderedMapView::HasKey Method
Określa, czy bieżący UnorderedMap zawiera określony klucz.Determines whether the current UnorderedMap contains the specified key.
SkładniaSyntax
bool HasKey(K key);
ParametryParameters
głównychkey
Klucz służący do lokalizowania elementu.The key used to locate the element. Typ key
to TypeName K.The type of key
is typename K.
Wartość zwracanaReturn Value
true
Jeśli klucz zostanie znaleziony; w przeciwnym razie false
.true
if the key is found; otherwise, false
.
UnorderedMapView:: Lookup — MetodaUnorderedMapView::Lookup Method
Pobiera wartość typu V, która jest skojarzona z określonym kluczem typu K.Retrieves the value of type V that is associated with the specified key of type K.
SkładniaSyntax
V Lookup(K key);
ParametryParameters
głównychkey
Klucz służący do lokalizowania elementu w UnorderedMapView.The key used to locate an element in the UnorderedMapView. Typ key
to TypeName K.The type of key
is typename K.
Wartość zwracanaReturn Value
Wartość, która jest sparowana z key
.The value that is paired with the key
. Typ zwracanej wartości to TypeName V.The type of the return value is typename V.
UnorderedMapView:: size — MetodaUnorderedMapView::Size Method
Zwraca liczbę IKeyValuePair <K,V> elementów Windows:: Foundation:: Collections w UnorderedMapView.Returns the number of Windows::Foundation::Collections::IKeyValuePair<K,V> elements in the UnorderedMapView.
SkładniaSyntax
virtual property unsigned int Size;
Wartość zwracanaReturn Value
Liczba elementów w nieuporządkowanej MapView.The number of elements in the Unordered MapView.
UnorderedMapView:: Split — metodaUnorderedMapView::Split Method
Dzieli bieżący obiekt UnorderedMapView na dwa obiekty UnorderedMapView.Divides the current UnorderedMapView object into two UnorderedMapView objects. Ta metoda nie działa.This method is non-operational.
SkładniaSyntax
void Split(
Windows::Foundation::Collections::IMapView<
K,V>^ * firstPartition,
Windows::Foundation::Collections::IMapView<
K,V>^ * secondPartition);
ParametryParameters
firstPartitionfirstPartition
Pierwsza część oryginalnego obiektu UnorderedMapView.The first part of the original UnorderedMapView object.
secondPartitionsecondPartition
Druga część oryginalnego obiektu UnorderedMapView.The second part of the original UnorderedMapView object.
UwagiRemarks
Ta metoda nie działa; nic nie robi.This method is not operational; it does nothing.
UnorderedMapView:: UnorderedMapView — KonstruktorUnorderedMapView::UnorderedMapView Constructor
Inicjuje nowe wystąpienie klasy UnorderedMapView.Initializes a new instance of the UnorderedMapView class.
SkładniaSyntax
UnorderedMapView();
explicit UnorderedMapView(size_t n);
UnorderedMapView(size_t n, const H& h);
UnorderedMapView(size_t n, const H& h, const P& p);
explicit UnorderedMapView(
const std::unordered_map<K, V, H, P>& m);
explicit UnorderedMapView(
std::unordered_map<K, V, H, P>&& m);
template <typename InIt> UnorderedMapView(InIt first, InIt last );
template <typename InIt> UnorderedMapView(InIt first, InIt last, size_t n );
template <typename InIt> UnorderedMapView(
InIt first,
InIt last,
size_t n,
const H& h );
template <typename InIt> UnorderedMapView(
InIt first,
InIt last,
size_t n,
const H& h,
const P& p );
UnorderedMapView(std::initializer_list<std::pair<const K, V>);
UnorderedMapView(std::initializer_list< std::pair<const K, V>> il, size_t n
UnorderedMapView(
std::initializer_list< std::pair<const K, V>> il,
size_t n,
const H& h);
UnorderedMapView(
std::initializer_list< std::pair<const K, V>> il,
size_t n,
const H& h,
const P& p );
ParametryParameters
nn
Liczba elementów, dla których należy wstępnie przydzielić miejsce.The number of elements to preallocate space for.
InItInIt
Nazwa typu UnorderedMapView.The typename of the UnorderedMapView.
CH
Obiekt funkcji, który może mieć wartość skrótu dla klucza.A function object that can a hash value for a key. Wartość domyślna to std:: <K> hash dla typów, które std::hash
obsługują.Defaults to std::hash<K> for the types that std::hash
supports.
PP
Typ, który dostarcza obiekt funkcji, który może porównać dwa klucze w celu określenia ich równości.A type that provides a function object that can compare two keys to determine their equality. Wartość domyślna to std:: <K> equal_to.Defaults to std::equal_to<K>.
mm
Odwołanie lub lvalues i rvalues do std:: unordered_map , który jest używany do inicjowania UnorderedMapView.A reference or Lvalues and Rvalues to a std::unordered_map that is used to initialize the UnorderedMapView.
pierwszegofirst
Iterator wejściowy pierwszego elementu w zakresie elementów używanych do inicjowania UnorderedMapView.The input iterator of the first element in a range of elements used to initialize the UnorderedMapView.
ostatniegolast
Iterator wejściowy pierwszego elementu po zakresie elementów użytych do zainicjowania UnorderedMapView.The input iterator of the first element after a range of elements used to initialize the UnorderedMapView.
Zobacz teżSee also
Platform:: Collections, przestrzeń nazwPlatform::Collections Namespace
Windows:: Foundation:: IMapViewWindows::Foundation::IMapView