PgAtomic
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Supplies wrapping arithmetic and atomic bitwise operations for PostgreSQL shared scalars.
public static class PgAtomicInheritance: object
Methods
Section titled “Methods”Add<T>(PgAtomic<T>, T)
Section titled “Add<T>(PgAtomic<T>, T)”Adds an integer with wrapping overflow and returns the updated value.
public static T Add<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The amount to add.
Returns: T
The sum stored by this operation.
And(PgAtomic<bool>, bool)
Section titled “And(PgAtomic<bool>, bool)”Stores the Boolean conjunction and returns the previous value.
public static bool And(this PgAtomic<bool> storage, bool value)Parameters:
storage — PgAtomic<bool>
The registered Boolean scalar.
value — bool
The other operand.
Returns: bool
The value before the update.
And<T>(PgAtomic<T>, T)
Section titled “And<T>(PgAtomic<T>, T)”Stores the bitwise AND and returns the previous value, following Interlocked.And.
public static T And<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The bit mask.
Returns: T
The value before the update.
Decrement<T>(PgAtomic<T>)
Section titled “Decrement<T>(PgAtomic<T>)”Subtracts one with wrapping overflow and returns the updated value.
public static T Decrement<T>(this PgAtomic<T> storage) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
Returns: T
The decremented value.
Increment<T>(PgAtomic<T>)
Section titled “Increment<T>(PgAtomic<T>)”Adds one with wrapping overflow and returns the updated value.
public static T Increment<T>(this PgAtomic<T> storage) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
Returns: T
The incremented value.
Max<T>(PgAtomic<T>, T)
Section titled “Max<T>(PgAtomic<T>, T)”Stores the larger of the current value and an operand and returns the previous value.
public static T Max<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The other operand.
Returns: T
The value before the update.
Min<T>(PgAtomic<T>, T)
Section titled “Min<T>(PgAtomic<T>, T)”Stores the smaller of the current value and an operand and returns the previous value.
public static T Min<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The other operand.
Returns: T
The value before the update.
Or(PgAtomic<bool>, bool)
Section titled “Or(PgAtomic<bool>, bool)”Stores the Boolean disjunction and returns the previous value.
public static bool Or(this PgAtomic<bool> storage, bool value)Parameters:
storage — PgAtomic<bool>
The registered Boolean scalar.
value — bool
The other operand.
Returns: bool
The value before the update.
Or<T>(PgAtomic<T>, T)
Section titled “Or<T>(PgAtomic<T>, T)”Stores the bitwise OR and returns the previous value, following Interlocked.Or.
public static T Or<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The bit mask.
Returns: T
The value before the update.
Subtract<T>(PgAtomic<T>, T)
Section titled “Subtract<T>(PgAtomic<T>, T)”Subtracts an integer with wrapping overflow and returns the updated value.
public static T Subtract<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The amount to subtract.
Returns: T
The difference stored by this operation.
Xor(PgAtomic<bool>, bool)
Section titled “Xor(PgAtomic<bool>, bool)”Stores the Boolean exclusive OR and returns the previous value.
public static bool Xor(this PgAtomic<bool> storage, bool value)Parameters:
storage — PgAtomic<bool>
The registered Boolean scalar.
value — bool
The other operand.
Returns: bool
The value before the update.
Xor<T>(PgAtomic<T>, T)
Section titled “Xor<T>(PgAtomic<T>, T)”Stores the bitwise exclusive OR and returns the previous value.
public static T Xor<T>(this PgAtomic<T> storage, T value) where T : unmanaged, IBinaryInteger<T>Type parameters:
T
A supported unmanaged binary integer.
Parameters:
storage — PgAtomic<T>
The registered scalar.
value — T
The bit mask.
Returns: T
The value before the update.