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
    System.Object
    RefCount<T>
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public class RefCount<T> : object
    Type Parameters
    Name Description
    T

    Constructors

    | Improve this Doc View Source

    RefCount(T)

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

    Fields

    | Improve this Doc View Source

    m_object

    Declaration
    protected readonly T m_object
    Field Value
    Type Description
    T

    Methods

    | Improve this Doc View Source

    DecRef()

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

    Declaration
    public void DecRef()
    | Improve this Doc View Source

    Get()

    Declaration
    public T Get()
    Returns
    Type Description
    T
    | Improve this Doc View Source

    GetRefCount()

    Returns the current reference count.

    Declaration
    public int GetRefCount()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    IncRef()

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

    Declaration
    public void IncRef()
    | Improve this Doc View Source

    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()
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)