public FasterList(FasterList <T> listCopy) { _buffer = new T[listCopy.Count]; listCopy.CopyTo(_buffer, 0); _count = listCopy.Count; }
public FasterReadOnlyList(FasterList <T> list) { _list = list; int count; _buffer = FasterList <T> .NoVirt.ToArrayFast(list, out count); }
public FasterListThreadSafe(FasterList <T> list) { if (list == null) { throw new ArgumentException("invalid list"); } _list = list; _lockQ = new ReaderWriterLockSlim(); }
public ThreadSafeFasterList(FasterList <T> list) { if (list == null) { throw new ArgumentException("invalid list"); } _list = list; _lockQ = ReaderWriterLockSlimEx.Create(); }
public void AddRange(FasterList <T> items) { var count = items.Count; if (_count + count >= _buffer.Length) { AllocateMore(_count + count); } Array.Copy(items._buffer, 0, _buffer, _count, count); _count += count; }
/// <summary> /// this is a dirtish trick to be able to use the index operator /// before adding the elements through the Add functions /// </summary> /// <typeparam name="U"></typeparam> /// <param name="initialSize"></param> /// <returns></returns> public static FasterList <T> PreFill <U>(int initialSize) where U : class, T, new() { var list = new FasterList <T>(initialSize); var listCount = list._count; for (int i = 0; i < initialSize; i++) { list[listCount + i] = new U(); } return(list); }
public static FasterList <T> PreFill <U>(int initialSize) where U : T, new() { var list = new FasterList <T>(initialSize); for (int i = 0; i < initialSize; i++) { list.Add(new U()); } list.Clear(); return(list); }
public void DequeueInto(FasterList <T> list, int count) { _lockQ.EnterWriteLock(); try { int originalSize = _queue.Count; while (_queue.Count > 0 && originalSize - _queue.Count < count) { list.Add(_queue.Dequeue()); } } finally { _lockQ.ExitWriteLock(); } }
public void DequeueAllInto(FasterList <T> list) { LockQ.EnterWriteLock(); try { while (m_Queue.Count > 0) { list.Add(m_Queue.Dequeue()); } } finally { LockQ.ExitWriteLock(); } }
public FasterList <T> DequeueAll() { FasterList <T> returnList = new FasterList <T>(_queue.Count); _lockQ.EnterWriteLock(); try { while (_queue.Count > 0) { returnList.Add(_queue.Dequeue()); } return(returnList); } finally { _lockQ.ExitWriteLock(); } }
public FasterList <U> DequeueAllAs <U>() where U : class { FasterList <U> returnList = new FasterList <U>(); _lockQ.EnterWriteLock(); try { while (_queue.Count > 0) { returnList.Add(_queue.Dequeue() as U); } return(returnList); } finally { _lockQ.ExitWriteLock(); } }
public void DequeueAllInto(FasterList <T> list) { int i = list.Count; list.ExpandBy((uint)_queue.Count); var array = list.ToArrayFast(); _lockQ.EnterWriteLock(); try { while (_queue.Count > 0) { array[i++] = _queue.Dequeue(); } } finally { _lockQ.ExitWriteLock(); } }
public void DequeueAllInto(FasterList <T> list) { LockQ.EnterWriteLock(); try { int i = list.Count; list.GrowAndSetCount(m_Queue.Count); var array = list.ToArrayFast(); while (m_Queue.Count > 0) { array[i++] = m_Queue.Dequeue(); } } finally { LockQ.ExitWriteLock(); } }
public ThreadSafeFasterList() { _list = new FasterList <T>(); _lockQ = ReaderWriterLockSlimEx.Create(); }
public void AddRange(FasterList <T> items) { AddRange(items.ToArrayFast(), items.Count); }
public FasterListThreadSafe() { _list = new FasterList <T>(); _lockQ = new ReaderWriterLockSlim(); }
public static void FastSet(FasterList <T> fasterList, int index, T item) { fasterList._buffer[index] = item; fasterList._count = index + 1; }
public HeapPriorityQueue(int initialSize) { _numNodes = 0; _nodes = new FasterList <T>(initialSize); _numNodesEverEnqueued = 0; }
/// <summary> /// Instantiate a new Priority Queue /// </summary> /// <param name="maxNodes">The max nodes ever allowed to be enqueued (going over this will cause an exception)</param> public HeapPriorityQueue() { _numNodes = 0; _nodes = new FasterList <T>(); _numNodesEverEnqueued = 0; }
internal FasterSparseList(FasterDenseList <T> denseSet) { _denseSet = denseSet; _keys = new FasterList <uint>(); }
public static T[] ToArrayFast(FasterList <T> fasterList, out int count) { count = fasterList._count; return(fasterList._buffer); }
public static int Count(FasterList <T> fasterList) { return(fasterList._count); }
public void CopyValuesTo(FasterList <TValue> values) { values.ExpandTo((uint)_dict.count); CopyValuesTo(values.ToArrayFast(out _), 0); }
public FasterListThreadSafe(FasterList <T> list) { _list = list; _lockQ = new ReaderWriterLockSlim(); }
public FasterDenseList() { values = new FasterList <T>(); }
public ThreadSafeQueue() { _queue = new FasterList <T>(1); }
public void CopyTo(FasterList <TValue> transientEntitiesOperations) { transientEntitiesOperations.ExpandTo(_dict.count); CopyTo(transientEntitiesOperations.ToArrayFast()); }
internal static T[] ToArrayFast(FasterList <T> fasterList) { return(fasterList._buffer); }
public FasterReadOnlyList(FasterList <T> list) { _list = list; }
public ThreadSafeQueue(int capacity) { _queue = new FasterList <T>(capacity); }