Interface IAtomicCounter<T>
An interface that describes a numeric counter.
Namespace: Akka.Util.Internal
Assembly: Akka.dll
Syntax
public interface IAtomicCounter<T>
Type Parameters
Name | Description |
---|---|
T | The type of the numeric. |
Properties
| Improve this Doc View SourceCurrent
The current value of this counter.
Declaration
T Current { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceAddAndGet(T)
Adds the specified value to the counter and returns the new value.
Declaration
T AddAndGet(T amount)
Parameters
Type | Name | Description |
---|---|---|
T | amount | The amount to add to the counter. |
Returns
Type | Description |
---|---|
T | The new value after additions. |
GetAndAdd(T)
Returns the current value and adds the specified value to the counter.
Declaration
T GetAndAdd(T amount)
Parameters
Type | Name | Description |
---|---|---|
T | amount | The amount to add to the counter. |
Returns
Type | Description |
---|---|
T | The original value before additions. |
GetAndIncrement()
Atomically increments the counter by one.
Declaration
T GetAndIncrement()
Returns
Type | Description |
---|---|
T | The original value. |
IncrementAndGet()
Atomically increments the counter by one.
Declaration
T IncrementAndGet()
Returns
Type | Description |
---|---|
T | The new value. |
Next()
Increments the counter and gets the next value. This is exactly the same as calling IncrementAndGet().
Declaration
T Next()
Returns
Type | Description |
---|---|
T |
Reset()
Resets the counter to zero.
Declaration
void Reset()