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