Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ReferenceManagerExtensions

    Inheritance
    object
    ReferenceManagerExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public static class ReferenceManagerExtensions

    Methods

    GetContext<T>(ReferenceManager<T>)

    Obtain the current reference.

    Like Acquire(), but intended for use in a using block so calling Release(G) happens implicitly. For example:

    var searcherManager = new SearcherManager(indexWriter, true, null);
           using (var context = searcherManager.GetContext())
           {
               IndexSearcher searcher = context.Reference;
    
           // use searcher...
       }</code></pre>
    
    Declaration
    public static ReferenceContext<T> GetContext<T>(this ReferenceManager<T> referenceManager) where T : class
    Parameters
    Type Name Description
    ReferenceManager<T> referenceManager

    this ReferenceManager<G>

    Returns
    Type Description
    ReferenceContext<T>

    A ReferenceContext<T> instance that holds the Reference and ensures it is released properly when Dispose() is called.

    Type Parameters
    Name Description
    T

    The reference type

    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.