Class Flag
Implements a boolean flag CRDT that is initialized to false and
can be switched to true. true wins over false in merge.
This class is immutable, i.e. "modifying" methods return a new instance.
Implements
Inherited Members
Namespace: Akka.DistributedData
Assembly: Akka.DistributedData.dll
Syntax
[Serializable]
public sealed class Flag : IReplicatedData<Flag>, IReplicatedData, IEquatable<Flag>, IComparable<Flag>, IComparable, IReplicatedDataSerialization
Constructors
| Edit this page View SourceFlag()
Creates a new Flag instance set to false by default.
Declaration
public Flag()
Flag(bool)
Creates a new Flag instance with value set to specified parameter.
Declaration
public Flag(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | TBD |
Fields
| Edit this page View SourceFalse
Flag with a false value set.
Declaration
public static readonly Flag False
Field Value
| Type | Description |
|---|---|
| Flag |
True
Flag with a true value set.
Declaration
public static readonly Flag True
Field Value
| Type | Description |
|---|---|
| Flag |
Properties
| Edit this page View SourceEnabled
Checks if current flag value is set.
Declaration
public bool Enabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
| Edit this page View SourceCompareTo(Flag)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(Flag other)
Parameters
| Type | Name | Description |
|---|---|---|
| Flag | other | An object to compare with this instance. |
Returns
| Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
CompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | An object to compare with this instance. |
Returns
| Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
Equals(Flag)
Checks if two flags are equal to each other.
Declaration
public bool Equals(Flag other)
Parameters
| Type | Name | Description |
|---|---|---|
| Flag | other | TBD |
Returns
| Type | Description |
|---|---|
| bool | TBD |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceMerge(Flag)
TBD
Declaration
public Flag Merge(Flag other)
Parameters
| Type | Name | Description |
|---|---|---|
| Flag | other | TBD |
Returns
| Type | Description |
|---|---|
| Flag | TBD |
SwitchOn()
TBD
Declaration
public Flag SwitchOn()
Returns
| Type | Description |
|---|---|
| Flag | TBD |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
Operators
| Edit this page View Sourceimplicit operator bool(Flag)
Declaration
public static implicit operator bool(Flag flag)
Parameters
| Type | Name | Description |
|---|---|---|
| Flag | flag | The flag to convert |
Returns
| Type | Description |
|---|---|
| bool | The result of the conversion |
Edit this page