Interface IHastingsCareTaker
Caretaker of memento pattern is responsible for the memento's safekeeping, never operates on or examines the contents of a memento. https://www.dofactory.com/net/memento-design-pattern
Namespace: Catalyst.Abstractions.P2P.Discovery
Assembly: Catalyst.Abstractions.dll
Syntax
public interface IHastingsCareTaker
Properties
| Improve this Doc View SourceHastingMementoList
Declaration
ConcurrentStack<IHastingsMemento> HastingMementoList { get; }
Property Value
Type | Description |
---|---|
System.Collections.Concurrent.ConcurrentStack<IHastingsMemento> |
Methods
| Improve this Doc View SourceAdd(IHastingsMemento)
Adds a new state from the walk on top of the HastingMementoList.
Declaration
void Add(IHastingsMemento hastingsMemento)
Parameters
Type | Name | Description |
---|---|---|
IHastingsMemento | hastingsMemento |
Get()
Gets the last state of the walk from the queue and pops it off the HastingMementoList.
Declaration
IHastingsMemento Get()
Returns
Type | Description |
---|---|
IHastingsMemento |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | When the HastingMementoList is empty. |
Peek()
Returns the item at the top of the top of the HastingMementoList without popping it.
Declaration
IHastingsMemento Peek()
Returns
Type | Description |
---|---|
IHastingsMemento | The memento currently at the top of the queue if any. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | When the HastingMementoList is empty. |