RJCP.Core.Datastructures
0.2.1
dotnet add package RJCP.Core.Datastructures --version 0.2.1
NuGet\Install-Package RJCP.Core.Datastructures -Version 0.2.1
<PackageReference Include="RJCP.Core.Datastructures" Version="0.2.1" />
paket add RJCP.Core.Datastructures --version 0.2.1
#r "nuget: RJCP.Core.Datastructures, 0.2.1"
// Install RJCP.Core.Datastructures as a Cake Addin #addin nuget:?package=RJCP.Core.Datastructures&version=0.2.1 // Install RJCP.Core.Datastructures as a Cake Tool #tool nuget:?package=RJCP.Core.Datastructures&version=0.2.1
Datastructures
This library contains a set of useful implementations that can be used in multiple different projects.
1. Features
1.1. CRC Algorithms
Provides various values for CRC16 and CRC32 algorithms. It can use precomputed tables, or algorithms where the user provides the polynomials, seeds and any inversions.
See Benchmarks for performance metrics.
1.2. Bit Operations
Support for converting byte buffers into short
, ushort
, int
, uint
,
long
, ulong
, big endian or little endian. Newer .NET Core versions bring
similar algorithms. The implementation provides unsafe (with faster performance).
See Benchmarks for performance metrics.
1.3. IDeepClonable
Provide an interface that implies an object is deep clonable (as opposed to the
standard .NET MemberwiseClone
which is a shallow clone).
1.4. Result
The Result
is an interesting datatype that takes inspiration from modern C++20
and Rust, where a result is not a value type, and one normally encodes errors as
either null
or -1
, but now one can encode an error, or the correct value,
directly in to the result of a function call.
When defining a function return a Result<int>
for example, the function can
just return the value, as it would if the return type would be an int
. If an
exception occurs, the exception would be returned with FromException
.
public Result<int> GetValue(bool isError) {
if (isError)
return Result.FromException<int>(new InvalidArgumentException("there's an error"));
return 42;
}
var r = GetValue(false);
if (!r.HasValue)
Console.WriteLine($"Error - {r.Error?.Message}");
else
Console.WriteLine($"Value = {r.Value}");
if (!r.TryGet(out int v)))
Console.WriteLine($"Error - {r.Error?.Message}");
else
Console.WriteLine($"Value = {v}");
1.5. Semantic Versioning
Use SemVer
or SemVer2
to manage versions using Semantic Versioning rules.
Version comparisons can be made, and additional version information can be
added.
1.6. INamedItem and NamedItemCollection
A collection of objects deriving from INamedItem
. Derive from
Collections.Generic.NamedItemCollection
to handle a collection of objects with
a name.
1.7. EventLog
Manage an event log, that events can be written as they occur, so typically, a
user interface will be notified of events and can update its controls
accordingly. It implements an IList<IEvent<T>>, INotifyCollectionChanged
.
It can help by maintaining the maximum severity that is logged, such that actions can be performed if an error or a critical event was logged.
2. Release History
2.1. Version 0.2.1
Bugfixes:
- Exceptions now throw stack trace information on .NET Framework and .NET 6.0 (DOTNET-867)
Quality:
- Add README.md reference to NuGet package (DOTNET-811)
- Apply SemVer fixes for CA1861 (DOTNET-833)
- Update .NET 4.5 to 4.6.2 (DOTNET-827, DOTNET-906) and .NET Standard 2.1 to .NET 6.0 (DOTNET-936, DOTNET-941, DOTNET-942, DOTNET-945)
- Apply aggressive inlining for .NET Framework 4.6.2 (DOTNET-871)
2.2. Version 0.2.0
- Initial Version
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.0
- RJCP.Core.SysCompat (>= 0.2.0)
-
.NETFramework 4.6.2
- RJCP.Core.SysCompat (>= 0.2.0)
-
net6.0
- RJCP.Core.SysCompat (>= 0.2.0)
-
net8.0
- RJCP.Core.SysCompat (>= 0.2.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on RJCP.Core.Datastructures:
Package | Downloads |
---|---|
RJCP.Core.Xml
.NET library for useful XML functions. |
|
RJCP.Diagnostics.Log
Parse external log streams. |
|
RJCP.Diagnostics.Log.Dlt
An AutoSAR DLT v1 Decoder and Encoder. |
|
RJCP.IO.Path
Functions to work with and manipulate paths for Unix and Windows. |
GitHub repositories
This package is not used by any popular GitHub repositories.