Class GSet<T>
Implements a 'Add Set' CRDT, also called a 'G-Set'. You can't remove elements of a G-Set.
It is described in the paper A comprehensive study of Convergent and Commutative Replicated Data Types.
A G-Set doesn't accumulate any garbage apart from the elements themselves.
This class is immutable, i.e. "modifying" methods return a new instance.
Inherited Members
Namespace: Akka.DistributedData
Assembly: Akka.DistributedData.dll
Syntax
[Serializable]
public sealed class GSet<T> : FastMerge<GSet<T>>, IReplicatedDataSerialization, IEquatable<GSet<T>>, IEnumerable<T>, IEnumerable, IDeltaReplicatedData<GSet<T>, GSet<T>>, IDeltaReplicatedData, IReplicatedData<GSet<T>>, IReplicatedDelta, IReplicatedData
Type Parameters
Name | Description |
---|---|
T | TBD |
Constructors
| Edit this page View SourceGSet()
TBD
Declaration
public GSet()
GSet(IImmutableSet<T>)
TBD
Declaration
public GSet(IImmutableSet<T> elements)
Parameters
Type | Name | Description |
---|---|---|
IImmutableSet<T> | elements | TBD |
GSet(IImmutableSet<T>, GSet<T>)
TBD
Declaration
public GSet(IImmutableSet<T> elements, GSet<T> delta)
Parameters
Type | Name | Description |
---|---|---|
IImmutableSet<T> | elements | TBD |
GSet<T> | delta |
Fields
| Edit this page View SourceEmpty
TBD
Declaration
public static readonly GSet<T> Empty
Field Value
Type | Description |
---|---|
GSet<T> |
Properties
| Edit this page View SourceCount
TBD
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Delta
The accumulated delta of mutator operations since previous
ResetDelta(). When the Akka.DistributedData.Replicator invokes the modify
function
of the Update message and the user code is invoking one or more mutator
operations the data is collecting the delta of the operations and makes
it available for the Akka.DistributedData.Replicator with the Delta accessor. The
modify
function shall still return the full state in the same way as
IReplicatedData<T> without support for deltas.
Declaration
public GSet<T> Delta { get; }
Property Value
Type | Description |
---|---|
GSet<T> |
Elements
TBD
Declaration
public IImmutableSet<T> Elements { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<T> |
IsEmpty
TBD
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
SetType
Declaration
public Type SetType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Edit this page View SourceAdd(T)
TBD
Declaration
public GSet<T> Add(T element)
Parameters
Type | Name | Description |
---|---|---|
T | element | TBD |
Returns
Type | Description |
---|---|
GSet<T> | TBD |
Contains(T)
TBD
Declaration
public bool Contains(T element)
Parameters
Type | Name | Description |
---|---|---|
T | element | TBD |
Returns
Type | Description |
---|---|
bool | TBD |
Equals(GSet<T>)
TBD
Declaration
public bool Equals(GSet<T> other)
Parameters
Type | Name | Description |
---|---|---|
GSet<T> | other | TBD |
Returns
Type | Description |
---|---|
bool | TBD |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<T> |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceMerge(GSet<T>)
TBD
Declaration
public override GSet<T> Merge(GSet<T> other)
Parameters
Type | Name | Description |
---|---|---|
GSet<T> | other | TBD |
Returns
Type | Description |
---|---|
GSet<T> | TBD |
Overrides
| Edit this page View SourceMergeDelta(GSet<T>)
When delta is merged into the full state this method is used. When the type GSet<T> of the delta is of the same type as the full state GSet<T> this method can be implemented by delegating to Merge(T).
Declaration
public GSet<T> MergeDelta(GSet<T> delta)
Parameters
Type | Name | Description |
---|---|---|
GSet<T> | delta |
Returns
Type | Description |
---|---|
GSet<T> |
ResetDelta()
Reset collection of deltas from mutator operations. When the Akka.DistributedData.Replicator
invokes the modify
function of the Update message the delta is always
"reset" and when the user code is invoking one or more mutator operations the
data is collecting the delta of the operations and makes it available for
the Akka.DistributedData.Replicator with the Delta accessor. When the
Akka.DistributedData.Replicator has grabbed the Delta it will invoke this method
to get a clean data instance without the delta.
Declaration
public GSet<T> ResetDelta()
Returns
Type | Description |
---|---|
GSet<T> |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |