Search Results for

    Show / Hide Table of Contents

    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

    | Edit this page View Source

    Current

    The current value of this counter.

    Declaration
    T Current { get; }
    Property Value
    Type Description
    T

    Methods

    | Edit this page View Source

    AddAndGet(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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    GetAndIncrement()

    Atomically increments the counter by one.

    Declaration
    T GetAndIncrement()
    Returns
    Type Description
    T

    The original value.

    | Edit this page View Source

    IncrementAndGet()

    Atomically increments the counter by one.

    Declaration
    T IncrementAndGet()
    Returns
    Type Description
    T

    The new value.

    | Edit this page View Source

    Next()

    Increments the counter and gets the next value. This is exactly the same as calling IncrementAndGet().

    Declaration
    T Next()
    Returns
    Type Description
    T
    | Edit this page View Source

    Reset()

    Resets the counter to zero.

    Declaration
    void Reset()

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET