IVectorView<T> IVectorView<T> IVectorView<T> IVectorView<T> Interface

Definition

Represents an immutable view into a vector.

.NET This interface appears to .NET code as System.Collections.Generic.IReadOnlyList due to .NET language projection. In any case where a Windows Runtime type has implemented IVectorView;, .NET code can use the APIs of IReadOnlyList instead.

public : interface IVectorView<T> : IIterable<T>
public interface IVectorView<T> : IEnumerable<T>
Public Interface IVectorView<T> Implements IEnumerable<T>
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced v1)

Remarks

For read-write collections, the IVectorView; interface is still relevant, because the IVector.GetView method returns an IVectorView; instance.

When programming with .NET, this interface is hidden and developers should use the interface if they want to implement a read-only vector/list type. In any case where a Windows Runtime type has implemented IVectorView;, .NET code can use the APIs of instead. This includes all the existing Windows Runtime API and also scenarios such as using the APIs of Windows Runtime components originally implemented in Visual C++ component extensions (C++/CX) from a C# or Visual Basic app.

Interface inheritance

IVectorView inherits IIterable. Types that implement IVectorView also implement the interface members of IIterable. Similarly, if you're using .NET, there is support for IEnumerable.

Properties

Size Size Size Size

Gets the number of items in the vector view.

public : unsigned int Size { get; }
public uint Size { get; }
Public ReadOnly Property Size As uint
var uint = iVectorView`1.size;
Value
unsigned int uint uint uint

The number of items in the vector view.

Remarks

When programming with .NET, this interface is hidden and developers should use the interface.

See Also

Methods

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the item at the specified index in the vector view.

public : T GetAt(unsigned int index)
public T GetAt(UInt32 index)
Public Function GetAt(index As UInt32) As T
var t = iVectorView`1.getAt(index);
Parameters
index
unsigned int UInt32 UInt32 UInt32

The zero-based index of the item.

Returns
T T T T

The item at the specified index.

Remarks

When programming with .NET, this interface is hidden and developers should use the interface.

See Also

GetMany(UInt32, T[]) GetMany(UInt32, T[]) GetMany(UInt32, T[]) GetMany(UInt32, T[])

Gets a collection of items from the vector view beginning at the given index.

public : unsigned int GetMany(unsigned int startIndex, T[] items)
public uint GetMany(UInt32 startIndex, T[] items)
Public Function GetMany(startIndex As UInt32, items As T[]) As uint
var uint = iVectorView`1.getMany(startIndex, items);
Parameters
startIndex
unsigned int UInt32 UInt32 UInt32

The zero-based index to start at.

items
T[] T[] T[] T[]

An array to copy the items into.

Returns
unsigned int uint uint uint

A status code indicating the result of the operation.

Remarks

When programming with .NET, this interface is hidden. Use the IList interface instead.

IndexOf(T, UInt32) IndexOf(T, UInt32) IndexOf(T, UInt32) IndexOf(T, UInt32)

Retrieves the index of a specified item in the vector view.

public : Platform::Boolean IndexOf(T value, unsigned int index)
public bool IndexOf(T value, UInt32 index)
Public Function IndexOf(value As T, index As UInt32) As bool
var bool = iVectorView`1.indexOf(value, index);
Parameters
value
T T T T

The item to find in the vector view.

index
unsigned int UInt32 UInt32 UInt32

If the item is found, this is the zero-based index of the item; otherwise, this parameter is 0.

Returns
Platform::Boolean bool bool bool

true if the item is found; otherwise, false.

Remarks

When programming with .NET, this interface is hidden and developers should use the interface.

See Also