- Notifications
You must be signed in to change notification settings - Fork 961
/
Copy pathclass1.h
58 lines (50 loc) · 1.8 KB
/
class1.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include<map>
#include<vector>
namespaceWFC= Windows::Foundation::Collections;
namespaceJS_Array
{
public ref classClass1 sealed
{
public:
Class1();
doublePassArrayForReading(const Platform::Array<double>^ arr);
voidCalleeAllocatedDemo(Platform::Array<int>^* arr);
Platform::Array<int>^ CalleeAllocatedDemo2();
Platform::Array<int>^ CalleeAllocatedDemo3();
property Platform::Array<int>^ Arr;
voidCallerAllocatedDemo(Platform::WriteOnlyArray<int>^ arr);
voidConversionDemo(const Platform::Array<int>^ arr);
voidInvokeIterators(Platform::WriteOnlyArray<int>^ arr);
voidTestDataReader();
};
ref classPerson sealed
{
Person(Platform::String^ name);
voidAddPhoneNumber(Platform::String^ type, Platform::String^ number);
property WFC::IMapView<Platform::String^, Platform::String^>^ PhoneNumbers
{
WFC::IMapView<Platform::String^, Platform::String^>^ get();
}
private:
Platform::String^ m_name;
std::map<Platform::String^, Platform::String^> m_numbers;
};
//<snippet07>
public ref classTestReferenceArray sealed
{
public:
// Assume dr is already initialized with a stream
voidGetArray(Windows::Storage::Streams::DataReader^ dr, int numBytesRemaining)
{
// Copy into Platform::Array
auto bytes = ref new Platform::Array<unsignedchar>(numBytesRemaining);
// Fill an Array.
dr->ReadBytes(bytes);
// Fill a C-style array
uint8 data[1024];
dr->ReadBytes( Platform::ArrayReference<uint8>(data, 1024) );
}
};
//</snippet07>
}