C# Класс kOS.Safe.Execution.Stack

Наследование: IStack
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Clear ( ) : void
Dump ( ) : string
GetCallTrace ( ) : List

Return the subroutine call trace of how the code got to where it is right now.

GetLogicalSize ( ) : int

Returns the logical size of the current stack (not its potentially larger storage size).

HasTriggerContexts ( ) : bool

This stack tracks all its pushes and pops to know whether or not it contains subroutine contexts which are from triggers. If there are any still triggers in the stack, this returns true, else false.

MoveStackPointer ( int delta ) : void
Peek ( int digDepth ) : object

Slightly "cheats" and breaks out of the 'stack' model by allowing you to view the contents of somewhere on the stack that is underneath the topmost thing. You can only peek, but not pop values this way.

PeekCheck ( int digDepth, object &item ) : bool

Slightly "cheats" and breaks out of the 'stack' model by allowing you to view the contents of somewhere on the stack that is underneath the topmost thing. You can only peek, but not pop values this way. It returns both the object found there (as an out parameter) and a boolean for whether or not your peek attempt went out of bounds of the stack.

Pop ( ) : object
Push ( object item ) : void

Приватные методы

Метод Описание
ProcessItem ( object item ) : object

Make any conversion needed before pushing an item onto the stack

ThrowIfInvalid ( object item ) : void

Описание методов

Clear() публичный Метод

public Clear ( ) : void
Результат void

Dump() публичный Метод

public Dump ( ) : string
Результат string

GetCallTrace() публичный Метод

Return the subroutine call trace of how the code got to where it is right now.
public GetCallTrace ( ) : List
Результат List

GetLogicalSize() публичный Метод

Returns the logical size of the current stack (not its potentially larger storage size).
public GetLogicalSize ( ) : int
Результат int

HasTriggerContexts() публичный Метод

This stack tracks all its pushes and pops to know whether or not it contains subroutine contexts which are from triggers. If there are any still triggers in the stack, this returns true, else false.
public HasTriggerContexts ( ) : bool
Результат bool

MoveStackPointer() публичный Метод

public MoveStackPointer ( int delta ) : void
delta int
Результат void

Peek() публичный Метод

Slightly "cheats" and breaks out of the 'stack' model by allowing you to view the contents of somewhere on the stack that is underneath the topmost thing. You can only peek, but not pop values this way.
public Peek ( int digDepth ) : object
digDepth int How far underneath the top to look. Zero means peek at the top, /// 1 means peek at the item just under the top, 2 means peek at the item just under that, and /// so on. Note you CAN peek a negative number, which looks at the secret stack above the /// stack - where the subroutine contexts and local variable contexts are.
Результат object

PeekCheck() публичный Метод

Slightly "cheats" and breaks out of the 'stack' model by allowing you to view the contents of somewhere on the stack that is underneath the topmost thing. You can only peek, but not pop values this way. It returns both the object found there (as an out parameter) and a boolean for whether or not your peek attempt went out of bounds of the stack.
public PeekCheck ( int digDepth, object &item ) : bool
digDepth int How far underneath the top to look. Zero means peek at the top, /// 1 means peek at the item just under the top, 2 means peek at the item just under that, and /// so on. Note you CAN peek a negative number, which looks at the secret stack above the /// stack - where the subroutine contexts and local variable contexts are.
item object The object at that depth. Will be null when digDepth is too large and the stack isn't /// big enough to dig that deep, but it also could return null if the actual value stored there on /// the stack really is a null. If you need to be certain of the difference, use the return value.
Результат bool

Pop() публичный Метод

public Pop ( ) : object
Результат object

Push() публичный Метод

public Push ( object item ) : void
item object
Результат void