Class ManagedConcurrentStack<TValue>
A ConcurrentStack that maps to the appropriate platform version.
Inheritance
System.Object
ManagedConcurrentStack<TValue>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class ManagedConcurrentStack<TValue>
Type Parameters
Name | Description |
---|---|
TValue |
Constructors
ManagedConcurrentStack()
Creates a new instance of a ConcurrentStack.
Declaration
public ManagedConcurrentStack()
Properties
Count
Gets the amount of items in the stack.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsEmpty
Gets true if the stack is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Clear()
Clears the stack of all items.
Declaration
public void Clear()
Push(TValue)
Pushes a new item on top of the stack.
Declaration
public void Push(TValue item)
Parameters
Type | Name | Description |
---|---|---|
TValue | item | The item to push. |
TryPeek(out TValue)
Tries to peek at the top value in stack.
Declaration
public bool TryPeek(out TValue result)
Parameters
Type | Name | Description |
---|---|---|
TValue | result | The value from the stack if possible, null otherwise. |
Returns
Type | Description |
---|---|
System.Boolean | True if peek succeeded, false if not. |
TryPop(out TValue)
Tries to pop the top value off of the stack.
Declaration
public bool TryPop(out TValue result)
Parameters
Type | Name | Description |
---|---|---|
TValue | result | The value from the top of the stack if possible, null otherwise. |
Returns
Type | Description |
---|---|
System.Boolean | True if pop suceeded, false if not. |