[#24] Client: Implement pool part1

first iteration - base classes and methods

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-10-21 10:48:00 +03:00
parent d1271df207
commit c9a75ea025
72 changed files with 2786 additions and 468 deletions

View file

@ -1,42 +1,41 @@
using Google.Protobuf;
namespace FrostFS.SDK.ClientV2
namespace FrostFS.SDK.ClientV2;
public struct FrostFsChain(byte[] raw) : System.IEquatable<FrostFsChain>
{
public struct FrostFsChain(byte[] raw) : System.IEquatable<FrostFsChain>
private ByteString? grpcRaw;
public byte[] Raw { get; } = raw;
internal ByteString GetRaw()
{
private ByteString? grpcRaw;
return grpcRaw ??= ByteString.CopyFrom(Raw);
}
public byte[] Raw { get; } = raw;
public override readonly bool Equals(object obj)
{
var chain = (FrostFsChain)obj;
return Equals(chain);
}
internal ByteString GetRaw()
{
return grpcRaw ??= ByteString.CopyFrom(Raw);
}
public override readonly int GetHashCode()
{
return Raw.GetHashCode();
}
public override readonly bool Equals(object obj)
{
var chain = (FrostFsChain)obj;
return Equals(chain);
}
public static bool operator ==(FrostFsChain left, FrostFsChain right)
{
return left.Equals(right);
}
public override readonly int GetHashCode()
{
return Raw.GetHashCode();
}
public static bool operator !=(FrostFsChain left, FrostFsChain right)
{
return !(left == right);
}
public static bool operator ==(FrostFsChain left, FrostFsChain right)
{
return left.Equals(right);
}
public static bool operator !=(FrostFsChain left, FrostFsChain right)
{
return !(left == right);
}
public readonly bool Equals(FrostFsChain other)
{
return Raw == other.Raw;
}
public readonly bool Equals(FrostFsChain other)
{
return Raw == other.Raw;
}
}