ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Protected Attributes | Properties | List of all members
ImageResizer.Plugins.DiskCache.Cleanup.CleanupQueue Class Reference

Public Member Functions

void Queue (CleanupWorkItem item)
 
bool QueueIfUnique (CleanupWorkItem item)
 Queues the item if no other identical items exist in the queue. Returns true if the item was added. More...
 
bool Exists (CleanupWorkItem item)
 
void Insert (CleanupWorkItem item)
 
void QueueRange (IEnumerable< CleanupWorkItem > items)
 
void InsertRange (IList< CleanupWorkItem > items)
 Inserts the specified list of items and the end of the queue. They will be next items popped. They will pop off the list in the same order they exist in 'items' (i.e, they are inserted in reverse order). More...
 
CleanupWorkItem Pop ()
 
void Clear ()
 
void ReplaceWith (CleanupWorkItem item)
 Performs an atomic clear and enqueue of the specified item More...
 

Protected Attributes

readonly object _sync = new object()
 

Properties

bool IsEmpty [get]
 
int Count [get]
 

Detailed Description

Definition at line 9 of file CleanupQueue.cs.

Member Function Documentation

void ImageResizer.Plugins.DiskCache.Cleanup.CleanupQueue.InsertRange ( IList< CleanupWorkItem items)
inline

Inserts the specified list of items and the end of the queue. They will be next items popped. They will pop off the list in the same order they exist in 'items' (i.e, they are inserted in reverse order).

Parameters
items

Definition at line 56 of file CleanupQueue.cs.

56  {
57  lock (_sync) {
58  ReverseEnumerable<CleanupWorkItem> reversed = new ReverseEnumerable<CleanupWorkItem>(new System.Collections.ObjectModel.ReadOnlyCollection<CleanupWorkItem>(items));
59  foreach (CleanupWorkItem item in reversed)
60  queue.AddFirst(item);
61  }
62  }
bool ImageResizer.Plugins.DiskCache.Cleanup.CleanupQueue.QueueIfUnique ( CleanupWorkItem  item)
inline

Queues the item if no other identical items exist in the queue. Returns true if the item was added.

Parameters
item
Returns

Definition at line 27 of file CleanupQueue.cs.

27  {
28  lock (_sync) {
29  bool unique = !queue.Contains(item);
30  if (unique) queue.AddLast(item);
31  return unique;
32  }
33  }
void ImageResizer.Plugins.DiskCache.Cleanup.CleanupQueue.ReplaceWith ( CleanupWorkItem  item)
inline

Performs an atomic clear and enqueue of the specified item

Parameters
item

Definition at line 90 of file CleanupQueue.cs.

90  {
91  lock (_sync) {
92  queue.Clear();
93  queue.AddLast(item);
94  }
95  }

The documentation for this class was generated from the following file: