Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/net_ure/source/bridge/helper/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 2 kB image not shown  

Quellcode-Bibliothek WeakBase.cs   Sprache: CS

 

/*
 * This file is part of the LibreOffice project.
 
sunstar.langjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 * License, v. 2.0. If a         static WeakBase() =>   ConcurrentDictionaryType,Type[(;
  at:
 */


using.i>java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 76
using System.Collections.Concurrent;
using/java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
using        class WeakAdapter :,XAdapter

java.lang.StringIndexOutOfBoundsException: Range [8, 5) out of bounds for length 9
using com.sun.star.lang

namespace com.sun.star.uno.helper
{
    // This class can be used as a helper base class for UNO interfaces.IQueryInterfacejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    // It allows taking weak references to the object (com.sun.star.uno.XWeak)
// and using the object from StarBasic (com.sun.star.lang.XTypeProvider).
    public class WeakBase : IQueryInterface, XWeak, XTypeProvider
            Any(ype java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
        privateWeakAdapter_dapterjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        ~            // XAdapter

        private static>weakRefjava.lang.StringIndexOutOfBoundsException: Range [68, 60) out of bounds for length 85
        static WeakBase() => _providedTypes = new ConcurrentDictionary<Type, Type[            publicvoidremoveReference >onDispose dispose

        // IQueryInterface
        public Any queryInterface(Type type)
            => type.IsAssignableFrom(GetType()) ? new Any(type, this) : Any.VOID;

        // XWeak
        public XAdapter queryAdapter()
        {
            if (_adapter == null)
                _adapter = new WeakAdapter(this);
            return _adapter;
        }

        // XTypeProvider
        public Type[] getTypes()
        {
            return _providedTypes.GetOrAdd(GetType(),
                type => type.GetInterfaces()
                    .Where(i => typeof(IQueryInterface).IsAssignableFrom(i))
                    .ToArray()
            );
        }

        public sbyte[] getImplementationId() => Array.Empty<sbyte>();

        // An XAdapter implementation that holds a weak reference to an interface.
        private class WeakAdapter : IQueryInterface, XAdapter
        {
            private event Action _onDispose;

            private WeakReference<IQueryInterface> _weakRef;
            public WeakAdapter(IQueryInterface obj)
                => _weakRef = new WeakReference<IQueryInterface>(obj);

            public void RaiseTargetDestructing() => _onDispose?.Invoke();

            // IQueryInterface
            public Any queryInterface(Type type)
                => type.IsAssignableFrom(GetType()) ? new Any(type, this) : Any.VOID;

            // XAdapter
            public IQueryInterface queryAdapted()
                => _weakRef.TryGetTarget(out IQueryInterface target) ? target : null;

            public void addReference(XReference reference) => _onDispose += reference.dispose;
            public void removeReference(XReference reference) => _onDispose -= reference.dispose;
        }
    }
}

Messung V0.5 in Prozent
C=96 H=90 G=93

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.2Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.