Ejemplo n.º 1
0
 internal LiftedList(
     int itemCount,
     GetRowDelegate rowFectcher,
     CreateObjectDelegate <T> factory,
     Func <bool> disposedChecker
     ) : this(itemCount, rowFectcher, (pRow, index) => factory(pRow), disposedChecker)
 {
     factory.CheckNotNull("factory");
 }
Ejemplo n.º 2
0
 public static LiftedValueTypeList <T> Create <T>(
     int itemCount,
     GetRowDelegate rowFectcher,
     CreateObjectDelegate <T> factory,
     Func <bool> disposedChecker
     ) where T : struct
 {
     return(new LiftedValueTypeList <T>(itemCount, rowFectcher, factory, disposedChecker));
 }
Ejemplo n.º 3
0
            public DBRow GetRow(int index)
            {
                if (_getRow == null)
                {
                    _getRow = Helper.Magic.RegisterDelegate <GetRowDelegate>(Offsets.ClientDB_GetRow);
                }
                var row = _getRow(Pointer, index);

                return(row == IntPtr.Zero ? null : new DBRow(row));
            }
Ejemplo n.º 4
0
        internal LiftedList(
            int itemCount,
            GetRowDelegate rowFetcher,
            CreateObjectDelegateEX <T> factory,
            Func <bool> disposedChecker
            )
        {
            itemCount.CheckGTE(0, "itemCount");

            rowFetcher.CheckNotNull("rowFetcher");
            factory.CheckNotNull("factory");
            CreateObject = (index) => factory(rowFetcher(index), index);
            IsDisposed   = disposedChecker.CheckNotNull("disposedChecker");

            m_array = new T[itemCount];
        }