Skip to content

Commit 6e40c94

Browse files
committed
Updated docs for version 0.0
1 parent 6ccf624 commit 6e40c94

10 files changed

Lines changed: 264 additions & 165 deletions

api-reference/0.0/PolylineAlgorithm.Abstraction.AbstractPolylineDecoder-2.yml

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ body:
5050
url: https://learn.microsoft.com/dotnet/api/system.object.tostring
5151
- h2: Remarks
5252
- markdown: >-
53-
Derive from this class to implement a decoder for a specific polyline type. Override <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.GetReadOnlyMemory(%600%40)" data-throw-if-not-resolved="false"></xref>,
53+
Derive from this class to implement a decoder for a specific polyline type. Override <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.GetReadOnlyMemory(%600%40)" data-throw-if-not-resolved="false"></xref>
5454
55-
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>, and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateItem(System.ReadOnlyMemory%7bSystem.Double%7d)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
55+
and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.Read(PolylineAlgorithm.Internal.PolylineReader)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
5656
- h2: Constructors
5757
- api3: AbstractPolylineDecoder()
5858
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor
@@ -97,52 +97,7 @@ body:
9797
- type:
9898
- text: PolylineEncodingOptions
9999
url: PolylineAlgorithm.PolylineEncodingOptions.html
100-
- api3: ValuesPerItem
101-
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_ValuesPerItem
102-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L206
103-
metadata:
104-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValuesPerItem
105-
commentId: P:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValuesPerItem
106-
- markdown: Gets the number of values decoded per item from the polyline.
107-
- code: protected abstract int ValuesPerItem { get; }
108-
- h4: Property Value
109-
- parameters:
110-
- type:
111-
- text: int
112-
url: https://learn.microsoft.com/dotnet/api/system.int32
113-
- h4: Remarks
114-
- markdown: >-
115-
Must be greater than zero. Each item in the decoded output is constructed from this many consecutive
116-
117-
delta-decoded values. For a standard geographic coordinate pair (latitude + longitude), return <code>2</code>.
118100
- h2: Methods
119-
- api3: CreateItem(ReadOnlyMemory<double>)
120-
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_CreateItem_System_ReadOnlyMemory_System_Double__
121-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L218
122-
metadata:
123-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateItem(System.ReadOnlyMemory{System.Double})
124-
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateItem(System.ReadOnlyMemory{System.Double})
125-
- markdown: Creates a <code class="typeparamref">TCoordinate</code> instance from the specified decoded values.
126-
- code: protected abstract TCoordinate CreateItem(ReadOnlyMemory<double> values)
127-
- h4: Parameters
128-
- parameters:
129-
- name: values
130-
type:
131-
- text: ReadOnlyMemory
132-
url: https://learn.microsoft.com/dotnet/api/system.readonlymemory-1
133-
- <
134-
- text: double
135-
url: https://learn.microsoft.com/dotnet/api/system.double
136-
- '>'
137-
description: >-
138-
A <xref href="System.ReadOnlyMemory%601" data-throw-if-not-resolved="false"></xref> of <xref href="System.Double" data-throw-if-not-resolved="false"></xref> containing the decoded values for this item.
139-
140-
The length equals <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>. Implementations should copy values out rather than store the memory.
141-
- h4: Returns
142-
- parameters:
143-
- type:
144-
- TCoordinate
145-
description: A <code class="typeparamref">TCoordinate</code> instance representing the decoded item.
146101
- api3: Decode(TPolyline, CancellationToken)
147102
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Decode__0_System_Threading_CancellationToken_
148103
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L81
@@ -195,7 +150,7 @@ body:
195150
description: Thrown when <code class="paramref">cancellationToken</code> is canceled during decoding.
196151
- api3: GetReadOnlyMemory(in TPolyline)
197152
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_GetReadOnlyMemory__0__
198-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L196
153+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L176
199154
metadata:
200155
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
201156
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
@@ -217,9 +172,41 @@ body:
217172
url: https://learn.microsoft.com/dotnet/api/system.char
218173
- '>'
219174
description: A <xref href="System.ReadOnlyMemory%601" data-throw-if-not-resolved="false"></xref> of <xref href="System.Char" data-throw-if-not-resolved="false"></xref> representing the encoded polyline characters.
175+
- api3: Read(PolylineReader)
176+
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Read_PolylineAlgorithm_Internal_PolylineReader_
177+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L195
178+
metadata:
179+
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Read(PolylineAlgorithm.Internal.PolylineReader)
180+
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Read(PolylineAlgorithm.Internal.PolylineReader)
181+
- markdown: Reads field values from the polyline decoding pipeline and constructs one <code class="typeparamref">TCoordinate</code> item.
182+
- code: protected abstract TCoordinate Read(PolylineReader reader)
183+
- h4: Parameters
184+
- parameters:
185+
- name: reader
186+
type:
187+
- text: PolylineReader
188+
url: PolylineAlgorithm.Internal.PolylineReader.html
189+
description: >-
190+
The <xref href="PolylineAlgorithm.Internal.PolylineReader" data-throw-if-not-resolved="false"></xref> cursor provided by the engine. Call <xref href="PolylineAlgorithm.Internal.PolylineReader.Read(System.Int32%40)" data-throw-if-not-resolved="false"></xref>
191+
192+
once for each expected field value, in the same order used by the corresponding encoder's
193+
194+
Write override.
195+
- h4: Returns
196+
- parameters:
197+
- type:
198+
- TCoordinate
199+
description: A <code class="typeparamref">TCoordinate</code> instance constructed from the decoded field values.
200+
- h4: Remarks
201+
- markdown: >-
202+
Implementations must always call <xref href="PolylineAlgorithm.Internal.PolylineReader.Read(System.Int32%40)" data-throw-if-not-resolved="false"></xref> the same number of times,
203+
204+
in the same field order, for every item. The number of reads must match the number of writes
205+
206+
performed by the corresponding encoder's Write override.
220207
- api3: ValidateFormat(ReadOnlyMemory<char>, ILogger?)
221208
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_ValidateFormat_System_ReadOnlyMemory_System_Char__Microsoft_Extensions_Logging_ILogger_
222-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L176
209+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L156
223210
metadata:
224211
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)
225212
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)

api-reference/0.0/PolylineAlgorithm.Abstraction.AbstractPolylineEncoder-2.yml

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ body:
5858
- markdown: >-
5959
Derive from this class to implement an encoder for a specific item and polyline type. Override
6060
61-
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>, <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.GetValues(%600%2cSystem.Span%7bSystem.Double%7d)" data-throw-if-not-resolved="false"></xref>, and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.CreatePolyline(System.ReadOnlyMemory%7bSystem.Char%7d)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
61+
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.Write(%600%2cPolylineAlgorithm.Internal.PolylineWriter%40)" data-throw-if-not-resolved="false"></xref>, and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.CreatePolyline(System.ReadOnlySpan%7bSystem.Char%7d)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
6262
- h2: Constructors
6363
- api3: AbstractPolylineEncoder()
6464
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2__ctor
@@ -103,44 +103,26 @@ body:
103103
- type:
104104
- text: PolylineEncodingOptions
105105
url: PolylineAlgorithm.PolylineEncodingOptions.html
106-
- api3: ValuesPerItem
107-
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_ValuesPerItem
108-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L196
109-
metadata:
110-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.ValuesPerItem
111-
commentId: P:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.ValuesPerItem
112-
- markdown: Gets the number of values extracted from each <code class="typeparamref">TCoordinate</code> item during encoding.
113-
- code: protected abstract int ValuesPerItem { get; }
114-
- h4: Property Value
115-
- parameters:
116-
- type:
117-
- text: int
118-
url: https://learn.microsoft.com/dotnet/api/system.int32
119-
- h4: Remarks
120-
- markdown: >-
121-
Must be greater than zero. Each value is written as a separate delta-encoded block in the output polyline.
122-
123-
For a standard geographic coordinate pair (latitude + longitude), return <code>2</code>.
124106
- h2: Methods
125-
- api3: CreatePolyline(ReadOnlyMemory<char>)
126-
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_CreatePolyline_System_ReadOnlyMemory_System_Char__
127-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L186
107+
- api3: CreatePolyline(ReadOnlySpan<char>)
108+
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_CreatePolyline_System_ReadOnlySpan_System_Char__
109+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L143
128110
metadata:
129-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.CreatePolyline(System.ReadOnlyMemory{System.Char})
130-
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.CreatePolyline(System.ReadOnlyMemory{System.Char})
131-
- markdown: Creates a polyline instance from the provided read-only sequence of characters.
132-
- code: protected abstract TPolyline CreatePolyline(ReadOnlyMemory<char> polyline)
111+
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.CreatePolyline(System.ReadOnlySpan{System.Char})
112+
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.CreatePolyline(System.ReadOnlySpan{System.Char})
113+
- markdown: Creates a polyline instance from the provided read-only span of characters.
114+
- code: protected abstract TPolyline CreatePolyline(ReadOnlySpan<char> polyline)
133115
- h4: Parameters
134116
- parameters:
135117
- name: polyline
136118
type:
137-
- text: ReadOnlyMemory
138-
url: https://learn.microsoft.com/dotnet/api/system.readonlymemory-1
119+
- text: ReadOnlySpan
120+
url: https://learn.microsoft.com/dotnet/api/system.readonlyspan-1
139121
- <
140122
- text: char
141123
url: https://learn.microsoft.com/dotnet/api/system.char
142124
- '>'
143-
description: A <xref href="System.ReadOnlyMemory%601" data-throw-if-not-resolved="false"></xref> containing the encoded polyline characters.
125+
description: A <xref href="System.ReadOnlySpan%601" data-throw-if-not-resolved="false"></xref> containing the encoded polyline characters.
144126
- h4: Returns
145127
- parameters:
146128
- type:
@@ -153,10 +135,7 @@ body:
153135
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Encode(System.ReadOnlySpan{`0},System.Threading.CancellationToken)
154136
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Encode(System.ReadOnlySpan{`0},System.Threading.CancellationToken)
155137
- markdown: Encodes a collection of <code class="typeparamref">TCoordinate</code> instances into an encoded <code class="typeparamref">TPolyline</code> string.
156-
- code: >-
157-
[SuppressMessage("Design", "MA0051:Method is too long", Justification = "Method contains local methods. Actual method only 55 lines.")]
158-
159-
public TPolyline Encode(ReadOnlySpan<TCoordinate> coordinates, CancellationToken cancellationToken = default)
138+
- code: public TPolyline Encode(ReadOnlySpan<TCoordinate> coordinates, CancellationToken cancellationToken = default)
160139
- h4: Parameters
161140
- parameters:
162141
- name: coordinates
@@ -192,29 +171,37 @@ body:
192171
- text: InvalidOperationException
193172
url: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
194173
description: Thrown when the internal encoding buffer cannot accommodate the encoded value.
195-
- api3: GetValues(TCoordinate, Span<double>)
196-
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_GetValues__0_System_Span_System_Double__
197-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L205
174+
- api3: Write(TCoordinate, ref PolylineWriter)
175+
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_Write__0_PolylineAlgorithm_Internal_PolylineWriter__
176+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/assess-repository-state/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L160
198177
metadata:
199-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.GetValues(`0,System.Span{System.Double})
200-
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.GetValues(`0,System.Span{System.Double})
201-
- markdown: Extracts the encoded values from the specified item into the provided span.
202-
- code: protected abstract void GetValues(TCoordinate item, Span<double> values)
178+
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Write(`0,PolylineAlgorithm.Internal.PolylineWriter@)
179+
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Write(`0,PolylineAlgorithm.Internal.PolylineWriter@)
180+
- markdown: Writes the field values of the specified item into the polyline encoding pipeline.
181+
- code: protected abstract void Write(TCoordinate item, ref PolylineWriter writer)
203182
- h4: Parameters
204183
- parameters:
205184
- name: item
206185
type:
207186
- TCoordinate
208-
description: The item from which to extract values.
209-
- name: values
187+
description: The item whose field values are to be encoded.
188+
- name: writer
210189
type:
211-
- text: Span
212-
url: https://learn.microsoft.com/dotnet/api/system.span-1
213-
- <
214-
- text: double
215-
url: https://learn.microsoft.com/dotnet/api/system.double
216-
- '>'
217-
description: A span that receives the extracted values. Its length equals <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>.
190+
- text: PolylineWriter
191+
url: PolylineAlgorithm.Internal.PolylineWriter.html
192+
description: >-
193+
The <xref href="PolylineAlgorithm.Internal.PolylineWriter" data-throw-if-not-resolved="false"></xref> cursor provided by the engine. Call <xref href="PolylineAlgorithm.Internal.PolylineWriter.Write(System.Double%2cSystem.Int32%40)" data-throw-if-not-resolved="false"></xref>
194+
195+
once for each field value, in a fixed, consistent order. The engine handles delta computation,
196+
197+
zigzag encoding, and output buffering.
198+
- h4: Remarks
199+
- markdown: >-
200+
Implementations must always call <xref href="PolylineAlgorithm.Internal.PolylineWriter.Write(System.Double%2cSystem.Int32%40)" data-throw-if-not-resolved="false"></xref> the same number of times,
201+
202+
in the same field order, for every item. The corresponding Read override must
203+
204+
call <xref href="PolylineAlgorithm.Internal.PolylineReader.Read(System.Int32%40)" data-throw-if-not-resolved="false"></xref> the same number of times in the same order.
218205
languageId: csharp
219206
metadata:
220207
description: Provides a base implementation for encoding sequences of items into encoded polyline strings.

0 commit comments

Comments
 (0)