Show / Hide Table of Contents

Struct ReferenceCounted<T>.Scope

Represents a reference that is protected by the counter increment.

Implements
IOptionMonad<T>
ISupplier<object>
IFunctional
IDisposable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
public struct ReferenceCounted<T>.Scope : IOptionMonad<T>, ISupplier<object?>, IFunctional, IDisposable
Remarks

Strong reference is a short-lived scope which protects the resource from being disposed.

Properties

View Source

IsValid

Gets a value indicating that this reference is valid and can be used to access the resource.

Declaration
[MemberNotNullWhen(true, "arc")]
public readonly bool IsValid { get; }
Property Value
Type Description
bool
View Source

Value

Gets the protected resource.

Declaration
public readonly T Value { get; }
Property Value
Type Description
T
View Source

ValueRef

Gets a reference to the protected resource.

Declaration
public readonly ref T ValueRef { get; }
Property Value
Type Description
T
Remarks

This property is useful when the underlying resource is a value type.

Methods

View Source

Dispose()

Releases the strong reference.

Declaration
public void Dispose()
Remarks

This method must not be called more than once.

Implements

IOptionMonad<T>
ISupplier<TResult>
IFunctional
IDisposable

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾