Skip to content

Latest commit

 

History

History
186 lines (124 loc) · 4.96 KB

File metadata and controls

186 lines (124 loc) · 4.96 KB
title Platform::WriteOnlyArray Class | Microsoft Docs
ms.custom
ms.date 12/30/2016
ms.technology cpp-windows
ms.reviewer
s.suite
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
VCCORLIB/Platform::WriteOnlyArray::begin
VCCORLIB/Platform::WriteOnlyArray::Data
VCCORLIB/Platform::WriteOnlyArray::end
VCCORLIB/Platform::WriteOnlyArray::FastPass
VCCORLIB/Platform::WriteOnlyArray::Length
VCCORLIB/Platform::WriteOnlyArray::set
dev_langs
C++
helpviewer_keywords
Platform::WriteOnlyArray Class
ms.assetid 92d7dd56-ec58-4b8c-88ba-9c903668b687
caps.latest.revision 11
author ghogen
ms.author ghogen
manager ghogen

Platform::WriteOnlyArray Class

Represents a one-dimensional array that's used as an input parameter when the caller passes an array for the method to fill.

This ref class is declared as private in vccorlib.h; therefore, it's not emitted in metadata and is only consumable from C++. This class is intended only for use as an input parameter that receives an array that the caller has allocated. It is not constructible from user code. It enables a C++ method to write directly into that array—a pattern that's known as the FillArray pattern. For more information, see Array and WriteOnlyArray.

Syntax

private ref class WriteOnlyArray<T, 1>  

Members

Public Methods

These methods have internal accessibility—that is, they are only accessible within the C++ app or component.

Name Description

|WriteOnlyArray::begin|An iterator that points to the first element of the array.|
|WriteOnlyArray::Data|A pointer to the data buffer.|
|WriteOnlyArray::end|An iterator that points to one past the last element in the array.|
|WriteOnlyArray::FastPass|Indicates whether the array can use the FastPass mechanism, which is an optimization transparently performed by the system. Don’t use this in your code|
|WriteOnlyArray::Length|Returns the number of elements in the array.|
|WriteOnlyArray::set|Sets the specified element to the specified value.|

Inheritance Hierarchy

WriteOnlyArray

Requirements

Compiler option: /ZW

Metadata: Platform.winmd

Namespace: Platform

WriteOnlyArray::begin Method

Returns a pointer to the first element in the array.

Syntax

T* begin() const;  

Return Value

A pointer to the first element in the array.

Remarks

This iterator can be used with STL algorithms such as std::sort to operate on elements in the array.

WriteOnlyArray::Data Property

Pointer to the data buffer.

Syntax

property T* Data{  
   T* get() const;  
}  

Return Value

A pointer to the raw array bytes.

WriteOnlyArray::end Method

Returns a pointer to one past the last element in the array.

Syntax

T* end() const;  

Return Value

A pointer iterator to one past the last element in the array.

Remarks

This iterator can be used with STL algorithms to perform operations such as std::sort on the array elements.

WriteOnlyArray::FastPass Property

Indicates whether the internal FastPass optimization can be performed. Not intended for use by user code.

Syntax

property bool FastPass{  
   bool get() const;  
}  

Return Value

Boolean value that indicates whether the array is FastPass.

WriteOnlyArray::get Method

Returns the element at the specified index.

Syntax

T& get(  
   unsigned int indexArg) const;  

Parameters

indexArg

Return Value

WriteOnlyArray::Length Property

Returns the number of elements in the caller-allocated array.

Syntax

property unsigned int Length{  
   unsigned int get() const;  
}  

Return Value

The number of elements in the array.

WriteOnlyArray::set Function

Sets the specified value at the specified index in the array.

Syntax

T& set(  
   unsigned int indexArg,  
   T valueArg);  

Parameters

indexArg
The index of the element to set.

valueArg
The value to set at indexArg.

Return Value

A reference to the element that was just set.

Remarks

For more information about how to interpret the HRESULT value, see Structure of COM Error Codes.

See Also

Platform Namespace
Creating Windows Runtime Components in C++