https://github.com/i-e-b/csharpcontainers
Some containers and base classes for general C# development
https://github.com/i-e-b/csharpcontainers
production-ready working
Last synced: 5 months ago
JSON representation
Some containers and base classes for general C# development
- Host: GitHub
- URL: https://github.com/i-e-b/csharpcontainers
- Owner: i-e-b
- License: bsd-3-clause
- Created: 2018-01-18T09:09:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-14T09:07:30.000Z (over 1 year ago)
- Last Synced: 2025-03-29T11:23:31.244Z (over 1 year ago)
- Topics: production-ready, working
- Language: C#
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CsharpContainers
Some containers and base classes for general C# development
## General Containers
* `Result` is a container for passing the value of computations that might fail (such as calls to IO or external services).
* `PartialResult` is a container for passing the value of computations that might fail for multiple reasons or return partially complete results.
* `ValidationOutcome` is a container for passing the value of checks that might fail in an informative way.
* `DisposingContainer` is a disposable list, which calls `Dispose` on contained items when they are removed, replaced, or the list itself is disposed.
Both `Result` and `ValidationOutcome` can be treated as booleans or their contained types to keep code clean.
## Dictionaries
* `Map` is a dictionary wrapper that can generate entries when requested. This helps when working with loosely structured data.
* `MultiMap` is a multi-thread safe dictionary of key => List(value).
* `AgeDictionary` is a thread-safe dictionary that has a maximum age for elements, mainly for caching.
## Queues and Buffers
* `Dequeue` is a generic, auto-sizing, double-ended queue, and attempts to be compatible with JavaScript array semantics.
* `CircularBuffer` is a high performance fixed-size circular buffer, which discards old items when over capacity.
* `BiPartiteQueue` is a fixed-size circular buffer that gives byte-array access, and keeps each item in a contiguous range.
## General Types
* `PartiallyOrdered` is an Abstract class that handles sorting support, equality and inequality overrides from a single comparison method.
* `Nothing` - Represents an empty type in containers. All nothings are created equal.