Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class RefCount<T>

    Manages reference counting for a given object. Extensions can override Release() to do custom logic when reference counting hits 0.

    Inheritance
    object
    RefCount<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public class RefCount<T>
    Type Parameters
    Name Description
    T

    Constructors

    RefCount(T)

    Manages reference counting for a given object. Extensions can override Release() to do custom logic when reference counting hits 0.

    Declaration
    public RefCount(T @object)
    Parameters
    Type Name Description
    T object

    Fields

    m_object

    Manages reference counting for a given object. Extensions can override Release() to do custom logic when reference counting hits 0.

    Declaration
    protected readonly T m_object
    Field Value
    Type Description
    T

    Methods

    DecRef()

    Decrements the reference counting of this object. When reference counting hits 0, calls Release().

    Declaration
    public void DecRef()

    Get()

    Manages reference counting for a given object. Extensions can override Release() to do custom logic when reference counting hits 0.

    Declaration
    public T Get()
    Returns
    Type Description
    T

    GetRefCount()

    Returns the current reference count.

    Declaration
    public int GetRefCount()
    Returns
    Type Description
    int

    IncRef()

    Increments the reference count. Calls to this method must be matched with calls to DecRef().

    Declaration
    public void IncRef()

    Release()

    Called when reference counting hits 0. By default this method does nothing, but extensions can override to e.g. release resources attached to object that is managed by this class.

    Declaration
    protected virtual void Release()
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.