public void SetNext <_T0>(IntrusiveCollection <_T0> list, IntrusiveCollection.Element next) where _T0 : IntrusiveCollection.Element { // IntrusiveCollection.Element System.Diagnostics.Debug.Assert(list == pool.GetDirectiveList()); this.next = next; }
public void SetPrev <_T0>(IntrusiveCollection <_T0> list, IntrusiveCollection.Element prev) where _T0 : IntrusiveCollection.Element { // IntrusiveCollection.Element System.Diagnostics.Debug.Assert(list == pool.GetDirectiveList()); this.prev = prev; }
public void RemoveInternal <_T0>(IntrusiveCollection <_T0> list) where _T0 : IntrusiveCollection.Element { // IntrusiveCollection.Element System.Diagnostics.Debug.Assert(list == pool.GetDirectiveList()); this.pool = null; this.prev = null; this.next = null; }
public IntrusiveCollection.Element GetNext <_T0>(IntrusiveCollection <_T0> list) where _T0 : IntrusiveCollection.Element { // IntrusiveCollection.Element if (list != pool.GetDirectiveList()) { return(null); } return(this.next); }
// // IntrusiveCollection.Element implementation // public void InsertInternal <_T0>(IntrusiveCollection <_T0> list, IntrusiveCollection.Element prev, IntrusiveCollection.Element next) where _T0 : IntrusiveCollection.Element { // IntrusiveCollection.Element System.Diagnostics.Debug.Assert(this.pool == null); this.pool = ((CachePool.DirectiveList)list).GetCachePool(); this.prev = prev; this.next = next; }
public bool IsInList <_T0>(IntrusiveCollection <_T0> list) where _T0 : IntrusiveCollection.Element { for (int i = 0; i < triplets.Length; i += 3) { if (triplets[i] == list) { return(true); } } return(false); }
public IntrusiveCollection.Element GetNext <_T0>(IntrusiveCollection <_T0> list) where _T0 : IntrusiveCollection.Element { for (int i = 0; i < triplets.Length; i += 3) { if (triplets[i] == list) { return((IntrusiveCollection.Element)triplets[i + 2]); } } throw new RuntimeException("Called getNext on an element that wasn't " + "in the list." ); }
public void SetNext <_T0>(IntrusiveCollection <_T0> list, IntrusiveCollection.Element next) where _T0 : IntrusiveCollection.Element { for (int i = 0; i < triplets.Length; i += 3) { if (triplets[i] == list) { triplets[i + 2] = next; return; } } throw new RuntimeException("Called setNext on an element that wasn't " + "in the list." ); }
public void RemoveInternal <_T0>(IntrusiveCollection <_T0> list) where _T0 : IntrusiveCollection.Element { for (int i = 0; i < triplets.Length; i += 3) { if (triplets[i] == list) { object[] newTriplets = new object[triplets.Length - 3]; System.Array.Copy(triplets, 0, newTriplets, 0, i); System.Array.Copy(triplets, i + 3, newTriplets, i, triplets.Length - (i + 3)); triplets = newTriplets; return; } } throw new RuntimeException("Called remove on an element that wasn't " + "in the list." ); }
public void InsertInternal <_T0>(IntrusiveCollection <_T0> list, IntrusiveCollection.Element prev, IntrusiveCollection.Element next) where _T0 : IntrusiveCollection.Element { for (int i = 0; i < triplets.Length; i += 3) { if (triplets[i] == list) { throw new RuntimeException("Trying to re-insert an element that " + "is already in the list." ); } } object[] newTriplets = Arrays.CopyOf(triplets, triplets.Length + 3); newTriplets[triplets.Length] = list; newTriplets[triplets.Length + 1] = prev; newTriplets[triplets.Length + 2] = next; triplets = newTriplets; }
public bool IsInList <_T0>(IntrusiveCollection <_T0> list) where _T0 : IntrusiveCollection.Element { // IntrusiveCollection.Element return(pool == null ? false : list == pool.GetDirectiveList()); }