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.
Assembly: Akka.DistributedData.dll
Syntax
[Serializable]
public sealed class Flag : IReplicatedData<Flag>, IReplicatedData, IEquatable<Flag>, IComparable<Flag>, IComparable, IReplicatedDataSerialization
Constructors
|
Edit this page
View Source
Flag()
Creates a new Flag instance set to false by default.
Declaration
|
Edit this page
View Source
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 Source
False
Flag with a false value set.
Declaration
public static readonly Flag False
Field Value
|
Edit this page
View Source
True
Flag with a true value set.
Declaration
public static readonly Flag True
Field Value
Properties
|
Edit this page
View Source
Enabled
Checks if current flag value is set.
Declaration
public bool Enabled { get; }
Property Value
Methods
|
Edit this page
View Source
CompareTo(Flag)
Declaration
public int CompareTo(Flag other)
Parameters
Type |
Name |
Description |
Flag |
other |
|
Returns
|
Edit this page
View Source
CompareTo(object)
Declaration
public int CompareTo(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
|
Edit this page
View Source
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
|
|
Edit this page
View Source
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
|
Edit this page
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Edit this page
View Source
Merge(Flag)
Declaration
public Flag Merge(Flag other)
Parameters
Type |
Name |
Description |
Flag |
other |
TBD
|
Returns
Type |
Description |
Flag |
TBD
|
|
Edit this page
View Source
SwitchOn()
Declaration
Returns
Type |
Description |
Flag |
TBD
|
|
Edit this page
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
|
Edit this page
View Source
implicit operator bool(Flag)
Performs an implicit conversion from Flag to bool.
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
|
Implements
Extension Methods