Skip to content

Commit

Permalink
documentation update and name refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
benhar-dev committed Apr 28, 2023
1 parent b11ee80 commit 36f87dd
Show file tree
Hide file tree
Showing 25 changed files with 717 additions and 92 deletions.
24 changes: 18 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,42 @@ The mobject-collections library provides a set of efficient and flexible data st

<img src="./images/linkedlist-example.svg">

The LinkedList class is a data structure that allows for efficient insertion, deletion, and traversal of items in a collection. Linked lists are particularly useful when you need to insert or delete items frequently. Additionally, linked lists can be easily be converted to static arrays.
The [LinkedList](linkedlist.md) class is a data structure that allows for efficient insertion, deletion, and traversal of items in a collection. Linked lists are particularly useful when you need to insert or delete items frequently. Additionally, linked lists can be easily be converted to static arrays.

Using the LinkedList class can help you to efficiently manage collections of objects in your industrial control system, particularly when frequent insertions and deletions are required.

The image above depicts a double linked list, which it the term given to a linked list who tracks both the head and tail. The benefit of a double linked list is that both forward and backwards traversing is possible.

### List

<img src="./images/list-example.svg">

The [List](list.md) class is a versatile and dynamic data structure that functions as a zero-indexed, resizable array. As a general-purpose collection, it is suitable for various applications and can easily adapt to changing data sizes. The List class is part of the mobject-collections library and, like other collection classes in the library, supports enumeration through the implementation of the GetEnumerator method.

Using the List class provides an effective way to manage collections of objects in diverse scenarios, offering the advantage of dynamic resizing and easy access to elements by index. This makes it particularly useful for situations where the size of the collection is not known in advance, or when the collection is expected to grow or shrink over time.

In comparison to the LinkedList class, the List class is better suited for situations that require fast, random access to elements within the collection. However, keep in mind that insertion or deletion of items, especially at the beginning or middle of the list, may be less efficient than with a LinkedList due to the need for element shifting.

Overall, the List class is a valuable and flexible data structure that can be employed to manage collections of objects effectively, providing dynamic resizing and quick element access for a wide range of applications.

### Queue

<img src="./images/queue-example.svg">

The Queue class is a data structure that follows the First-In-First-Out (FIFO) principle. Items are added to the back of the queue and removed from the front of the queue, in the order they were added. Queues are particularly useful for managing tasks that need to be processed in the order they were received, such as a set of instructions or a sequence of events.
The [Queue](queue.md) class is a data structure that follows the First-In-First-Out (FIFO) principle. Items are added to the back of the queue and removed from the front of the queue, in the order they were added. Queues are particularly useful for managing tasks that need to be processed in the order they were received, such as a set of instructions or a sequence of events.

Using the Queue class can help you to manage your system's tasks in an organized and efficient manner, ensuring that they are processed in the correct order and without any unnecessary delays.

### Stack

<img src="./images/stack-example.svg">

The Stack class is a data structure that follows the Last-In-First-Out (LIFO) principle. Items are added and to the front of the stack and removed from the front of the stack also, in the order they were added. Stacks are particularly useful for managing tasks that need to be processed in the most recent order they were received, such as a set of instructions or a sequence of events.
The [Stack](stack.md) class is a data structure that follows the Last-In-First-Out (LIFO) principle. Items are added and to the front of the stack and removed from the front of the stack also, in the order they were added. Stacks are particularly useful for managing tasks that need to be processed in the most recent order they were received, such as a set of instructions or a sequence of events.

Using the Stack class can help you to manage your system's tasks in an organized and efficient manner, ensuring that they are processed in the correct order and without any unnecessary delays.

### Dynamic Array and Dictionary
### Dictionary

The mobject-collections library will soon be expanding to include additional classes: Dynamic Array and Dictionary. Dynamic arrays are similar to regular arrays, but with the added benefit of being able to dynamically resize themselves as needed. Dictionaries are a data structure that allow for efficient key-value lookups.
The mobject-collections library will soon be expanding to include Dictionary. Dictionaries are a data structure that allow for efficient key-value lookups.

With the addition of these classes, the mobject-collections library will provide a comprehensive set of data structures that can be used to manage collections of objects in a wide range of scenarios.
With the addition of this class, the mobject-collections library will provide a comprehensive set of data structures that can be used to manage collections of objects in a wide range of scenarios.
2 changes: 1 addition & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Classes

- [LinkedList](linkedlist.md)
- [List](tba.md)
- [List](list.md)
- [Queue](queue.md)
- [Stack](stack.md)

Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

- I_Collection.Count is now DINT.
- Individual OnChanged and OnDisposed event classes have been removed and replaced by generic collection events.
- Added mobject-enumerable 0.1.0.
- Changed all Destination to DestinationAddress on arguments of PVOID.

# 0.6.0

Expand Down
14 changes: 7 additions & 7 deletions docs/i-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Checks to see if an item is contained in the collection.

#### Parameters

| Parameters | Datatype | Description |
| ---------- | -------- | ------------------------------------ |
| Item | ANY | The item to store in the collection. |
| Parameters | Datatype | Description |
| ---------- | -------- | -------------------------------------- |
| Item | ANY | The item used to check the collection. |

#### Return

Expand Down Expand Up @@ -79,10 +79,10 @@ Copies the contents of the collection to an array defined by address and size. T

#### Parameters

| Parameters | Datatype | Description |
| --------------- | -------- | ---------------------------------------------------------- |
| Destination | PVOID | The address of the array which will act as the destination |
| DestinationSize | UDINT | The size of the array which will act as the destination |
| Parameters | Datatype | Description |
| ------------------ | -------- | ---------------------------------------------------------- |
| DestinationAddress | PVOID | The address of the array which will act as the destination |
| DestinationSize | UDINT | The size of the array which will act as the destination |

#### Return

Expand Down
1 change: 1 addition & 0 deletions docs/images/list-example.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions docs/linkedlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,19 @@ linkedList.Clear();

### Contains(Item)

Checks to see if an item is contained in the collection.
Checks to see if an item is contained in the list.

#### Parameters

| Parameters | Datatype | Description |
| ---------- | -------- | ------------------------------------ |
| Item | ANY | The item to store in the collection. |
| Parameters | Datatype | Description |
| ---------- | -------- | ------------------------------ |
| Item | ANY | The item to to check the list. |

#### Return

| Datatype | Description |
| -------- | ------------------------------------------------------- |
| BOOL | Returns true if the item is contained in the collection |
| Datatype | Description |
| -------- | ------------------------------------------------- |
| BOOL | Returns true if the item is contained in the list |

#### Usage

Expand Down Expand Up @@ -283,10 +283,10 @@ Copies the contents of the linkedlist to an array defined by address and size. T

#### Parameters

| Parameters | Datatype | Description |
| --------------- | -------- | ---------------------------------------------------------- |
| Destination | PVOID | The address of the array which will act as the destination |
| DestinationSize | UDINT | The size of the array which will act as the destination |
| Parameters | Datatype | Description |
| ------------------ | -------- | ---------------------------------------------------------- |
| DestinationAddress | PVOID | The address of the array which will act as the destination |
| DestinationSize | UDINT | The size of the array which will act as the destination |

#### Return

Expand Down
Loading

0 comments on commit 36f87dd

Please sign in to comment.