Skip to content

Commit 8351606

Browse files
author
Vyacheslav
committed
2 parents f5892f8 + bfc951b commit 8351606

File tree

9 files changed

+78
-24
lines changed

9 files changed

+78
-24
lines changed

Documentation/Stack/CopyCount.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1+
# Copy(in void*, in nuint) Method
12

3+
## Definition
4+
Copies a count of elements in the collection into memory, starting from the bottom of the stack.
5+
6+
```C#
7+
public void Copy(in void* ptrDest, in nuint count)
8+
```
9+
10+
## Parameters
11+
`in void* ptrDest`
12+
13+
Pointer to the memory where the elements will be copied
14+
15+
`in nuint count`
16+
17+
Count of elements to copy
18+
19+
20+
## Exceptions
21+
22+
```C#
23+
Exception
24+
```
25+
If the collection does not have that many elements

Documentation/Stack/CopyToStack.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1+
# Copy(in Class.StackOf{ItemType}) Method
12

3+
## Definition
4+
Copies a elements in the collection into destination collection.
5+
6+
```C#
7+
public void Copy(in Class.StackOf{ItemType} destStack)
8+
```
9+
10+
## Parameters
11+
`in Class.StackOf{ItemType} destStack`
12+
13+
The destination collection where the elements will be copied to
14+
15+
## Exceptions
16+
17+
```C#
18+
ArgumentException
19+
```
20+
If destination stack not enough capacity

Documentation/Stack/Dispose.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
# FreeMemory(nuint) Method
1+
# Dispose() Method
22

33
## Definition
4-
Free memory.
4+
Disposed the memory used by the collection.
55

66
```C#
7-
public void FreeMemory(nuint reducingBytes)
7+
public void Dispose()
88
```
99

10-
## Parameters
11-
reducingBytes nuint
12-
13-
Freed memory size in bytes
14-
15-
## Returns
16-
void
17-
18-
## Exceptions
19-
20-
```C#
21-
ObjectDisposedException
22-
```
23-
-or-
24-
25-
```C#
26-
Exception
27-
```
28-
If all memory is already free
29-
3010
## Remark
31-
Shifts the Current pointer by -reducingBytes
11+
If the instance was created using a [constructor on a pointer](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Documentation/Stack/Constructor4.md) then: do nothing.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
# IEnumerator GetEnumerator() Method
12

3+
## Definition
4+
Returns an enumerator that iterates through the collection.
5+
6+
```C#
7+
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
8+
```
9+
10+
## Returns
11+
`System.Collections.IEnumerator`
12+
13+
An `IEnumerator` that can be used to iterate through the collection.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
# IEnumerator<{ItemType}> GetEnumerator() Method
12

3+
## Definition
4+
Returns an enumerator that iterates through the collection.
5+
6+
```C#
7+
public System.Collections.Generic.IEnumerator<{ItemType}> GetEnumerator()
8+
```
9+
10+
## Returns
11+
`System.Collections.Generic.IEnumerator<{ItemType}>`
12+
13+
An IEnumerator<{ItemType}> that can be used to iterate through the collection.

Documentation/Stack/Push.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ Inserted element
1818
Exception
1919
```
2020
If there is no place for the element in the collection
21+
22+
## Remarks
23+
24+
If the instance was created using a constructor on a memory and no place for the element in the collection then: allocate memory from `memory`.

Documentation/Stack/PushPtr.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ If there is no place for the element in the collection
2121

2222
## Remarks
2323
For collections on primitive types then ptr is `{ItemType}*` pointer instead of `void*`
24+
If the instance was created using a constructor on a memory and no place for the element in the collection then: allocate memory from `memory`.

Documentation/Stack/TryPush.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Inserted element
1717
`bool`
1818

1919
True if element is successfully inserted otherwise False
20+
If the instance was created using a constructor on a memory and no place for the element in the collection then: try allocate memory from `memory`.

Documentation/Stack/TryPushPtr.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ True if element is successfully inserted otherwise False
1919

2020
## Remarks
2121
For collections on primitive types then ptr is `{ItemType}*` pointer instead of `void*`
22+
If the instance was created using a constructor on a memory and no place for the element in the collection then: try allocate memory from `memory`.

0 commit comments

Comments
 (0)